#29144: `DjangoTranslation.merge` loses catalog fallbacks
-------------------------------------+-------------------------------------
Reporter: Patryk | Owner: Patryk Zawadzki
Zawadzki |
Type: Bug | Status: assigned
Component: | Version: 2.0
Internationalization |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
`gettext` will properly resolve fallbacks for locales. For example asking
for `de-de` will result in the following chain of fallbacks:
`['de_DE.ISO8859-1', 'de_DE', 'de.ISO8859-1', 'de']`. These are resolved
to `GNUTranslations` instances where a translation exists and the
instances are turned into a linked list with a single head and a chain of
fallbacks.
Django then starts with an empty `GNUTranslations` subclass
(`DjangoTranslation`) instance and then merges the `GNUTranslations`
instance returned by `gettext` into itself. Only in the process it forgets
to carry over any existing fallbacks so the entire tail of the linked list
is lost.
The observable bug is that if a generic translation exists for a language
(say `pt`) and a sparse territorial variant (say `pt-br`) only provides
overrides for certain strings, Django will never fall back to the generic
translation, instead filling the missing translations from the default
locale.
--
Ticket URL: <https://code.djangoproject.com/ticket/29144>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.b5b4bd4ed08ed0c8c349e1b0803d8c77%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.