What's the best options(s) to structure our multi-country site. The site probably wants to be managed off one installation, but it will be (in terms of thinking about it) country-based not language-based so for example:
www.example.com/ca/fr/widget/price would be in French with the price in CAN dollars
www.example.com/fr/fr/widget/price would be in French with the price in Euros
www.example.com/us/en/widget/price would be in English with the price in US dollars
www.example.com/gb/en/widget/price would be in English with the price in pounds etc
(the site will definitely be used in the Swiss market so example.com/ch/de, example.com/ch/it and example.com/ch/fr are all possibilities).
[There would be other things than price that would change: content, menus, pages etc, just as an example]
From how some other sites (not Drupal sites, just other sites) it they have a domain/country/language/page pattern. I'm not wedded to that, and it could be domain/[country-code]-[language-code]/page so example.com/ca/widget/price and example.com/ca-fr/widget/price if that's one way of doing it.
So I guess when you go to a URL, it serves up the language based on the language code, but also knows what country it is to show country specific blocks etc.
One other thing is URL wise, for SEO reasons (and for shorthand for adverts) we'll be parking all the TLDs on the one installation, so we could just use example.ch/de/ and example.ch/it if that helps/makes things easier. I guess then we'd use the domain itself to set the country?
Although user facing content has to be translated, it's not so important for admin stuff. (a bonus, but all admin users speak English to at least a certain degree).
I guess my question is: what combination of multisite, internationalisation and domain access would be best?
Comments
limit sub-folders...
I'll have to give this some thought, but my first reaction is definitely not to have /fr/fr or /ca/fr and such. I find this really confusing and would much rather use sub-domains instead, like ch.example.com/fr, ch.example.com/de, etc.
I still have to play around with domain access, but it sounds like a good start, along with the "domain theme" sub-module.
Quite an interesting question - I'll follow this discussion..
Mathieu
I have a similar situation
I have a similar situation and am using location based subdomains, where domains are set up with Domain Access. I've committed a new module to cvs named domain_locale that allows me to define different language sets per domain (by default you'd have all default domain languages on allsubdomains)
This sounds great. So your
This sounds great. So your setup is:
If you don't mind a load of questions...
How does it work for monolanguage countries? Do you require fr.example.com/fr/news or just fr.example.com/news/? How do you handle country and language switching? One switch for the country and another for the lanaguage once you're in that country, or all in the same place?
Do you use the internationalization module or just content translation?
I guess for practical reasons there's no difference between ca.example.com and example.ca is there? We're going to be keen on SEO and (allegedly) Google much prefers the latter.
I've found it to be easiest
I've found it to be easiest for all languages to use a prefix including default language. So even for monolanguage country the url would be fr.example.com/fr/news.
There's one switch for country and one for language. I guess one could write a combined switch but I don't have a use case for it atm so it's not part of domain_locale.
I use both i18n and content translation since there are various aspects of the site that need to be translated such as blocks, terms, variables. I'm also using domain_i18n to get multilingual variables per domain.
You are right, there is no difference between ca.example.com and example.ca as Domain Access can handle both.
More questions, sorry...
How do you get a prefix for the default language (in my case, English)? I've edited English to have "en" as the code, but going to uk.example.com/en/page just redirects me to uk.example.com/page. The only solution I can think of is using pathauto to prefix English-language pages with en which seems sub-optimal for some reason.
Also: I have language negotiation set to Path Only. Everything works fine but if I go to fr.example.com (and the custom homepage) as this doesn't have /fr/ in the path, it doesn't set the language as French which means that my URL aliases don't work, whereas they do if I go to fr.example.com/fr/ also serves up my homepage and sets the language, allowing URL aliases.
Would this be fixed by installing Domain Locale and setting the default language on a domain-by-domain basis?
As a side case, if someone goes to ch.example.com/fr/page and then goes to ch.example.com - it would be nice to get that treated (silently) as ch.example.com/fr/, even if the defau
lt language is set to, say, German. I don't know whether anybody has any ideas on that? Setting a cookie with their last language choice and then reading that in at some stage would seem one solution
Oh, and thanks so much for your help by the way. Genuinely appreciated.
I18N?
Is there just no way to do this with the I18N and Multi-currency modules? I just installed both (for the same goals) and I was hoping to make this work... But if you already know it won't, I'd like to know this now before I waste my memorial weekend on it.
Thanks
TJ
Drupal 8 set up country sites using path prefix
You can create country sites in same domain using country_path module and domain access module. please see my article to see how to achieve this. you can create create country sites and country language sites like this.
domain.com/ca/en
domain.com/au/en
domain.com/au
Also if you want to create view blocks and pages specific to country pages, create a taxonomy of country , and filter view blocks based on taxonomy id. you can maintain country code and language code in a cookie so that you can use these cookie in order to filter across the website.