设置.py:
LANGUAGE_CODE = 'de'
ugettext = lambda s: s
LANGUAGES = (
('en', ugettext(u'English')),
)
LOCALE_PATHS = (
os.path.join(DIRNAME, '../locale'),
)
模板/index.html:
{% load i18n l10n %}
{% trans "Hund" %}
语言环境/en/LC_MESSAGES/django.po:
#: projectname/templates/index.html:2
msgid "Hund"
msgstr "Dog"
为什么我还有这个名字:msgstr
- “狗”?(无论我在 中设置的是英语还是德语LANGUAGE_CODE = 'de'
)