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.
Comment (by Claude Paroz):
I was not able to reproduce your issue with
https://github.com/claudep/django/commit/8941db68bef
Did I miss something?
--
Ticket URL: <https://code.djangoproject.com/ticket/33863#comment:1>
Comment (by Carlos Mermingas):
Thank you Claude. The only difference that I see in that test setup is
that the "locale" folder is under "view_tests", which is an installed app.
How about this?
https://github.com/cmermingas/django/commit/20f1a1a2f0d0a11f96f6c182b017230bf58ecfa6
--
Ticket URL: <https://code.djangoproject.com/ticket/33863#comment:2>
* owner: nobody => Claude Paroz
* status: new => assigned
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted
Comment:
Thanks for your test, I spotted the issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/33863#comment:3>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/15873 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33863#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33863#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f2dd652245987465754c7242b60ccaba03a20f06" f2dd6522]:
{{{
#!CommitTicketReference repository=""
revision="f2dd652245987465754c7242b60ccaba03a20f06"
Fixed #33863 -- Fixed JavaScriptCatalog with more than 1 level of fallback
translations.
Co-authored-by: Carlos Mermingas <cmerm...@gmail.com>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33863#comment:6>