On Tue, 28 Aug 2001, Chih-Wei Huang wrote:
還有,有些檔案用 xlpotdb 處理過的,
我個人不太喜歡。因為它會加上一堆註解,
增加 po 檔的大小,而且它還會打亂 po 檔原本
的訊息順序。這表示你很難用 diff 去比對新增
或修改了那些訊息。如果真的要用的話,我的建議
是,經 xlpotdb 處理之後,用 grep -v "^#" 把
所有註解行移去,再和原來 pot 做 merge 以回復
原本的順序。
謝謝!終於有人肯說出來了。我只怕一旦說出自己討厭 xlpotdb
的原因會被人轟炸。
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"
另外有一點提示,就是若看到像 %d %s 等而需要交換次序,可使用像 %2$s %1$d
的格式。就拿以上的例子修改:
msgid "%s is beated by %s"
可翻譯為
msgstr "%2$s 擊敗 %1$s"
3. 注意快速鍵
有些訊息的某個字母前會有 & 的符號,
代表你可以直接按下該字母代表的快速鍵
來選擇該項目。通常是出現在 menu 或 button
的訊息中。翻譯時請記得保留。
只是中文裡沒有好的方式可以插入這些符號,
目前常用的做法是仿照 Windows 的 menu,
把它放在翻譯訊息最後用 () 夾起來。
例如:
msgid "&File"
msgid "檔案(&F)"
這個在下想問一問大家的意見。在下曾見過使用方括號的翻譯,發現效果不錯,和使用
'( )' 好像差不多一樣美觀。大家是否已經約定俗成使用 '(' 和 ')' 了?
Abel