Share » Forums » Setup & design » multilingual site: how to switch...

multilingual site: how to switch between languages with link

multilingual site: how to switch between languages with link

Wednesday 11 February 2004 1:27:20 am - 2 replies

Author Message

Lazaro Ferreira

Thursday 12 February 2004 4:52:38 pm

Hi,

We use the translation files ( .ts ) to do the trick :

{let myvar='our_siteaccess_name_translation'|i18n('our_site_name/menu') }
<a href={$myvar|ezroot} >'our_language_title_translation'|i18n('our_site_name/menu')</a>
{/let}

$myvar will be 'eng', and 'it' respectively,
the language title translations will be "English", Italian

so, we added two new translations to our .ts files one for the siteacces name, the second one for the language name itself

the first one is piped into ezroot operator to create the URL of the siteaccess to switch to

the trick is putting the 'wrong' translation in each .ts file

i.e : In the .ts file for english you should add the italian lines, one for the siteacces name (it) the other one for the language name itself (i.e: Italiano), and viceversa

Hope this help

Lazaro
http://www.mzbusiness.com

shajeer K P

Tuesday 06 April 2004 2:19:02 am

Hi,
Where to place the following codes,
{let myvar='our_siteaccess_name_translation'|i18n('our_site_name/menu') }
<a href={$myvar|ezroot} >'our_language_title_translation'|i18n('our_site_name/menu')</a>
{/let}

Also give an example for the above code.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu