Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
msgchi L10n Tool
Search
趙惟倫
June 10, 2017
Programming
740
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
msgchi L10n Tool
軟體訊息本地化前置翻譯工具
https://github.com/bluebat/.presentations/raw/master/msgchi-l10n-tool.odp
趙惟倫
June 10, 2017
More Decks by 趙惟倫
See All by 趙惟倫
BASH Basics
bluebat
0
110
VDI Historical Overview
bluebat
1
190
RPM Sphere Repository
bluebat
0
1.5k
Multiplication Table in Various Programming Languages
bluebat
0
640
Gamelets Arena for AI Players
bluebat
0
730
Alternative Web Services
bluebat
0
290
Look at Yue Desktop
bluebat
0
530
Making P-Font with FontForge
bluebat
0
190
Slides Making
bluebat
0
190
Other Decks in Programming
See All in Programming
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
Claspは野良GASの夢をみるか
takter00
0
200
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
370
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
140
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
210
OSもどきOS
arkw
0
580
Agentic UI
manfredsteyer
PRO
0
190
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
290
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
380
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
900
Featured
See All Featured
A Tale of Four Properties
chriscoyier
163
24k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
440
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Facilitating Awesome Meetings
lara
57
7k
Why Our Code Smells
bkeepers
PRO
340
58k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Practical Orchestrator
shlominoach
191
11k
The untapped power of vector embeddings
frankvandijk
2
1.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Transcript
趙惟倫 <
[email protected]
> 2017 年 6 月 10 日 軟體訊息本地化 軟體訊息本地化
前置翻譯工具 前置翻譯工具 香港開源年會
訊息本地化 訊息本地化
來臨之前… 來臨之前…
msgchi msgchi https://github.com/bluebat/msgchi 名稱來自於 gettext 命令列工具程式組 msg* 由單一程式與多個字典對照表組成 支援 gettext
與其他簡單格式軟體訊息 支援英語轉漢語以及不同漢語間互轉 程式使用 GPL 授權,對照表屬於公共財
程式參考 程式參考 stcc 由 Ling Li( 李凌 ) 編寫以轉換簡繁漢語文章,屬於 Yuan-
Chen Cheng( 鄭原真 ) 所主持專案的一部分。 webpot 是 Ping Yeh( 葉平 ) 編寫的 po 檔協同編輯網頁應用。 msghack 是 Trond Eivind Glomsrød 開發的 gettext 小工具。 https://github.com/BYVoid/OpenCC 來自 Carbo Kuo( 郭家寶 ) https://github.com/GNOME/gnome-i18n/raw/master/zh_HK/ tw2hk.pl 來自 Abel Cheung( 張國冠 )
對照表參考 對照表參考 CPATCH <http://glossary.pank.org/> CMEX 「兩岸資訊及通信術語對照表」 英中繁簡編程術語對照 <http://jjhou.boolan.com/terms.htm> 曾焯文《粵辭正典》 邵慧君、甘于恩《粵語詞彙講義》
部分譯詞不符教育標準與習慣用法
內容 內容 ( ( 程式與對照表 程式與對照表 ) ) #!/usr/bin/python3 #
-*- coding: utf-8 -*- name = 'msgchi' ⋮ ⋮ ⋮ if __name__ == '__main__': gettext.textdomain(name) _ = gettext.gettext knowns = Knowns() arguments = Arguments() translator = Translator() for inputFile in arguments.pars: if arguments.opts.expression: handleIn = NPO() else: handleIn = PO() handleIn.readIn(inputFile) if handleIn.messages: handleIn.translate() handleIn.writeOut() #!/usr/bin/python3 # -*- coding: utf-8 -*- name = 'msgchi' ⋮ ⋮ ⋮ if __name__ == '__main__': gettext.textdomain(name) _ = gettext.gettext knowns = Knowns() arguments = Arguments() translator = Translator() for inputFile in arguments.pars: if arguments.opts.expression: handleIn = NPO() else: handleIn = PO() handleIn.readIn(inputFile) if handleIn.messages: handleIn.translate() handleIn.writeOut() a| ,| , -"| 」 "-| 「 no| 沒有 ok| 確定 -do| 嗎 misc.| 雜項 full screen| 全螢幕 full-screen| 全螢幕 cd/dvd drive| 光碟機 relative url| 相對網址 signed values| 帶正負號的值 red eye reduction| 消除紅眼 campus area network| 校園區域網路 disconnect from all| 全部中斷連接 ⋮ ⋮ ⋮ a| ,| , -"| 」 "-| 「 no| 沒有 ok| 確定 -do| 嗎 misc.| 雜項 full screen| 全螢幕 full-screen| 全螢幕 cd/dvd drive| 光碟機 relative url| 相對網址 signed values| 帶正負號的值 red eye reduction| 消除紅眼 campus area network| 校園區域網路 disconnect from all| 全部中斷連接 ⋮ ⋮ ⋮
命令選項 命令選項 用法: msgchi [ 選項 ] [ 輸入檔 ]
v2.3, GPL (C) Wei-Lun Chao <
[email protected]
>, 2023 選項 : -h, --help 顯示此說明訊息並離開 -a ""|_|&, --accelerator=""|_|& 指定快捷鍵符號 -c "NAME <EMAIL>", --credit="NAME <EMAIL>" 翻譯者大名 -d FILE, --dictionary=FILE 字典檔的名稱 -e "(^)(.*)($)", --expression="(^)(.*)($)" 訊息正規表示式 -F, --fuzzyfree 強制除去模糊標記 -k, --keep 備註翻譯過的 msgstr -l ABC2XYZ, --language=ABC2XYZ 來源與目標語言 -m, --mapped 只翻譯全部匹配的訊息 -n, --msgno 將所有訊息編號 -o FILE, --output=FILE 輸出檔的名稱 -p NAME-VERSION, --package=NAME-VERSION 軟體名稱與版本 -s, --skip 跳過已完成的 msgid -t po|prg|ini|txt, --type=po|prg|ini|txt 訊息檔案型態 -w, --wrap 允許長訊息換列 -x RE, --exclude=RE 排除字串的正規表示式 -X, --xmltag 不排除 XML 標籤內文字
安裝與使用 安裝與使用 軟體安裝 操作範例 # 原始碼軟體包 > wget https://github.com/bluebat/msgchi/archive/v2.3.tar.gz >
tar xvf v2.3.tar.gz; make -C msgchi-2.3 install # 翻譯 Elgg 訊息 > msgchi -t prg -l cmn2yue -o yue_hk.php zh_tw.php # 翻譯 Telegram 訊息 > msgchi -e '(.* = \")(.*)(\";$)' -l cmn2yue -o Desktop_yue_HK.strings Desktop_HK.strings # 翻譯 Chromium 訊息 > mkdir yue-HK; paktools.py zh-TW.pak; cd zh-TW > for i in *; do msgchi -l cmn2yue -t txt -o ../yue-HK/$i $i; done; paktools.py yue-HK # 翻譯所有 gettext 訊息 > cd /usr/share/locale/zh_TW/LC_MESSAGES > for i in *; do msgunfmt $i|msgchi -l cmn2yue|msgfmt -o ../../yue_HK/LC_MESSAGES/$i -; done
開發展望 開發展望 補充現有字典對照表資料 增加其他漢語字典對照表 使用模組結構進行安裝 支援更多訊息檔案格式 利用網路翻譯服務 背景即時訊息翻譯
謝謝各位 敬請指教 簡報模板:資訊未來大自由 ( 孫賜萍 )