8000 Add from_cn.sh script that copies translations from zh_CN and convert… · python/python-docs-zh-tw@44b1745 · GitHub
[go: up one dir, main page]

Skip to content

Commit 44b1745

Browse files
committed
Add from_cn.sh script that copies translations from zh_CN and convert it with OpenCC
1 parent 024e238 commit 44b1745

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

from_cn.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
fp=$1
4+
python_docs_zh_cn=../python-docs-zh-cn
5+
6+
opencc -i $python_docs_zh_cn/$fp -c s2twp.json -o /tmp/tmp.po
7+
pofilter --nonotes --excludefilter unchanged --excludefilter untranslated /tmp/tmp.po | msgattrib --set-fuzzy -o /tmp/tmp.po
8+
pomerge -t $python_docs_zh_cn/$fp -i /tmp/tmp.po -o /tmp/tmp.po
9+
10+
pofilter --nonotes --excludefilter untranslated $fp /tmp/tmp2.po
11+
pomerge -t /tmp/tmp.po -i /tmp/tmp2.po -o /tmp/tmp3.po
12+
msgcat --lang zh_TW /tmp/tmp3.po -o $fp
13+
14+
rm /tmp/tmp.po /tmp/tmp2.po /tmp/tmp3.po

0 commit comments

Comments
 (0)
0