Nt3awnou-rescue-map / parse_xgettext.bash
nouamanetazi's picture
nouamanetazi HF staff
.
0f24534
raw
history blame contribute delete
752 Bytes
# To update locales files you can just run
# bash parse_xgettext.bash
# Find python files and phtml files and put them in a list
find . -type f \( -name '*.py' -or -name '*.phtml' \) -print > list
# Parse the list and generate a pot file
xgettext --files-from=list --language=Python -a -o ./messages.pot
# Update locales files
msgmerge --update --no-fuzzy-matching --backup=off ./locales/fr/LC_MESSAGES/messages.po ./messages.pot
msgmerge --update --no-fuzzy-matching --backup=off ./locales/ar/LC_MESSAGES/messages.po ./messages.pot
# Compile locales files
msgfmt -o ./locales/fr/LC_MESSAGES/messages.mo ./locales/fr/LC_MESSAGES/messages.po
msgfmt -o ./locales/ar/LC_MESSAGES/messages.mo ./locales/ar/LC_MESSAGES/messages.po
# Remove the list
rm list