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 , 9 years ago
Component: | Uncategorized → Internationalization |
---|---|
Type: | Uncategorized → Bug |
comment:2 by , 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 , 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 , 9 years ago
A related ticket is #26328 -- 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.
comment:5 by , 9 years ago
I tried out the fix from the linked discussion and that will solve the issue!
comment:6 by , 9 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:7 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
A test for this ticket is added in a PR from Claude.
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.