如何使GAE + django拿起我的.po和.mo翻译 [英] How to make GAE+ django pick up my .po and .mo translations
问题描述
有办法吗它曾经与django 0.96一起工作,升级后只有内置的翻译工作。
更新:我尝试移动到APP_DIR / locale / LANG_CODE / LC_MESSAGES / django.po,它对我来说不起作用。也许我错过了一些东西。我需要重新编译.po文件吗?
更新:在这里说明,我把.po和.mo文件放在
APP_DIR / locale / LANG_CODE / LC_MESSAGES / django.po
仍然不行。我正在考虑为什么和欢迎任何更多的建议或建议如何启用i18n功能与django谷歌应用程序引擎。
编辑:这是一个链接,我们在GAE python组中讨论此问题。
更新:现在它可以工作。我们不必在conf目录中移动目录。我们只是使用:
from google.appengine.dist import use_library
use_library('django','1.2')
#强制Django从django.conf导入设置重新设置
os.environ ['DJANGO_SETTINGS_MODULE'] ='conf.settings'
settings._target =无
将您的区域设置文件放在:
APP_DIR / locale / LANG_CODE / LC_MESSAGES / django.po
APP_DIR / locale / LANG_CODE / LC_MESSAGES / django.mo
我有同样的问题,改变路径工作
I got translations ready in .po and .mo files. How can I make django 1.2 display these? I can use the builtin trnanslations and now I want to enable in addition the ones I keep in [application-name]/conf/locale/[Language_Code]/LC_MESSAGES'
Is there a way? It used to work with django 0.96 and after the upgrade only the builtin translations work.
UPDATE: I tried moving to APP_DIR/locale/LANG_CODE/LC_MESSAGES/django.po and it won't work for me. Maybe I missed something. Do I have to recompile .po files?
UPDATE: Folowing the instructions here, I put my .po and .mo files in
APP_DIR/locale/LANG_CODE/LC_MESSAGES/django.po
It still won't work. I'm considering why and welcoming any more advice or recommendation how to enable i18n features with django for google app engine.
EDIT: Here's a link where we discuss this issue in the GAE python group.
Update: Now it works. We didn't have to move around the directories in the conf directory. We just use:
from google.appengine.dist import use_library
use_library('django', '1.2')
# Force Django to reload settings
from django.conf import settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'conf.settings'
settings._target = None
Put you locale files at:
APP_DIR/locale/LANG_CODE/LC_MESSAGES/django.po
APP_DIR/locale/LANG_CODE/LC_MESSAGES/django.mo
I had same problem and changing the path worked
这篇关于如何使GAE + django拿起我的.po和.mo翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!