Skip to content

Instantly share code, notes, and snippets.

View fle's full-sized avatar

Florent Lebreton fle

View GitHub Profile
@fle
fle / mock_po_file.py
Last active August 29, 2015 14:25
Automatically creates a new .po file with msgstr strings built from msgid strings prefixed by [`lang`]. Goal is ability to check easily where you forgot to add a gettext call.
"""
Based on a .po file `source`, creates a .po file `destination` with msgstr
strings built from msgid strings prefixed by [`lang`]
$ python3 utils/mock_po_file.py --lang FR --source en.po --destination fr.po
Example :
# en.po
msgid "Hello"