adding a custom language to django

前端 未结 1 1693
一整个雨季
一整个雨季 2021-01-22 09:11

I\'m translating my website into the 24 languages of the European Union. These include the \"Malti\" language, that is not listed in django default supported languages.

相关标签:
1条回答
  • 2021-01-22 10:07
    1. I found the solution, you have to manually add a folder in /django/conf/locale/ with the language extension you want. Actually you can just copy past the en (english) folder and name it after the missing language (in my case mt).

    2. In this folder you can also edit the file formats.py to localize the dates, numbers etc.

    3. Restart django and your language will be natively supported.

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