Internationalizing a Python 2.6 application via Babel

Posted by Malcolm on Stack Overflow See other posts from Stack Overflow or by Malcolm
Published on 2010-05-25T08:55:48Z Indexed on 2010/05/25 9:01 UTC
Read the original article Hit count: 264

Filed under:
|
|
|
|

We're evaluating Babel 0.9.5 [1] under Windows for use with Python 2.6 and have the following questions that we we've been unable to answer through reading the documentation or googling.

1) I would like to use an _ like abbreviation for ungettext. Is there a concencus on whether one should use n_ or N_ for this?

n_ does not appear to work. Babel does not extract text.

N_ appears to partially work. Babel extracts text like it does for gettext, but does not format for ngettext (missing plural argument and msgstr[ n ].)

2) Is there a way to set the initial msgstr fields like the following when creating a POT file?

I suspect there may be a way to do this via Babel cfg files, but I've been unable to find documentation on the Babel cfg file format.

"Project-Id-Version: PROJECT VERSION\n" "Language-Team: en_US \n"

3) Is there a way to preserve 'obsolete' msgid/msgstr's in our PO files? When I use the Babel update command, newly created obsolete strings are marked with #~ prefixes, but existing obsolete message strings get deleted.

Thanks, Malcolm

[1] http://babel.edgewall.org/

© Stack Overflow or respective owner

Related posts about python

Related posts about i18n