轉換這些 po 檔可真費功夫,原因倒不是出在轉換編碼本身,
而是因為許多 po 檔的格式不對,還得手動一一修正。
尤其是 seventeen 放在 test 目錄下的那些檔案,
簡直亂七八糟...
很多檔案看起來是直接從 mail 上 save 下來的,
連 mail header, 簽名檔什麼的都還留在上面,
甚至還有用 html 格式儲存的。
還有比較長的行會被 mail client 自動截斷換行
也造成格式錯誤。
其它像少了 po header 等的問題更不在話下...
我幾乎花了一整天的時間才把它一一修正。
這裡小小 complain 一下,也請大家稍微注意一下,
讓 maintainer 的工作好做一點...:)
(不是我啦,是小州... :P)
因此這裡做個小小的要求,請大家配合一下:
麻煩在寄發 po 檔給 translator 時,
以 attach 的形式來寄送,而不要直接附在信件內文裡。
同樣的,當您翻譯完寄回來時,也請 attach 您翻譯的檔案,
不要放在內文中。否則就恕不處理了...
還有,有些檔案用 xlpotdb 處理過的,
我個人不太喜歡。因為它會加上一堆註解,
增加 po 檔的大小,而且它還會打亂 po 檔原本
的訊息順序。這表示你很難用 diff 去比對新增
或修改了那些訊息。如果真的要用的話,我的建議
是,經 xlpotdb 處理之後,用 grep -v "^#" 把
所有註解行移去,再和原來 pot 做 merge 以回復
原本的順序。
此外,翻譯 po 檔本身也有幾個小地方要注意:
1. 注意 fuzzy 訊息:
訊息前有 fuzzy 字樣的,是在 msgmerge 過程中
自動產生的。也就是,msgmerge 會比對相近的訊息,
然後幫您「猜」一個可能的翻譯。這個猜測可能是對
的,不過也很可能錯得離譜。因此您要 review 一遍,
並做校正。校正完後記得要把 fuzzy 那行刪掉,否則
msgfmt 時是會把 fuzzy 的訊息忽略的,那您就白做了...:p
例如:
#: common_texts.cpp:24 kdeprint/management/kmdriverdialog.cpp:28
#, fuzzy
msgid "&Configure..."
msgstr "設定 %1"
校訂為
#: common_texts.cpp:24 kdeprint/management/kmdriverdialog.cpp:28
msgid "&Configure..."
msgstr "設定(&C)..."
2. 注意 c-format 訊息
就是字串中有 %# 符號的,# 是個數字 1,2,3,...
這在實際顯示時會被一些字串取代。
(如果你會 C 語言就知道,這是類似 printf 的用法,
這也是為何這種訊息叫 c-format)
在翻譯時,*一定* 要完整的保留這些格式,
不多也不少。否則程式很可能顯示錯誤甚至當掉。
如:
#: kdecore/kwinmodule.cpp:293
#, c-format
msgid "Desktop %1"
msgstr "桌面 %1"
%1 代表第一個被取代的字串,%2 代表第二個被取代的字串,...
在翻譯時其順序倒可自由調整,不必跟原來一樣。
(因為英文與其它語言文法結構未必相同,
這種可調整的彈性是必要的)。例如:
msgid "%1 is beated by %2"
可翻譯為
msgstr "%2 擊敗 %1"
3. 注意快速鍵
有些訊息的某個字母前會有 & 的符號,
代表你可以直接按下該字母代表的快速鍵
來選擇該項目。通常是出現在 menu 或 button
的訊息中。翻譯時請記得保留。
只是中文裡沒有好的方式可以插入這些符號,
目前常用的做法是仿照 Windows 的 menu,
把它放在翻譯訊息最後用 () 夾起來。
例如:
msgid "&File"
msgid "檔案(&F)"
4. 注意 extended gettext 格式
KDE 對 gettext 加了一個擴充的功能,
允許 programmer 為訊息加上提示,以方便
翻譯者了解該訊息在該處的真正意義。
這種擴充的訊息在 po 檔中會以
_: (註解,說明此訊息的真正意義)
的方式呈現。
這個提示的訊息*不可以*翻譯出來。
(否則顯示結果一定會很奇怪)
例如:
#: kdecore/klocale.cpp:151
msgid ""
"_: Monday\n"
"Mon"
msgstr "週一"
這裡真正要翻譯的訊息就是 "Mon",
前面的 "_: Monday\n" 只是提示,
告訴翻譯者 "Mon" 就是 monday。
否則翻譯者光看到 "Mon" 大概會一頭霧水,
不知該翻成什麼。
5. 記得把您的名字放上去
在 po header 的 Last-Translator 記得填上
您的姓名和聯絡的 email。除了讓別人知道您的
貢獻外,最主要的意義是讓其它人可以將
feedback 意見寄給您。如:
"Last-Translator: Chih-Wei Huang <cwhuang(a)linux.org.tw>\n"
如果該 po 檔原先已有翻譯者,可以將他的名字
以註解方式保留在檔案最開頭,以示尊重:
# Original Translator: Jing-Jong Shyue <shyue(a)sonoma.com.tw>
# Allen Huang <lancelot(a)pchome.com.tw>
另外,很多 po 檔會有 "Your names" 和 "Your emails"
兩則訊息,這也是讓您填上您的大名和 email 的。
它會出現在程式的 About dialog 中的 "翻譯" 欄位,
讓大家知道您的貢獻。如:
#: _translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr "黃志偉"
#: _translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr "cwhuang(a)linux.org.tw"
千萬別翻成 "您的名字" 呀! (我看到好幾個這樣翻的 :p)
其它不足的地方,請參考 KDE Translation HOWTO
http://i18n.kde.org/translation-howto/
http://i18n.kde.org/translation-howto/gui-step-by-step.html
http://i18n.kde.org/translation-howto/gui-peculiarities.html
--
~ Chih-Wei Huang (cwhuang(a)linux.org.tw)
'v' CLDP Project :
http://www.linux.org.tw/CLDP/ (Coordinator)
// \\ CLE Project :
http://cle.linux.org.tw/CLE/ (Developer)
/( )\ I18N Project :
http://i18n.linux.org.tw/ (Translator)
^`~'^ HomePage :
http://www.cwhuang.idv.tw/