django internationalization and translations issue

前端 未结 7 1771
傲寒
傲寒 2020-12-09 18:52

I have a problem with django translations.

Problem 1 - I updated string in django.po file, but the change does not appear on the webpage.

Problem 2 - I have

7条回答
  •  无人及你
    2020-12-09 19:25

    If you are using gettext.translation to get the translations, i.e:

    text_de = gettext.translation('django', locale_dir, ['de'], fallback=True).ugettext('Welcome to my site')
    

    ... and your translation works on the development server but not on production, note that locale_dir must point to your locale directory. It might be located elsewhere on one of the systems. Spent like 2 hrs finding it.

提交回复
热议问题