#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.

-- 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701916a961f20-872bdd9c-0375-4bdf-b957-c7f0f9650787-000000%40eu-central-1.amazonses.com.

Reply via email to