You’re probably here because you’ve the delightful task of creating a multilingual Drupal 7 installation.
Things have been going OK, you downloaded and installed i18n, switched some translation modules on and happily started inputting content and adding translations. You figured it was time to created some front pages, of course a separate one for each language, otherwise what’s the point. You figure it’s as easy as creating and translating other nodes, so you do that, set the default front page, take a look, switch the language and…. it doesn’t work!
Here is where I save the rest of the day from Googling
You’ve probably already come across mention of the default front page setting in admin > configuration > system > site information. I read plenty of things about this, basically saying here is where you can set multiple default front pages depending on languages. However, what seemed to be missing, at least for me was a proper explanation of how to get it working.
So, here we are, for Drupal 7:
- Make sure you have the modules Variable and Variable Translations switched on.
- Goto admin/config/regional/i18n/variable
- Select ‘Default front page’ from the list, save settings.
- Goto admin/config/system/site-information, you’ll notice a block of text there saying something about some of your settings being multilingual variables and a list of links for the languages you are running which allow you to set the settings for each language.
Now, this is where the real GOTCHA comes up… clicking those links and changing the settings does nothing. Your left with the same settings still for all languages. The way around this?
Check the URL you currently on, the entire thing, so something like: http://www.mysite.com/en/admin/config/site-information/
Notice the language prefix there before /admin? To change the settings for the other languages you want to use, switch the prefix in the URL and then make your changes. And now, as if by magic, multiple front pages, properly changing based on language.
I think, but haven’t checked, that this behaviour might be result of having the admin side in multiple languages. I didn’t see what I had mine set as, or if it were possible to force it to one language only. But my belief is, if you can drop the language prefix from the url the switching of languages on the settings page might have an effect.
I’ve also had similar problems using the node reference url widget on a content type. If the prefix in the URL doesn’t match that of the language of the content I’m editing, either the wrong nodes are listed as reference options or I can’t edit a previously chosen value.
So, beware of the language prefix in the URL when dealing with a multilanguage Drupal install. It might be something worth checking if you’re having problems.
Lastly, if you found this useful please spread the word or up vote this answer on Stack Overflow where I originally posted the answer, albeit much shorter than this!