On Thu, 4 Jul 2013 22:22:40 +0800 Marguerite Su wrote: Hi Marguerite,
It is possible that some kind guys writing some perl scripts to extract the translator credits in every po, generate a new xml, and integrate it into our existing documentation?
Attached is a shell script that, sort of, does what you want--based on the existing data. The biggest problem with your .po files is the inconsistency of the Translators data. Some translator credits are added as comments at the beginning of the file, whereas others are mentioned in the "translator-credits" section. Combination of both exists, too. The "translator credit" section contains the data in a number of varieties that makes them difficult to parse (there are even two different commas!). Single authors also entered their credits differently from file to file (there are, for example, nine different credits from yourself ;-)). Interestingly, there is almost no occurrence of multi-line data in the "translator-credits" section. (a fact I made use of). The fact that the data is inconsistent also makes the msggrep output useless for your purpose. It typically looks like this:
msggrep -K -e 'translator-credits' po/zypper.xml.zh_CN.po # # Translators: #
, 2013. # Guo Yunhe , 2013. msgid "" msgstr "" "Project-Id-Version: opensuse-manuals\n" "POT-Creation-Date: 2013-03-17 02:02+0800\n" "PO-Revision-Date: 2013-03-02 03:36+0000\n" "Last-Translator: guoyunhebrave \n" "Language-Team: Chinese (China) (http://www.transifex.com/projects/p/opensuse-" "manuals/language/zh_CN/)\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n"
#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1,
YEAR2 #: zypper.xml:0(None)
msgid "translator-credits"
msgstr "Sign Guo Yunhe