#31048: Proposal to add `--dry-run` flag to `makemessages` command
-------------------------------------+-------------------------------------
Reporter: Sobolev Nikita | Owner: nobody
Type: New feature | Status: new
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Sobolev Nikita:
Old 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!
New 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.
On the other hand, it could be quite difficult to implement. Because,
there are a lot of machinery and corner-cases involved.
And as I understand there's no incremental mode or `--dry-run` in
`gettext` world.
Original idea from `wemake-django-template`: https://github.com/wemake-
services/wemake-django-template/issues/995
Looking forward to hearing your feedback, thanks!
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31048#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.db402e17420a3651d72a15329b0090cb%40djangoproject.com.