Closed akoutmos closed 3 years ago
I believe one of the reasons we haven't implemented this is because existing tools used by translators to translate gettext already include this functionality. Have you tried this route? Or am I misremembering?
You can do something like follows to get information on whether a PO file is missing any translations:
$ msgfmt --statistics priv/gettext/en/LC_MESSAGES/default.po
0 translated messages, 269 untranslated messages.
The check that I envision would be more about the creation of the POT file and would check to see if after adding new gettext "Some new text"
statements in the code base, that an up to date POT file has been generated. Perhaps this would be a flag on mix gettext.extract
? Something like mix gettext.extract --check-template-file
?
Oh, you want a check to see if someone forgot to call mix gettext.extract
? What about --check-unextracted
or --check-missing
or --check-pending
?
Oooo. I like --check-unextracted
. I'll put something together in the next few days and open up a PR :).
That's awesome and great idea @akoutmos! Let us know if we can help with guidance on anything 🙃
Will do! Thanks :)
Closing this issue given that the PR has been merged. Thanks for the assistance everyone and the speedy reviews!
Opening up this issue to gauge interest from the maintainers in a new mix task for gettext that will check to see if there are any missing translations. Something like
mix format --check-formatted
but for translations. This can be useful in CI to ensure that the PO files are up to date prior to deployment. I am currently doing this with adhoc shell scripts...but I think this would be a useful tool to have directly in gettext.If there is interest in this, I can put together an initial implementation :).
As always, thanks for all the effort everyone has put into gettext!! Really appreciate it!!