[Django] #26319: British English can't be returned from the javascript_catalog

7 views
Skip to first unread message

Django

unread,
Mar 3, 2016, 5:51:48 PM3/3/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------+--------------------
Reporter: doug-fish | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/26319>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 3, 2016, 6:52:21 PM3/3/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* 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>

Django

unread,
Mar 3, 2016, 7:19:12 PM3/3/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 4, 2016, 7:22:13 AM3/4/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 4, 2016, 5:45:13 PM3/4/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 4, 2016, 6:04:48 PM3/4/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 4, 2016, 6:15:06 PM3/4/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by charettes):

Tim meant #26328.

--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:6>

Django

unread,
Mar 4, 2016, 6:47:07 PM3/4/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 7, 2016, 7:12:36 AM3/7/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
--------------------------------------+------------------------------------
Reporter: doug-fish | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:6>

Django

unread,
Mar 8, 2016, 9:00:57 AM3/8/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* 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>

Django

unread,
Mar 8, 2016, 3:41:22 PM3/8/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 8, 2016, 3:41:25 PM3/8/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody

Type: Bug | Status: new
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 8, 2016, 3:42:31 PM3/8/16
to django-...@googlegroups.com
#26319: British English can't be returned from the javascript_catalog
-------------------------------------+-------------------------------------
Reporter: doug-fish | Owner: nobody
Type: Bug | Status: closed
Component: | Version: 1.9
Internationalization |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => fixed


Comment:

Hopefully fixed now.

--
Ticket URL: <https://code.djangoproject.com/ticket/26319#comment:10>

Reply all
Reply to author
Forward
0 new messages