Opened 10 years ago

Closed 9 years ago

#23328 closed Bug (duplicate)

get_javascript_catalog bug

Reported by: None Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

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

Change History (3)

comment:1 by None, 10 years ago

Version: 1.7-rc-2master

comment:2 by Tim Graham, 9 years ago

Description: modified (diff)

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.

comment:3 by Tim Graham, 9 years ago

Resolution: duplicate
Status: newclosed

I think this is a duplicate of #16284 ("djangojs uses en as fallback language rather than projects language code").

Note: See TracTickets for help on using tickets.
Back to Top