Forums / Developer / template operator i18n

template operator i18n

Author Message

justin kazadi

Wednesday 07 May 2008 5:21:55 am

hello ,

I have two siteaccess eng(english ) and fre (french). the primary language is english.
i have write in one of my template this line :

{"Pour creer un compte, remplir le formulaire ci-dessous:"|i18n} .

but on english and frnch i have the same string.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Gaetano Giunta

Wednesday 07 May 2008 5:55:18 am

A - did you create your translation files with the two versions of the text? Translation does not happen magically on its own

B - there is an ini setting that allows/disallows the translation of the templates (which is different from translation of object content)

Principal Consultant International Business
Member of the Community Project Board

justin kazadi

Wednesday 07 May 2008 6:16:49 am

hi,
no i didn't create the translation files and i don't know what ini settings files to use. Please can 't you explain me what to do exactly.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Gaetano Giunta

Wednesday 07 May 2008 11:58:58 am

I think you can find some good explanations on setting up template translations in the existing forum posts.

A cursory search turned up eg. this one: http://ez.no/developer/forum/setup_design/define_words_and_use_them_in_different_languages/re_define_words_and_use_them_in_different_lang

The ini setting is TextTranslation, in the RegionalSettings section of site.ini. By default it is set to enabled

Principal Consultant International Business
Member of the Community Project Board

justin kazadi

Thursday 08 May 2008 4:22:12 am

hi,
first of all, i have created my extension call traductionkazadi. In extension/traduction/settings/site.ini i have add TranslationExtensions[]=traductionkazadi on [RegionalSettings] section and
[TemplateSettings]
ExtensionAutoloadPath[]=traductionkazadi.

secondly i have add ActiveExtensions[]=traductionkazadi on [ExtensionSettings] section of settings/override/site.ini to activate my extension.

after this i have create a file translation.ts in extension/traductionkazadi/translations/fre-FR.
this file contains:"

<!DOCTYPE TS><TS>
<context>
<name>traductionkazadi</name>
<message>
<source>Pour creer un compte, remplir le formulaire ci-dessous:</source>
<translation>To create your account, fill the fields of the form below:</translation>
</message>
</context>
</TS>
"
in my templates i have write this:"

{"Pour creer un compte, remplir le formulaire ci-dessous:"|i18n('traductionkazadi')}

but this text aren't translated.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein