#35691: Override translation
-------------------------------------+-------------------------------------
Reporter: Omid Shojaee | Type: Bug
Status: new | Component:
| Internationalization
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Hello,
I've asked this in the Forum and SO and there was no solution which leads
me to believe that this is a bug.
Let's say I want to translate a phrase already translated. This is a
matter of personal preference so I don't want to go to Transifex.
First I find the existing translation:
{{{#!python
# .venv\Lib\site-packages\filebrowser\locale\fa\LC_MESSAGES\django.po
#: sites.py:348 templates/filebrowser/include/breadcrumbs.html:9
#: templates/filebrowser/include/breadcrumbs.html:11
msgid "FileBrowser"
msgstr "فایلبروز"
}}}
Then I create an app called `core`, a file called `translations.py` and
add this to it:
{{{#!python
from django.utils.translation import gettext
gettext('FileBrowser')
}}}
Now I make messages and find the phrase in the `.po` file and translate
it:
{{{#!shell
#: .\core\translations.py:3
msgid "FileBrowser"
msgstr "مدیریت فایل"
}}}
After compiling the messages, I still see the original translation and not
my own.
Perhaps the order of apps is important so I put my `core` app before
`filebrowser` in the settings but still get the same result.
Therefore, either overriding translations is not possible, or this is a
bug.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35691>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.