#33863: Strings from default locale missing from Django JavaScript catalog
------------------------------------------------+------------------------
Reporter: Carlos Mermingas | Owner: nobody
Type: Uncategorized | Status: new
Component: Internationalization | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
== Problem
The JavaScript catalog doesn't include fallback strings in certain
scenarios. In other words: when string "A" is not translated in `es_MX`
but it is translated in `es`, the JavaScript catalog contains the default
or untranslated "A" string.
I set up an app that demonstrates this problem:
https://github.com/cmermingas/i18n_test
I believe that this is an issue but I asked in StackOverflow, in case it's
improper use: https://stackoverflow.com/questions/73086306/strings-from-
default-locale-missing-from-django-javascript-catalog
== Setup
* `LOCALE_PATHS` set to `PROJECT_ROOT/locale`.
* Translations for all apps stored under `LOCALE_PATHS`.
* `JavaScriptCatalog` configured without packages:
{{{
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog')
}}}
* `es_MX` and `es` translations that demonstrate the problem:
* The string `"es - Not translated"` is translated in the `es` locale.
* The string `"es_MX - Not translated"` is translated in the `es_MX`
locale.
== Workaround
This works if I pass `packages` to `JavaScriptCatalog`:
{{{
path(
'jsi18n/',
JavaScriptCatalog.as_view(packages=["testapp"]),
name='javascript-catalog'
)
}}}
But this is not required, is it?
--
Ticket URL: <https://code.djangoproject.com/ticket/33863>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018227e96a91-39e40972-6964-47d9-8f26-d88f9bea4365-000000%40eu-central-1.amazonses.com.