Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda