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
趙惟倫
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
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
520
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.6k
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
370
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
6k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
420
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
120
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
160
Verilogで学ぶCPU自作入門.pdf
uyuki234
7
3.9k
Heart of Swift Concurrency
koher
0
1.1k
すこし踏み込む CancellationToken
htkym
2
1.6k
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
How to Talk to Developers About Accessibility
jct
2
560
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
720
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The SEO identity crisis: Don't let AI make you average
varn
0
570
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
560
Amusing Abliteration
ianozsvald
1
320
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
開發展望 開發展望 補充現有字典對照表資料 增加其他漢語字典對照表 使用模組結構進行安裝 支援更多訊息檔案格式 利用網路翻譯服務 背景即時訊息翻譯
謝謝各位 敬請指教 簡報模板:資訊未來大自由 ( 孫賜萍 )