Apologies if this is a misconfiguration problem. It appears as though the front page is not configurable when using a specific page. Let's say I have a node/1 and a node/2 where node 2 is a translation of node 1. If I set node 1 to be the frontpage, I can access it through domain.com/en. I would expect that domain.com/ja would direct me to node 2, but it doesn't.
The problem is because node 2 is dependant on a different locale. Accessing domain.com/ja for example will try to load node/1 (page not found) for the 'default' frontpage setting, and ja/node/1 (also page not found) for the 'language dependant' frontpage setting.
I attempted to a make the site_frontpage variable language dependant in the settings.php and was surprised to find that after setting the primary locale frontpage to node/1 and secondary locale frontpage to node/2, and enabling the 'language dependant' frontpage setting, there was still no difference. I would have expected en/node/1 and ja/node/2, but instead wound up w/ ja/node/1.
Based on the code it appears as though the problem lies in the fact that the variable_get function can only pull 1 variable site_frontpage and both en_site_frontpage and ja_site_frontpage are ignored. The reason? The i18n_variable function is not yet defined. i18n_init defines the frontpage through the i18n_frontpage call, however the i18n.inc file (where the i18n_variable function resides) is not included.
Comments
Comment #1
dtan commentedI was able to get it working. I won't create a patch for this, because it is quite a hack job. Perhaps Jose has better insight into this as well.
1. Enable the site_frontpage in the settings.php $i18n_variables array.
2. Change the i18n_init function to call the i18n_frontpage function after the i18n.inc has been included. Mine became something like
3. Configure your seperate front pages
Comment #2
arsart commentedIt`s that what i was trying to implement!! Thanx a lot!
Works great! And must be set into i18n.module as soon as it possible.
Comment #3
jose reyero commentedI think this can be achieved with the right configuration, without changing the php code. Actually, that's what the option "Front page" in i18n settings is about.
1. In administer > settings > i18n, set "Front page" to "Language dependent"
2. In administer > settings, check the value of "Default front page". We'll assume "node" as it is the default
3. Create as many url aliases as different languages you have, pointing to the right front pages. I.e.
en/node --> node/1 (english front page)
es/node --> node/2 (spanish front page)
ja/node --> node/3 ....
4. Done, go to the site front page and switch languages
Does it work?
Comment #4
arsart commentedJose, this option, wich you`re talking about, changes standart front page - those who shows us all nodes promoted to frontpage.
But the hack above makes non-standart frontpages be translatable. Non-standart - means those who set up in admin/settings under "Default front page" option.
So, i think this hack must be added to new release of i18n.
Comment #5
jose reyero commented'node' is just an example and happens to be the default, but can be any page, whatever yo configure in Drupal as default front page........
Comment #6
dtan commentedThe url aliases you mention are created w/ the path module?
Comment #7
(not verified) commentedComment #8
(not verified) commentedComment #9
jose reyero commentedyes
Comment #10
jose reyero commentedOops, seems I changed the version
Comment #11
jose reyero commented