#23328: get_javascript_catalog bug
-------------------------------------+-------------------------------------
Reporter: liminspace | Owner: nobody
Type: Bug | 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
-------------------------------------+-------------------------------------
Old description:
> There is a project with two languages: "en" and "uk" (ukrainian).
> Default language is "uk".
>
> There are pharases:
> locale/
> en/
> djangojs.po
> msgid "Всім привіт!"
> msgstr "Hello everyone!"
> uk/
> djangojs.po
> msgid "Всім привіт!"
> msgstr ""
>
> In this case, the activated language "uk" phrase "Всім привіт!" will be
> in "en" -- "Hello everyone!".
> It's a bug, because must be "uk".
>
> I propose remove loading "en" translation as default (is better).
> Or change update method for other default language:
> {{{
> if default_locale != 'en':
> for path in paths:
> try:
> catalog = gettext_module.translation(domain, path,
> [default_locale])
> except IOError:
> catalog = None
> if catalog is not None:
> # t.update(catalog._catalog) # remove it
> t = catalog._catalog # <- add it
> }}}
New description:
There is a project with two languages: "en" and "uk" (ukrainian).
Default language is "uk".
There are pharases:
{{{
locale/
en/
djangojs.po
msgid "Всім привіт!"
msgstr "Hello everyone!"
uk/
djangojs.po
msgid "Всім привіт!"
msgstr ""
}}}
In this case, the activated language "uk" phrase "Всім привіт!" will be in
"en" -- "Hello everyone!".
It's a bug, because must be "uk".
I propose remove loading "en" translation as default (is better).
Or change update method for other default language:
{{{
if default_locale != 'en':
for path in paths:
try:
catalog = gettext_module.translation(domain, path,
[default_locale])
except IOError:
catalog = None
if catalog is not None:
# t.update(catalog._catalog) # remove it
t = catalog._catalog # <- add it
}}}
--
Comment (by timgraham):
Could you give simple steps to reproduce the issue (or attach a sample
project)? I'm not an expert on translation or javascript_catalog, but my
understanding is that we use `t.update(catalog._catalog)` in the code you
mentioned so that any strings that don't have translations to the current
locale will fallback to English.
--
Ticket URL: <https://code.djangoproject.com/ticket/23328#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.afe4cea1a1ded1b5e7a42665e924c223%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.