django - how to make translation work?

前端 未结 9 1100
不知归路
不知归路 2020-12-13 04:00

I\'m trying to render a template in a different language using i18n. I did everything I could read about, from setting the language code, creating and compiling translation

9条回答
  •  死守一世寂寞
    2020-12-13 04:39

    I have the same problem. But I solve it by putting "Language:" to .po file. In my case .po file does not contain the "Language:" attribute, it looks like...

    "Language-Team: LANGUAGE \n"
    "Language: \n"
    "MIME-Version: 1.0\n"
    

    but when I put language code (in my case 'ru' or 'en')

    "Language-Team: LANGUAGE \n"
    "Language: ru\n"
    "MIME-Version: 1.0\n"
    

    it works for me

提交回复
热议问题