Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION Internationalization (I18N)
#3
(2014-07-14, 06:43:58)Rene Wrote: Allmost 30 views later and no reaction, my question was either stupid or unclear. One more try ...

I use three languages ​​(en, de, nl), in the website navigation I use a dropdown language with flag of active language (var $language).

If I set the language on start or parent page it works but if I set this from a childpage it works half, the menu is in right language but my dropdown language goes back to the default language. In other words it seems like var $language is no longer initiated.

Anybody a clue?

$language is the language of the currently selected page. So if you have switched to german with "?setlang=de", but the current page has no german version, $language will be "en".

You could use the following code (accessing "internal" functionality) to get the currently "preferred" language:
Code:
$mylanguages = I18nFrontend::getLanguages();
$mylanguage = $mylanguages[0];
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Internationalization (I18N) - by Rene - 2014-07-11, 22:00:07
RE: Internationalization (I18N) - by Rene - 2014-07-14, 06:43:58
RE: Internationalization (I18N) - by mvlcek - 2014-07-14, 07:55:00
RE: Internationalization (I18N) - by Rene - 2014-07-15, 03:52:53
RE: Internationalization (I18N) - by bonyway - 2014-08-12, 20:05:10



Users browsing this thread: 1 Guest(s)