我想知道是否有一种方法可以将自定义语言添加到django所以它可以使用本机i18n url功能。
谢谢!
解决方案
我找到了解决方案,你必须在/ django手动添加一个文件夹/ conf / locale /您需要的语言扩展名。实际上,您可以复制过去的en(英文)文件夹,并在缺少语言(在我的情况下为mt))中命名。
在此文件夹中,您还可以编辑文件formats.py以本地化日期,数字等。
重新启动django,您的语言将被本地支持。
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.
I would like to know if there is a way to add a custom language to django so it can work with the native i18n url function.
Thanks!
解决方案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).
In this folder you can also edit the file formats.py to localize the dates, numbers etc.
Restart django and your language will be natively supported.
更多推荐
向django添加自定义语言
发布评论