Opened 10 years ago

Closed 8 years ago

#22822 closed Bug (fixed)

Javascript en_* translations ignored if no en or en_us translations exist

Reported by: pforth@… Owned by: anonymous
Component: Internationalization Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

If there is no djangojs.mo in either the en, en_US, en_US.ISO8859-1 or en.ISO8859-1 directories, then the django.mo translation files in any other en based translation directory (such as en_gb or en_ca) will be ignored.

This is because of the lines:

       if en_selected and en_catalog_missing:
            t = {}
        else: #.... actually go on and build up the dictionary for the catalog.

Without an en or en_us translation, en_catalog_missing will be true and for something like en_gb, en_selected will also be true. This means that en_gb will never be loaded.

This error can happen often since much of the time you won't bother creating an en or en_us translation file since that is the main language you are building in.

Change History (8)

comment:1 by pforth@…, 10 years ago

Owner: changed from nobody to anonymous
Status: newassigned

comment:2 by Tushar Bhatia, 10 years ago

Component: UncategorizedTranslations
Type: UncategorizedBug

comment:3 by Tim Graham, 10 years ago

Description: modified (diff)

comment:4 by Tim Graham, 9 years ago

Component: TranslationsInternationalization
Triage Stage: UnreviewedAccepted

I haven't used javascript_catalog before, but this does seems like a funny restriction. If it cannot be fixed for some reason, we should at least document it.

comment:5 by Tim Graham, 8 years ago

Has patch: set
Needs tests: set

PR (currently lacks tests)

comment:6 by Tim Graham, 8 years ago

Needs tests: unset

comment:7 by Tim Graham, 8 years ago

Patch needs improvement: set

Tests aren't passing.

comment:8 by Claude Paroz, 8 years ago

Resolution: fixed
Status: assignedclosed

I suspect and hope [11c60b529816] will have fixed this also.

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