[Zope] Re: Specifying the target language with i18n

Josef Meile jmeile at hotmail.com
Fri Nov 24 07:31:49 EST 2006


>> Example:
>>
>> <p i18n:translate="" i18n:target="string:en">
>>     label_search
>> </p>
>>
>> It doesn't work. I cannot specify the target language.
>>
>> I am in Zope 2.9.4.
> Just a guess: Don't you need to specify a domain as well?
Ok, I tested it as well and it didn't work either. I just found it is a
bug and here is a patch:
http://www.zope.org/Collectors/Zope/1114

However be careful when using patches, specially when working with
unicode data. You have to make sure they don't concatenate normal
strings and unicode: This is really difficult to debug.

I think that the "i18n:target" directive is only useful you want to show
a text in a zpt which must be always rendered in the same language (ie:
some governmental entities shows first an English version of a official
document, then immediately above there is a version let's say in
spanish). But if what you want is to change the language in the whole
zpt, then implementing your IUserPreferredLanguages would do the trick.

Regards
Josef


More information about the Zope mailing list