To mark text translatable, you need to pass it through the intl_get() function:
<?php
echo intl_get ('Hello World');
?>
Similarly, you can call this function from a SimpleTemplate file via:
{intl Hello World}
And finally, you can call the same thing from an XT template via:
<xt:intl>Hello World</xt:intl>
Then, using the AppDoc TranslationBuilder, you can build an index of this text and translate it into additional languages.
Translation of such text occurs automatically in Sitellite via negotiation of language preferences with the visitor's web browser. So if your site is offered in English and Spanish, a visitor whose web browser is set to prefer Spanish over English will see the Spanish version of the web site automatically.
This can be modified to be cookie- or session-based instead, so that you can provide a language selection option on your web site. To do this, log into Sitellite and go to Control Panel > Admin > Site Settings then change the Internationalization > Negotiate value. There is a sitellite/intl/setLang box that will handle the switching of languages for you in Cookie-mode. Simply send your visitor to:
http://www.example.com/index/sitellite-intl-setLang-action?choice=language_code
A select-box form to do this would be:
<form method="GET" action="/index/sitellite-intl-setLang-action">
<select name="choice" onchange="this.form.submit ()">
<option value="en">English</option>
<option value="it">Italiano</option>
<option value="de">Deutsch</option>
</select>
</form>
Revised on April 29, 2008 3:22 AM by lux
Back in time (9 more) | Linked from: I18n