大家好!
《debian 参考手册》(第二版),目前简体中文已经翻译完成。
在 debian-reference 软件包的 bin 目录下,有个 genxml 的脚本,对简体和繁体的 po 文件,使用
opencc 进行了互相转化。以便互相使用简体中文和繁体中文的翻译成果。
相关脚本片段如下:
# Generate XML (zh-tw)
gen_xml_zh_TW () {
if which opencc >/dev/null ; then
${MSGCAT} --no-wrap ${DPO}/zh-cn.po |\
${OPENCC} -c ${DCC}/s2twp.json -o ${DPO}/zh-tw.po-opencc
${MSGCAT} -o ${DPO}/zh-tw.po-best --use-first
${DPO}/zh-tw.po ${DPO}/zh-tw.po-opencc
${DBIN}/fuzzypo ${DPO}/zh-tw.po-best >>fuzzy.log
else
ln -f ${DPO}/zh-tw.po ${DPO}/zh-tw.po-best
fi
if [ -f ${DPO}/zh-tw.add ]; then
${TRANSLATE} -m ${MANUAL}.en.xml -a ${DPO}/zh-tw.add -p
${DPO}/zh-tw.po-best -l ${MANUAL}.zh-tw.xml
else
${TRANSLATE} -m ${MANUAL}.en.xml -p ${DPO}/zh-tw.po-best
-l ${MANUAL}.zh-tw.xml
fi
#rm -f ${DPO}/zh-tw.po-best
}
该脚本的处理过程是,把目前繁体中文还没有翻译的字符串,使用 opencc
将简体中文相应字符串转码后使用,不影响繁体中文原有已经翻译的字符串。
目前 debian
官网繁体中文的网页,也是这样生成。https://www.debian.org/doc/manuals/debian-reference/index.zh-tw.html
为便于在 weblate 上进行繁体中文的校对和翻译工作,我刚才把 genxml 脚本生成的 zh-tw.po-best 拷贝为
zh-tw.po,提交到 git,并同步到了 weblate。
繁体中文的翻译者,可以继续在 weblate 进行翻译校对工作。
https://hosted.weblate.org/projects/debian-reference/translations/zh_Hant/
肖盛文
--