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