Improve the maintenance of messages and translations (i18n)
Maintaining our *.po files is a very difficult thing at the moment. I would like to discuss some ideas that might be helpful to make this business a littler bit easier.
-
Tox env: I think that tox -e makemessages
should be introduced for all apps to unify the way how *.po files are created. -
Detect possible changes: We should find a way to check whether there are changed messages in the source code and we have to run makemessages
. One possible option is, to runmakemessages
and check if there is a diff, but that won't work as expected because of changes like the following:
-"POT-Creation-Date: 2021-06-08 16:49+0200\n"
+"POT-Creation-Date: 2021-07-05 17:02+0200\n"
"PO-Revision-Date: 2021-06-12 10:28+0000\n"
"Last-Translator: Jonathan Weth <teckids@jonathanweth.de>\n"
-"Language-Team: German <https://translate.edugit.org/projects/aleksis/aleksis/"
-"de/>\n"
+"Language-Team: German <https://translate.edugit.org/projects/aleksis/aleksis/de/>\n"
Edit: There seems to be a working method: https://github.com/django-waffle/django-waffle/blob/master/run.sh#L32
Maybe we also can find (or write) a kind of bot (like Renovate) for updating these files automatically and then opening a merge request.
Edit: Or just include a job in the lint stage with the method used in django-waffle
to ensure that all files are up-to-date.
-
Detect untranslated changes: There is a very interesting discussion in the Jazzband project how to solve that (https://github.com/orgs/jazzband/teams/members/discussions/13). -
Auto update in weblate: Although I added webhooks for all repos some time ago, the automatic pull of new *.po files by Weblate doesn't work. -
Include in CI: These items should be included in our CI, but I am very unsure at which points. Maybe only for tagging?