Opened 9 years ago

Closed 9 years ago

#26319 closed Bug (fixed)

British English can't be returned from the javascript_catalog

Reported by: Doug Fish Owned by: nobody
Component: Internationalization Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We have translations for British English (Australian English too!) and they aren't displayed in javascript based segments of our Django application.

Digging into the problem I believe the issue is in Django. Specifically this line:
https://github.com/django/django/blob/master/django/views/i18n.py#L212

Ultimately makes every English variant fall back to plain "en" at
https://github.com/django/django/blob/master/django/views/i18n.py#L248

I suggest the fix is to check for equality over starts with at line 212.

Change History (10)

comment:1 by Tim Graham, 9 years ago

Component: UncategorizedInternationalization
Type: UncategorizedBug

Do you plan to submit a tested patch? It doesn't seem that reproducing the issue will be very easy for me given the sparse details you provided so far and my lack of translation expertise.

comment:2 by Doug Fish, 9 years ago

I don't currently plan to submit such a patch. I lack the corporate approval to contribute to Django.

I shared my idea with one of my co-contributors from the OpenStack Horizon project, he tried it out and it apparently doesn't pass tests.

I'll try to sort out if I can create a small sample that will fail. Would that be helpful?

comment:3 by Tim Graham, 9 years ago

Yes, if you can submit it as a unit test in view_tests/tests/test_i18n.py even better.

comment:4 by Tim Graham, 9 years ago

A related ticket is #26319 -- can you say if the changes proposed there might solve your issue? (There should be a pull request soon). Maybe you can dialog with that ticket author a bit.

Version 0, edited 9 years ago by Tim Graham (next)

comment:5 by Doug Fish, 9 years ago

I tried out the fix from the linked discussion and that will solve the issue!

comment:6 by Tim Graham, 9 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:7 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

A test for this ticket is added in a PR from Claude.

comment:8 by Claude Paroz <claude@…>, 9 years ago

In 11c60b5:

Reused the DjangoTranslation class for the javascript_catalog view

Thanks Tim Graham and Cristiano Coelho for the reviews.
Refs #26328, #26319.

comment:9 by Claude Paroz <claude@…>, 9 years ago

In ecbdedfc:

Refs #26319 -- Added test for English variant in javascript_catalog

comment:10 by Claude Paroz, 9 years ago

Resolution: fixed
Status: newclosed

Hopefully fixed now.

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