Django i18n: Common causes for translations not appearing

前端 未结 9 2124
心在旅途
心在旅途 2020-12-30 23:16

I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew)

9条回答
  •  悲&欢浪女
    2020-12-30 23:46

    I was having this problem with my project right now. I had the variable LANGUAGES on settings.py set this way:

    LANGUAGES = (
    ('en', _('English')),
    ('pt-br', _('Brazilian Portuguese')),
    )
    

    And a folder structure with a locale folder, and a subfolder pt-br inside. Turns out that my translations weren't loading. The LANGUAGES variable follows the pt-br pattern, and the folders must be on pt_BR pattern. At least that's the only way it's working here!

提交回复
热议问题