scripts/i18n: add command 'normalize-po-files'...
scripts/i18n: add command 'normalize-po-files'
The translation files in the Kallithea repository contained references to
the location(s) of each string in the repository. This is useful to
translators, but is not needed for all other users.
The big problem with that information is that it changes very commonly as a
result of normal development in Kallithea, causing a lot of unimportant
delta in the Kallithea repository, thus causing unnecessary repository
growth.
In this commit, a basic version of the script is added, only containing the
code to normalize the translation files by removing generated and outdated
data.
This can be used to check or ensure internal consistency between code and
translations, by extracting and merging and then removing most of it again with
normalize-po-files:
./setup.py extract_messages
for po in kallithea/i18n/*/LC_MESSAGES/kallithea.po; do msgmerge --width=76 --backup=none --previous --update $po kallithea/i18n/kallithea.pot ; done
scripts/i18n normalize-po-files kallithea/i18n/kallithea.pot kallithea/i18n/*/LC_MESSAGES/kallithea.po
Includes contributions from Mads Kiilerich.