Created
August 10, 2011 21:31
-
-
Save dorey/1138338 to your computer and use it in GitHub Desktop.
uses python-gettext to compile the binary of translation files instead of the shell "msgfmt" script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# after pip installing python-gettext | |
# these lines go in django.core.management.commands.compilemessages | |
# they replace the call to "os.system" | |
from pythongettext import msgfmt | |
po = msgfmt.Msgfmt(pf + '.po') | |
moo_file = pf + '.mo' | |
with open(moo_file, 'w') as f: | |
f.write(po.get()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment