Django i18n: Common causes for translations not appearing

前端 未结 9 2070
心在旅途
心在旅途 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:57

    Hi just attach some fixes I had to do in the past:

    • Restart the webserver!

    In the setting file - USE_I18N = True is needed

    • django.middleware.locale.LocaleMiddleware among middleware modules (but this is not your case for sure as long as Django will not care about your local at all)

    • django.core.context_processors.i18n among TEMPLATE_CONTEXT_PROCESSORS

    for sure I had other issues related to translations but I don't remember them all... hope this can help!

    0 讨论(0)
  • 2020-12-30 23:59

    My answer here, all my translations were working except for 2 DateFields that I was using in a ModelForm. Turns out that I had a widget in my forms.py that was not working well with the translations.

    I just removed it for now so I can enjoy Xmas =D

    0 讨论(0)
  • 2020-12-31 00:00

    Maybe the translated strings are marked as fuzzy?

    0 讨论(0)
提交回复
热议问题