Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Strings from default locale missing from Django JavaScript catalog

Problem

The problem I am having is that 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

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?

I tried this answer, which suggests adding domain="django", but it didn't work for me.

What am I doing wrong or is this an issue?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This was identified as a bug in issue #33863 and a fix was submitted. The solution will be to update Django when this fix is released.

As a workaround, I suggest what I noted in the question (pass packages to JavaScriptCatalog):

path(
    'jsi18n/',
    JavaScriptCatalog.as_view(packages=["<your-app-here>"]),
    name='javascript-catalog'
)
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!