Django: default language i18n

后端 未结 3 1490
耶瑟儿~
耶瑟儿~ 2021-02-07 05:45

I have a website that is written in dutch. Now I have to provide a second language for that website which is french.

So I surrounded all text that needs to be translate

3条回答
  •  独厮守ぢ
    2021-02-07 06:17

    this question and answers could be helpful - set language within a django view

    Don't forget to use translation.activate(lang_code), this is really important.

    You can use standard way to change languages with the post method or write your own middleware and change it for example in the url then.

    Cheers, Ignas

提交回复
热议问题