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.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* type: Uncategorized => Bug
* component: Uncategorized => Internationalization
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:1>
Comment (by doug-fish):
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?
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:2>
Comment (by timgraham):
Yes, if you can submit it as a unit test in
`view_tests/tests/test_i18n.py` even better.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:3>
Comment (by timgraham):
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:4>
Comment (by doug-fish):
Looks like you linked me to the same ticket! Is there another I should
look at?
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:5>
Comment (by charettes):
Tim meant #26328.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:6>
Comment (by doug-fish):
I tried out the fix from the linked discussion and that will solve the
issue!
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:5>
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:6>
* stage: Accepted => Ready for checkin
Comment:
A test for this ticket is added in a
[https://github.com/django/django/pull/6248 PR] from Claude.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:7>
Comment (by Claude Paroz <claude@…>):
In [changeset:"11c60b529816c5d29c3b4145055bf59b2e389de5" 11c60b5]:
{{{
#!CommitTicketReference repository=""
revision="11c60b529816c5d29c3b4145055bf59b2e389de5"
Reused the DjangoTranslation class for the javascript_catalog view
Thanks Tim Graham and Cristiano Coelho for the reviews.
Refs #26328, #26319.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:8>
Comment (by Claude Paroz <claude@…>):
In [changeset:"ecbdedfc6948d6c08c18ce935b02406139310e7f" ecbdedfc]:
{{{
#!CommitTicketReference repository=""
revision="ecbdedfc6948d6c08c18ce935b02406139310e7f"
Refs #26319 -- Added test for English variant in javascript_catalog
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
Hopefully fixed now.
--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:10>