[Django] #24739: 1.7 => 1.8 i18n behaviour change

11 views
Skip to first unread message

Django

unread,
May 3, 2015, 5:05:23 AM5/3/15
to django-...@googlegroups.com
#24739: 1.7 => 1.8 i18n behaviour change
--------------------------------------+--------------------
Reporter: drakkan | Owner: nobody
Type: Uncategorized | Status: new
Component: Internationalization | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
I updated from 1.7 to 1.8

in my templates and python code I have string in my native language
(italian),

so my po files look likes this:

1) locale en

msgid "original string in italian"
msgstr "english translated string"

2) locale it

msgid "original string in italian"
msgstr ""

now in settings I have:

LANGUAGE_CODE = 'en'

my browser is in italian so request.LANGUAGE_CODE is "it"

in django <1.8 the fallback translation is taken from the it po file, in
django 1.8+ en translation is used since my default LANGUAGE_CODE is "en",
if I set LANGUAGE_CODE to "it" the fallback string from it po file is
used

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

Django

unread,
May 4, 2015, 10:27:27 AM5/4/15
to django-...@googlegroups.com
#24739: Undocumented i18n behavior change in 1.8 (or a regression)
--------------------------------------+------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.8
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* severity: Normal => Release blocker
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


Comment:

Reproduced and bisected to a5f6cbce07b5f3ab48d931e3fd1883c757fb9b45.

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:1>

Django

unread,
May 4, 2015, 2:21:12 PM5/4/15
to django-...@googlegroups.com
#24739: Undocumented i18n behavior change in 1.8 (or a regression)
--------------------------------------+------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.8

Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by claudep):

Apart from the unexpected change, isn't the new behavior the most correct?

Maybe you might check that master keeps this behavior, as
[3cf1c02695481900] touched this part of the code. But at first sight, it
shouldn't affect the use case you described.

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:2>

Django

unread,
May 5, 2015, 8:43:09 AM5/5/15
to django-...@googlegroups.com
#24739: Undocumented i18n behavior change in 1.8 (or a regression)
--------------------------------------+------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.8

Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by drakkan):

New behaviour:

- if a string is not translated for a locale django use the translated
string (if any) from the default locale

Old behaviour:

- if a string is not translated for a locale django use the untranslated
string for the some locale

what is most correct is an opinion, I like the old behaviour since all
untraslated string should be the same,

your opinion could be that an untranslated string should show the value
for the default locale and not the untranslated one

however is easy enouth to use a tool like poedit to copy all the
translations from the original string, so if you like more the new
behaviour is just a matter to document it

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:3>

Django

unread,
May 17, 2015, 8:19:58 PM5/17/15
to django-...@googlegroups.com
#24739: Undocumented i18n behavior change in 1.8 (or a regression)
--------------------------------------+------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.8

Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by timgraham):

Claude, could you propose a patch (docs or otherwise) at your convenience?

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:4>

Django

unread,
May 18, 2015, 9:51:06 AM5/18/15
to django-...@googlegroups.com
#24739: Undocumented i18n behavior change in 1.8 (or a regression)
--------------------------------------+------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 1.8

Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

Comment (by claudep):

#24503 was partially related.

What about:
{{{
#!diff
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index fb0438a..c5f3e72 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -1159,6 +1159,10 @@ Miscellaneous
* :func:`django.utils.translation.get_language()` now returns ``None``
instead
of :setting:`LANGUAGE_CODE` when translations are temporarily
deactivated.

+* When a translation doesn't exist for a specific literal, the fallback
is now
+ taken from the :setting:`LANGUAGE_CODE` language (instead of the
untranslated
+ ``msgid`` message).
+
* The ``name`` field of
:class:`django.contrib.contenttypes.models.ContentType`
has been removed by a migration and replaced by a property. That means
it's
not possible to query or filter a ``ContentType`` by this field any
longer.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:5>

Django

unread,
May 18, 2015, 10:12:02 AM5/18/15
to django-...@googlegroups.com
#24739: Document translation fallback behavior change in 1.8
-------------------------------------+-------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.8
Internationalization |
Severity: Release blocker | 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):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

I'd suggest "instead of from the" -- otherwise, good!

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

Django

unread,
May 18, 2015, 12:40:54 PM5/18/15
to django-...@googlegroups.com
#24739: Document translation fallback behavior change in 1.8
-------------------------------------+-------------------------------------
Reporter: drakkan | Owner: nobody
Type: Bug | Status: closed
Component: | Version: 1.8
Internationalization |
Severity: Release blocker | 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 Claude Paroz <claude@…>):

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


Comment:

In [changeset:"1046c8afecf719eee5a2aaa28b001e731f94100b" 1046c8af]:
{{{
#!CommitTicketReference repository=""
revision="1046c8afecf719eee5a2aaa28b001e731f94100b"
Fixed #24739 -- Documented translation fallback change

Refs #24503.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:7>

Django

unread,
May 18, 2015, 12:41:49 PM5/18/15
to django-...@googlegroups.com
#24739: Document translation fallback behavior change in 1.8
-------------------------------------+-------------------------------------
Reporter: drakkan | Owner: nobody

Type: Bug | Status: closed
Component: | Version: 1.8
Internationalization |
Severity: Release blocker | 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
-------------------------------------+-------------------------------------

Comment (by Claude Paroz <claude@…>):

In [changeset:"7915cbb360afd363bf94b31aa42b32387c302dea" 7915cbb]:
{{{
#!CommitTicketReference repository=""
revision="7915cbb360afd363bf94b31aa42b32387c302dea"
[1.8.x] Fixed #24739 -- Documented translation fallback change

Refs #24503.
Backport of 1046c8afec from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24739#comment:8>

Reply all
Reply to author
Forward
0 new messages