Opened 5 years ago

Last modified 5 years ago

#31048 closed New feature

Proposal to add `--dry-run` flag to `makemessages` command — at Initial Version

Reported by: Sobolev Nikita Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Sometimes I face a little, but really annoying problem with django: quite often developers forget to add or modify translations after some code changes are made. As the result some strings end up untranslated for final users.

And it is really hard (or even impossible) to test or automate on user's end.
Current solution is to watch for this kind of things during code reviews (error-prone) and E2E manual tests (too expensive).

To solve this problem we can add --dry-run option to makemessages command to fail the build if some untranslated strings or even whole locales are found.

That's exactly how other commands behave:

  • makemigrations --dry-run fails the build when any new migrations would be created
  • collectstatic --dry-run ensures that everything works for the static files

But for some reason the same behaviour for makemessages is not available.
Nor I was able to find any existing 3rd party solutions.

My attempt to add custom checkmessages command was unsuccessful due to very complicated code structure and multiple required mocks of the original command.

Original idea from wemake-django-template: https://github.com/wemake-services/wemake-django-template/issues/995

Looking forward to hearing your feedback, thanks!

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top