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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
趙惟倫
June 10, 2017
Programming
780
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.6k
Multiplication Table in Various Programming Languages
bluebat
0
680
Gamelets Arena for AI Players
bluebat
0
980
Alternative Web Services
bluebat
0
300
Look at Yue Desktop
bluebat
0
570
Making P-Font with FontForge
bluebat
0
230
Slides Making
bluebat
0
220
Other Decks in Programming
See All in Programming
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.8k
AWSに止められる覚悟してますか?
morizo_1984
2
540
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
140
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
200
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
Railsバージョンを4倍にした話
optim
0
530
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
300
phperだってパンチカードでコーディングしたい
o0h
PRO
0
380
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.3k
AI-Powered Domain-Driven Design
ziobrando
0
220
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.3k
Featured
See All Featured
Accessibility Awareness
sabderemane
1
250
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
The Curse of the Amulet
leimatthew05
3
16k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
350
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
630
Test your architecture with Archunit
thirion
2
2.4k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Paper Plane (Part 1)
katiecoart
PRO
2
12k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
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
開發展望 開發展望 補充現有字典對照表資料 增加其他漢語字典對照表 使用模組結構進行安裝 支援更多訊息檔案格式 利用網路翻譯服務 背景即時訊息翻譯
謝謝各位 敬請指教 簡報模板:資訊未來大自由 ( 孫賜萍 )