Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
msgchi L10n Tool
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
趙惟倫
June 10, 2017
Programming
770
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
120
VDI Historical Overview
bluebat
1
210
RPM Sphere Repository
bluebat
0
1.5k
Multiplication Table in Various Programming Languages
bluebat
0
670
Gamelets Arena for AI Players
bluebat
0
970
Alternative Web Services
bluebat
0
300
Look at Yue Desktop
bluebat
0
560
Making P-Font with FontForge
bluebat
0
220
Slides Making
bluebat
0
220
Other Decks in Programming
See All in Programming
FreeBSDでZabbixを動かす
kenkino
0
340
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
270
mrbgem 三角測量 開発
ogom
0
170
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
280
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
AHC070解法紹介
eijirou
0
150
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.3k
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
1k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
170
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.5k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
270
Paper Plane
katiecoart
PRO
4
53k
The Curious Case for Waylosing
cassininazir
1
550
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
750
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
780
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
540
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Documentation Writing (for coders)
carmenintech
77
5.6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
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
開發展望 開發展望 補充現有字典對照表資料 增加其他漢語字典對照表 使用模組結構進行安裝 支援更多訊息檔案格式 利用網路翻譯服務 背景即時訊息翻譯
謝謝各位 敬請指教 簡報模板:資訊未來大自由 ( 孫賜萍 )