howto.txt tells:

How to get a different front page for each language
-----------------------------------------------------
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
....

But i dont have that setting. At settings > i18n theres only Browser detection, language icon and advance/content selection available. Does this mean its only for those who have the additional frontpage modul?
Why cant the site detect after choosing a language to which home url to go? it can find the en/forum en/node en/everything except the base path. Do I miss something? Or can I ask for such a feature? Cos this way if a user chooses a language other then the default and goes back to Home he needs to switch language again and again.

(I cant make browser detection work either though i have every regional and language setting to my language, it still cant detect it.)

Comments

asiafan’s picture

i tried to change my home url (in themes) from a variable to a simpla relative "/node" but this cant get the language prefix either :(

asiafan’s picture

I installed the front page modul but I still cant see such setting anywhere. Is this howto for a different version?!??

I need to have my Home links (also in breadcrumbs) to be language dependant so users dont have to choose language in every 5 minutes on the front page after returning from different parts of the site.

jose reyero’s picture

About that front-page setting I got rid of it, it is not needed anymore. You have two options:

A. The easy one:
1. Set 'site front page' to 'home' or whatever name you want
2. Create url alias for each language like:
en/home -> node/1
es/home -> node/2
............

B. The bit more complex and more powerful one
1. Add 'site_frontpage' to 'language dependent variables in your settings file'
See http://drupal.org/node/67824

2. Set the frontpage for each language in administer/settings, switching the interface to each language to set the value for each language.

asiafan’s picture

Maybe my previous posts were confusing, but I dont want to "make" lang-dependant "front pages" - I want to make the "only one" front page lang. dependant. For home links and breadcrumb home links.

I looked into the module and it seems that if the link is the base url then it switches the module off. What is needed that it could check the referer and only switch off the language choosing when ppl come from and external link and not from inside. The site and modules, forum, gallery etc are full of "home" links that now take ppl back to a home where they have to choose again.

Setting the front_page lang. dependant as in the second option sounds nice. 1st: theres a typo on the page you linked its cont instead of conf there. 2nd: I tried it but it doesnt work. Maybe I need to set something else. These Home links point to $base_path and things like that. I dunno if I can make that lang.dependant and then what happens.

asiafan’s picture

(also i set footer variable to lang. dependant but cant find where to set the other language - localization doesnt find it)

asiafan’s picture

footer - just found it, i have to set these things in the same place but in diff. language. And here I was able to set the different home pages too, setting it to node/en and node/hu..

now the only problem is left that it still doesnt work for breadcrumb home links

asiafan’s picture

noo it stopped working, and still takes me to the default-lang. home :((

asiafan’s picture

I tried aliases but they dont work either. When i set the system path "en/node" into "homeng" or whatever the log shows that "en/node not found". Same if I just set en/node as a front page. Are you sure it works? What am I doing wrong?

jags-1’s picture

I have tried the solution of José Antonio but the mission only appear in the frontpage without languages...

asiafan’s picture

I think my posts were not clear. This is a similar issue: http://drupal.org/node/65701
So basically what is needed, that all Home links, in breadcrumbs or under the site title-logo-banner whatever should take ppl back to a language dependant Home, e.g. from mysite/en/node/77 to mysite/en and from mysite/es/forum to mysite/es (instead of only "mysite" as it works now). I dont even understand why any other links work (by keeping the language tag in url) but these not.

asiafan’s picture

Title: Language dependent home page needed » Language dependent home links needed

I think I should've name the topic "language dependent home links needed" to make sense, sorry.

Bodo Maass’s picture

I had the same problem that the 'home' link in breadcrumbs would always switch back to the default browser language, regardless of the currently selected language.

My solution was to store the current language as a session variable, so that the home links would resolve to the last selected language. This works together with Jose's approach of not using the front page module and setting the site_front_page variable in settings.php instead.
Here is my modified version of _i18n_get_lang() in i18n.module:

function _i18n_get_lang() {
  global $user, $i18n_langpath;
  static $i18n_lang;
  // Check whether the language is already set.
  if ($i18n_lang) {
    return $i18n_lang;
  }
  // Language not set, find one
  $languages = i18n_supported_languages();
  if ($i18n_langpath && array_key_exists($i18n_langpath,$languages)) {
    $i18n_lang = $i18n_langpath;
  }
  elseif ($user->uid && $user->language && array_key_exists($user->language,$languages)) {
    $i18n_lang = $user->language;
  }
  elseif (isset($_SESSION['language'])) {
    $i18n_lang = $_SESSION['language'];
  }
  elseif (variable_get("i18n_browser",0) && $lang=i18n_get_browser_lang()) {
    $i18n_lang=$lang;
  }
  else {
    $i18n_lang=key($languages);
  }
  $_SESSION['language'] = $i18n_lang;
  return $i18n_lang;
}
asiafan’s picture

thanks bodomaass, could you please explain what do I have to do to make it work apart from changing the module? or is it enough?

I couldn't use Jose's alias method because I dont have two different home pages on node/x, y, I have only mysite/node and I tried to specity "en/node" as a system path but it doesnt exist, page not found. So I cannot put "en" in the "existing path" I can only use it in the alias path. So it wont switch my home page language.

jose reyero’s picture

Status: Active » Closed (won't fix)

This has been addressed in newer versions (5.x, 6.x) and Drupal 4.7 is not supported anymore. Please, consider upgrading