multilingual site: how to switch between languages with link

Author Message

Alessandro Cipriani

Wednesday 11 February 2004 1:27:20 am

hi all
i'm setting my own multilingual site
i've read the tutorial "how to setup a multilingual site"
(http://ez.no/ez_publish/documentation/configuration/configuration/language_and_charset/how_to_setup_a_multilingual_site) and now i got the following result:
when i write http://mysite.com/it I enter the italian version - writing http://mysite.com/eng I enter the english version...

now i need to be able to switch from one language to other simply by clicking on a link, and getting the same page in the other language. I found an example at http://www.fast.no/ , where the user can change "dinamically" the language he prefers.

any advice?
best regards

alessandro

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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.