python-Django本地化msgmerge错误

我有一个中型的Django项目,并且正在使用Django Translation.当我运行命令django-admin.py makemessages -l fr时.使用法语时出现以下错误.

CommandError: errors happened while running msgmerge
msgmerge: input file doesn't contain a header entry with a charset specification

在哪里指定字符集规范以及在其中指定什么?

解决方法:

它只是普通的样板PO文件头.就像是:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-05-18 20:44+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

您可能应该在现有的法语PO文件中查找标题.

该错误可能是由于没有国际化字符串的应用程序引起的.

上一篇:树链剖分


下一篇:PO设计模式