Forums / Setup & design / Newbie Question: Translating Templates?

Newbie Question: Translating Templates?

Author Message

Philipp Melab

Monday 01 March 2004 2:00:19 am

I need to build a multilingual site. Content Translation works fine, but how to translate text (button labels etc...) which is hardcoded in the template? Do I have to create a design for each language or is there an other possibility?

mfg Philipp

Balazs Halasy

Monday 01 March 2004 2:05:30 am

Hi,

This is possible by making use of the i18n template operator.
Check out http://ez.no/ez_publish/documentation/reference/template_operators/formatting/i18n for more info. Also, search for "i18n" and "internationalization" within the docs/forum. I'm sure you'll find the information that you need in order to make your templates support multiple languages.

Balazs

Philipp Melab

Monday 01 March 2004 6:35:58 am

I found information, but I dont know if I understood it. My Site has ger-DE as primary language and hun-HU as secondary. In the share/translations/hun-HU/translation.ts file are all the translations from english to hungarian. Where do i have to add my own words to be translated? A german-hungarian translation in the hun-HU/translation.ts, or english-german in ger-DE/translation.ts and english-hungarian in hun-HU/translation.ts... ? And what do I have to write in the template? Something like {"send"|i18n(..?..)} after adding the translations of "send" to the .ts-files?

mfg Philipp

Jan Borsodi

Thursday 04 March 2004 4:43:51 am

You need write the strings in english in the templates, then translate them into german and hungarian.
The syntax of i18n is i18n(context, comment, replacementlist). Normally you only need context which defines a common place for multiple translations, the name of the context is entirely up to you.

e.g.

{"Send"|i18n( "my/layout" )}

You must then use the ezlupdate program to create the translation files, say you have the templates in <i>mydesign</i> in an extension called <i>myextension</i>.

ezlupdate -e myextension

You can add the <i>-v</i> to see which files are processed.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq