ローカリゼーションを開始していますが、行き詰まります。
プログラム
#example.py import gettext t = gettext.translation('cn', 'C:\locale', fallback=True) _ = t.ugettext print _('Hello!')
動作します。
しかし、pygettextを使用しようとすると
python pygettext.py -d cn -o cn.pot example.py
私はメッセージを受け取ります
"invalid syntax:<string>, line 1, pos 18
最も単純な pygettest コマンドでさえ試しました:
python pygettext.py example.py
同じエラーを返します。プログラムで他のさまざまな設定や変更を試みましたが、このエラーが何度も返されます。
コードを使用した完全な例はhttp://achilles-keep-moving.blogspot.nl/2011/07/minimal-tutorial-for-python.htmlです
私が間違っていることは何ですか?