1
i18nを使用したいと思います。私はロケールディレクトリとその他の設定をsettings.py
に作成しました。makemessagesコマンドを実行できません
私はPyCharmでpython manage.py makemessages -l zh-cn
コマンドを実行しますが、失敗しました。
私のトレースバックが怒鳴るです:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.7/site-packages/Django-1.11.2-py2.7.egg/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Library/Python/2.7/site-packages/Django-1.11.2-py2.7.egg/django/core/management/__init__.py", line 296, in execute
parser = CommandParser(None, usage="%(prog)s subcommand [options] [args]", add_help=False)
File "/Library/Python/2.7/site-packages/Django-1.11.2-py2.7.egg/django/core/management/base.py", line 51, in __init__
super(CommandParser, self).__init__(**kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 1597, in __init__
self._positionals = add_group(_('positional arguments'))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py", line 569, in gettext
return dgettext(_current_domain, message)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py", line 533, in dgettext
codeset=_localecodesets.get(domain))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py", line 468, in translation
mofiles = find(domain, localedir, languages, all=1)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py", line 440, in find
for nelang in _expand_lang(lang):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gettext.py", line 133, in _expand_lang
from locale import normalize
ImportError: cannot import name normalize
おそらく正しい答えが、理由を説明する気?それはOPにはあまり明らかではないかもしれません。 – spectras