wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

Fix timezone format at pot creation #38

Closed cedricmessiant closed 10 years ago

cedricmessiant commented 10 years ago

Remove colon because it breaks Babel when generating .po files

wichert commented 10 years ago

It's amazing how fragile Babel is. I'm curious why you are still using Babel to handle pot/po files; can you explain that to me? Perhaps there is something missing in lingua that I need to add.

cedricmessiant commented 10 years ago

I don't know ! What are the alternatives to Babel to generate .po files from pot files ?

wichert commented 10 years ago

All your need is lingua, as of lingua 2. Specifically all you need is the pot-create command it provides. The lingua documentation should explain everything you need.

cedricmessiant commented 10 years ago

I'm really sorry but I don't find an equivalent to this command in lingua documentation :

pybabel update -l fr -i messages.pot -D mydomain -o messages.po
wichert commented 10 years ago

There isn't one, by design. Updating and compiling PO files is handled by the standard msgmerge and msgfmt commands from standard gettext, and there is nothing to be gained by reimplementing those in Python. Since a reimplementation is only likely to introduce new bugs (and I have seen Babel corrupt PO files) I felt no need to go down that path.

The equivalent of your command is:

msgmerge messages.po messages.pot

and to compile that to a .mo file:

msgfmt messages.po
cedricmessiant commented 10 years ago

Okay, thanks a lot !