#33068: makemessages is useless when overriding default django translations
-------------------------------------+-------------------------------------
Reporter: satyanash | Owner: nobody
Type: Bug | Status: new
Component: | Version: 3.2
Internationalization |
Severity: Normal | Keywords: makemessages
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
By default, `makemessages` will remove/comment out translations from the
`BASE_DIR / "locale/<locale>/LC_MESSAGES/django.po` file if a `msgid` is
not used anywhere in the project.
This makes it very inconvenient to override the default django
translations. Here's a very simple example:
`django/conf/locale/mr/LC_MESSAGES/django.po` has:
{{{
#: utils/dates.py:6
msgid "Monday"
msgstr ""
}}}
I override this in `BASE_DIR / "locale/mr/LC_MESSAGES/django.po"` with:
{{{
msgid "Monday"
msgstr "सोमवार"
}}}
And this works fine; until someone else comes along and runs `./manage.py
makemessages -l mr`, causing the above translation which is used, to be
commented out!
{{{
#~ msgid "Monday"
#~ msgstr "सोमवार"
}}}
I feel that `makemessages` should not delete/comment translations that are
overriding default django translations, otherwise the utility of that
command is severely reduced.
A current workaround is to explicitly copy over all strings that are
overriden into a file in the project so that gettext can pick them up, but
it creates unnecessary boilerplate.
A possible solution could be to change the `makemessages` command to also
scan the `django` source code, in addition to the app's source, although I
am not sure of the complications here.
In addition, the documentation could also be improved by adding a
recommended way of overriding the default translations that ship with
django, that works well with the `makemessages` command.
--
Ticket URL: <https://code.djangoproject.com/ticket/33068>
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/052.72e2f2019e675f85b9657e20712b1e4b%40djangoproject.com.