Translation in module/template not working

Author Message

Heiko Irrgang

Thursday 13 January 2011 5:10:57 am

Hi,

i have a module which should output translated messages. The site is set up to have two languages and it works for content pages, but in the module i cannot get the translation working, it always puts out the default string.

Here is my siteconfig site.ini.append from the translated language:

[SiteSettings]
SiteURL=localhost/eng
[RegionalSettings]
Locale=eng-GB
ContentObjectLocale=eng-GB
ShowUntranslatedObjects=disabled
SiteLanguageList[]
SiteLanguageList[]=eng-GB
SiteLanguageList[]=ger-DE
TextTranslation=enabled

I used ezlupdate to generate the xml file which is placed in /extendsions/modulename/translations/eng-GB and translated to the english language.

In the templates i work with:

{"Germantext"|i18n('some/category')}

but if i switch to the english language, still the german texts are displayed.

cache is cleared, autoload rebuilt

Do i have to tell ezpublish somehow which modules are translated in which language, so it reads the language files?

Heiko Irrgang

Thursday 13 January 2011 6:04:36 am

ok, found it, was a combination of two things:

TranslationExtensions[]=module

in site.ini.append

and... OMG from the docs:

TextTranslation=enabled

This setting is automatically set to disabled if your Locale is set to "eng-GB"

Gaetano Giunta

Thursday 13 January 2011 10:12:15 am

Please note that even if you set TextTranslation=enabled, afaik the eng-GB templates will not be translated; This means you are

- forced to write templates in english

- forced to use some other english variation (eg. US) if you want to have translation active for english

Principal Consultant International Business
Member of the Community Project Board

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