如何为gettext .po文件制作标题?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何为gettext .po文件制作标题?相关的知识,希望对你有一定的参考价值。
答案
如果我是你,我会下载一个示例.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.
#
#: src/link/to/my/src:67
msgid ""
msgstr ""
"Project-Id-Version: xxx
"
"Report-Msgid-Bugs-To:
"
"POT-Creation-Date: 2010-07-06 12:31-0500
"
"PO-Revision-Date: 2011-05-27 22:37+0100
"
"Last-Translator: My NAME<me@mydomain.com>
"
"Language-Team: TEAM <team@TTEAM.com>
"
"MIME-Version: 1.0
"
"Content-Type: text/plain; charset=UTF-8
"
"Content-Transfer-Encoding: 8bit
"
然后,内部以这种方式组织:
# This is a comment
# and another line of comment
msgid "This is my original string to translate"
msgstr "Translation goes here ... "
# TRANSLATED : Mon Jun 14 09:36:07 2010
# TRANSLATOR : MyName goes here... it's a comment
#: src/main/my/source/reference/:34
msgid "Get started now!"
msgstr "Commencez dès maintenant!"
希望这可以帮助...
另一答案
找到设置charset的方法就像把"Content-Type: text/plain; charset=utf8"
放在文件中一样简单。
以上是关于如何为gettext .po文件制作标题?的主要内容,如果未能解决你的问题,请参考以下文章
如何为 XSLT 代码片段配置 CruiseControl 的 C# 版本?
支持 ngettext 样式复数的 GNU gettext PO 文件的 Google 翻译服务