gettext translation not working on production system

后端 未结 2 1246
北海茫月
北海茫月 2021-01-13 00:56

I\'ve encountered a strange problem when translating strings (in the admin) using django\'s gettext: Locally running the dev server all translations are display

2条回答
  •  我在风中等你
    2021-01-13 01:24

    I had a similar problem and apart from what Tomasz Zielinski pointed out I had to make the following changes:

    in settings.py

    LOCALE_PATHS = (
        "/path/to/your/project/locale",
    )
    

    Remember the trailing slash and make sure that the directory structure looks something like:

    project
       your_app
       your_other_app
       locale
          en_US
              LC_MESSAGES
          sv_SE
              LC_MESSAGES
    

提交回复
热议问题