msgcheck Django translations

59 views
Skip to first unread message

Johannes Hoppe

unread,
Feb 27, 2019, 10:08:28 AM2/27/19
to Django developers (Contributions to Django itself)
Hi,

I don't know if anyone is familiar with a little tool called msgcheck. It's a linter for gettext files and happens to be written in Python.
I've been using it for a couple projects now, to keep my translations in order and also contributed a couple features to it.

Anyhow, I did just run it on all of Django's translations files and OH BOY. There are plenty places where we have leading or trailing whitespaces or a missing trailing dots.

Summary:
TOTAL: 623 files OK, 438 files with 2995 errors

Without the trailing dot errors, it's a bit better:
TOTAL: 832 files OK, 229 files with 613 errors

What do you guys think, should we maybe introduce such a linter?

If you want to check it out yourself:

pip install msgcheck
msgcheck -c $(find . -name django.pd) | less


Best
-joe

Claude Paroz

unread,
Feb 27, 2019, 11:03:45 AM2/27/19
to Django developers (Contributions to Django itself)
Thanks Joe for this proposal. Unfortunately, I fear it does not play well with our current workflow, where we download files produced by Transifex.
Could you give us an example where an error revealed by this linter could improve the quality of the resulting translations?

Claude

Johannes Hoppe

unread,
Feb 27, 2019, 1:58:18 PM2/27/19
to django-d...@googlegroups.com
Hi Claude,

Very good point. I am not familiar with the translation process. I think we would benefit from the linter. It’s not so much a linter in the traditional sense, since it’s not linting any code. It rather finds small errors in translations files. Inconsistencies in punctuation, line count or leading or trailing whitespaces.
You can also use it to do spell checking.

I believe we would benefit from that, but looking though the errors it find, most of it is inconsistent punctuation and leading whitespaces. It kind of depends where the translation is used, it it’s used in HTML in most cases, you won’t even see trailing whitespaces. Still, in some cases you might, and those would be caught.

Bottom line, I think it depends. If we can integrate it well into the translation process, it could add benefit. If it makes the translation process more difficult, I believe it’s not worth it.

Best
-Joe
--
You received this message because you are subscribed to a topic in the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-developers/yn7R5P5rJQg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a31aa5b1-53f6-46bf-aed5-468bbbd2ff3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages