Django i18n not recognizing language files

我的梦境 提交于 2019-12-05 16:20:56

In your case you must put into LOCALE_PATHS absolute path to your locale directory, i.e.

LOCALE_PATHS = (
    '/home/path_to_your_project/myproject/locale/', 
)

I guess you've tried to set relative path there.

I had similiar problem: i've been using django 1.3 and my locale directory was in the root of my project, i.e. near settings.py and manage.py files. But when i create project with django 1.4, project directory structure have been changed: settings.py have moved into myproject/myproject folder. I still create locale folder in myproject/ (not in myproject/myproject). And with django 1.4 it is not working any more.

Reading documentation i understand, that django just can't find my locale folder. So solution that helps me - either move locale dir into myproject/myproject and don't set any LOCALE_PATHS OR leave locale dir in myproject/ path and add full path to it in settings.py in LOCALE_PATHS tuple.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!