Merge translations, msgcat or something?

114 views
Skip to first unread message

Sylvain Prat

unread,
Mar 21, 2012, 4:08:17 PM3/21/12
to Python Babel
Hello,

I am in the following situation: I have a localized application with
translations that uses an application framework which also have
translations. I'm wondering what is the best way to use both
translations in my application.
- Are we supposed to combine the translations with
support.Translations.merge before use?
- Are we supposed to merge either the .pot files or .po files and load
the combined file with support.Translations.load? In that case, can I
do this with Python Babel using one of the setuptools commands (it
seems not)? If not, can this feature be added to Python Babel?
(something like msgcat?)

Thanks,
Sylvain

Felix Schwarz

unread,
Mar 21, 2012, 4:45:16 PM3/21/12
to python...@googlegroups.com
Hey,

Am 21.03.2012 21:08, schrieb Sylvain Prat:
> I am in the following situation: I have a localized application with
> translations that uses an application framework which also have
> translations. I'm wondering what is the best way to use both
> translations in my application.

That's what gettext 'domains' are for. Each component (framework, libraries)
should use it's own domain and gettext will choose the right mo file at
runtime. That way you can manage all translations in the context of their
component and they will not interfer with each other.

A real world example I'm working on is MediaCore which uses formencode.
formencode has it's own validation messages + translations. By using different
"domains" that's actually not a problem.

fs

Reply all
Reply to author
Forward
0 new messages