Forums / Setup & design / switch language link

switch language link

Author Message

andre müller

Tuesday 19 August 2003 12:02:06 am

is there a nice way to detect, which language is currently set and to dynamically set a link to switch language?
thanks

Alexandre Cunha

Tuesday 19 August 2003 2:19:38 pm

way to detect ? what you mean ?

How to make a link on your front site do swith language ?

First, read this answer from Paulo Almeida how setup a multilingual site:
http://ez.no/developer/ez_publish_3/forum/setup_design/really_i_need_help_about_ulr_alias_language_

The, you can create links to switch between languages by this way:
- assuming you have settings\siteaccess\yoursite_eng\ and settings\siteaccess\yoursite_por\ for each language.
- create this links:
<a href="/index.php/yoursite_por/">Portugu&ecirc;s</a>
<a href="/index.php/yoursite_eng/">English</a>

axel

http://AlexandreCunha.com

andre müller

Thursday 11 September 2003 12:44:49 am

thank you very much, axel. I did exactly what you said and this works. i simply thought i could have one link only. if i'm on the english site there would appear a text saying switch to german and vice versa. for this to work, i would have to be able to find out in my template what language is currently set.

Gunnstein Lye

Thursday 11 September 2003 4:50:07 am

You can read the current language from the ini settings using the ezini operator.

{section show=eq(ezini('RegionalSettings','Locale'),'eng-GB')}
This is english
{/section}

It will automatically pick up ini overrides.
(To read variables from other ini files than site.ini, use the file name as a third parameter to the ezini call.)