override plone-de.po msgstr's in custom product

4 Messages Forum Options Options
Permalink
wchr
override plone-de.po msgstr's in custom product
Reply Threaded More
Print post
Permalink
hi,
i´ve got a custom plone product and want to change some - for example
german - translations in the plone domain. i don´t want to touch the
original file, only override some messages. so i created an "i18n"
directory in my product dir, copied the header of
/PloneTranslations/i18n/plone-de.po in a new file called
customproduct-de.po and put some msgids in, which also occur in
plone-de.po, but with different msgstr content. i suppose that worked
some day (?)... but it doesn´t work now.

i use Zope 2.9.6-final, CMFPlone 2.5.4-2, debian packages i think, i´ve
no access/control about that. i tried to browse the sources of
placelesstranslationservice, but i didn´t succeed, my questions:

- how does placelesstranslationservice decide the priorities? if a msgid
occures more than one time in the same domain/language, which one wins?
trough trial/error i found out that the first occurence of a msgid in a
single .po-file wins, but what if there is more than one i18n/*.po file
in another product - but within the same domain/language?

- what is the common way to override some/few (german,...whatever)
msgstr´s in the plone domain in a custom product?

thx in advance!
/wolfie


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-i18n mailing list
Plone-i18n@...
https://lists.sourceforge.net/lists/listinfo/plone-i18n
Maurits van Rees-3
Re: override plone-de.po msgstr's in custom product
Reply Threaded More
Print post
Permalink
wchr, on 2008-04-01:
> hi,
> i´ve got a custom plone product and want to change some - for example
> german - translations in the plone domain. i don´t want to touch the
> original file, only override some messages. so i created an "i18n"
> directory in my product dir, copied the header of
> /PloneTranslations/i18n/plone-de.po in a new file called
> customproduct-de.po and put some msgids in, which also occur in
> plone-de.po, but with different msgstr content. i suppose that worked
> some day (?)... but it doesn´t work now.

This can be used to add extra translations for the Plone domain, which
is needed for example for workflow states and transitions.

> i use Zope 2.9.6-final, CMFPlone 2.5.4-2, debian packages i think, i´ve
> no access/control about that. i tried to browse the sources of
> placelesstranslationservice, but i didn´t succeed, my questions:
>
> - how does placelesstranslationservice decide the priorities? if a msgid
> occures more than one time in the same domain/language, which one wins?
> trough trial/error i found out that the first occurence of a msgid in a
> single .po-file wins, but what if there is more than one i18n/*.po file
> in another product - but within the same domain/language?

There are no warnings or errors when you startup the zope instance?
Anything in the log file perhaps about a conflict error?

I have not tried, but it could be that this is decided based on which
product comes first (or maybe last) in the alphabet.  So either a
product AAAExtraTranslations or ZZZExtraTranslations would probably
work.

> - what is the common way to override some/few (german,...whatever)
> msgstr´s in the plone domain in a custom product?

I think the only good way is to put a .po file in the main i18n
directory of your zope instance.  That should take precedence over any
other po files that are found.  IIRC at Zest Software we used this
trick for a client to change the default translation of 'Manager'.

--
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-i18n mailing list
Plone-i18n@...
https://lists.sourceforge.net/lists/listinfo/plone-i18n
wchr
Re: override plone-de.po msgstr's in custom product
Reply Threaded More
Print post
Permalink
Maurits van Rees wrote:
> wchr, on 2008-04-01:
>> - how does placelesstranslationservice decide the priorities? if a msgid
>> occures more than one time in the same domain/language, which one wins?
>> trough trial/error i found out that the first occurence of a msgid in a
>> single .po-file wins, but what if there is more than one i18n/*.po file
>> in another product - but within the same domain/language?
>
> There are no warnings or errors when you startup the zope instance?
> Anything in the log file perhaps about a conflict error?

no warnings/errors, at least at log level info.

> I have not tried, but it could be that this is decided based on which
> product comes first (or maybe last) in the alphabet.  So either a
> product AAAExtraTranslations or ZZZExtraTranslations would probably
> work.

yeah, i think it works like that. if i use a product name coming
alphabetically before "PloneTranslations" i can override messages
already appearing in PloneTranslations/i18n/*, ha.

thx!
/wolfie


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-i18n mailing list
Plone-i18n@...
https://lists.sourceforge.net/lists/listinfo/plone-i18n
Hanno Schlichting-2
Re: override plone-de.po msgstr's in custom product
Reply Threaded More
Print post
Permalink
Hi.

wchr wrote:
> Maurits van Rees wrote:
>> wchr, on 2008-04-01:
>>> - how does placelesstranslationservice decide the priorities? if a msgid
>>> occures more than one time in the same domain/language, which one wins?

It doesn't support any kind of preference, except the i18n folder placed
directly into the $INSTANCE_HOME. All messages defined in those folders
will win over any other message catalog.

>> I have not tried, but it could be that this is decided based on which
>> product comes first (or maybe last) in the alphabet.  So either a
>> product AAAExtraTranslations or ZZZExtraTranslations would probably
>> work.
>
> yeah, i think it works like that. if i use a product name coming
> alphabetically before "PloneTranslations" i can override messages
> already appearing in PloneTranslations/i18n/*, ha.

This might work on your system, but it could break on any other system.
There is no guarantee made about the order in which the catalogs are
loaded. It might depend on the order in which the products appear on the
file system, which can be different on various platforms and
installation. The only safe and supported option is to use the i18n
folder in the instance home.

Hanno


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Plone-i18n mailing list
Plone-i18n@...
https://lists.sourceforge.net/lists/listinfo/plone-i18n