On Tue, Oct 20, 2015 at 12:50 PM, Dietrich Streifert <
dietrich.streif...@googlemail.com> wrote:

> Thank you Thomas,
>
> this way it would be able to use the po files created by generate.py
> translation. Never thought about using this.tr in the map itself. Thank
> your for the hint!
>
> But shouldn't calling
> qx.locale.Manager.getInstance().addTranslation(locale, map) at some point
> after initialization override existing translations?
>

Yes, maybe this would be doing too much. You might end up overriding an
existing translation with itself :-). So this would make calling
.addTranslation() unnecessary, you could just provide a list of "tr()"
calls somewhere enumerating the translation keys from the lib you want to
override and include in the app's .po files.

The other question is, if your main app provides a translation for "item"
and the library does as well, which wins? As there is a single translation
map for any locale at run time, only one translation can make it into it
(NB: In the long run it might be interesting to name-space the translation
keys, so that each library can have their own translation of "item",
without disturbing each other).

My guess is the later the lib appears in the "libraries" array of the
generator, the more likely its translation will "win". This might suggest
you create yet another library just for a single class that has the keys
you wish to override, and their translations, and place it at the far end
of your "libraries" array. (If earlier libs win you are fine as the app
itself always should come first in the array.)

I'm mostly guessing here so I'm afraid you have to experiment to find it
out :-).

T.
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to