Checks whether your PO-files are fully translated.
If there are keys without translations, exits with non-zero code and prints such keys into stderr.
/usr/share/pyshared/po_file_checker/check.py /usr/python/project/locale/ru/LC_MESSAGES/django.po || echo 'Failed'
myproject:Key
# coding: utf-8
import po_file_checker
missing = po_file_checker.check(
'/usr/python/project/locale/ru/LC_MESSAGES/django.po',
skip_keys=['key to skip']
)
if len(missing) > 0:
print u'Error: Некоторые переводы в проекте отсутствуют'
It does not depend on django, but you are free to use it as a management command. Add into your INSTALLED_APPS.
django-admin.py makemessages --no-obsolete ... # This is a must before the checks - you should have a non-obsolete translations in your po-files.
./manage.py check_po_files -v0 -s 'key to skip' -s 'another key to skip'
test it: nosetests --where=./src/