(會翻譯的不是本來就會讀英文了嗎?)
主要工作
一些參與 Mozilla 產品地方化的人用叫 Mozilla Translator 的工具。我個人是不用,不過你可能會覺得它好用。「How to localize Mozilla Firefox」是篇教你用 Mozilla Translator 地方化 Firefox 的好文件。本文大部份適用於 Nvu,不過有些地方可能過時了
我現在解釋如何手動著手翻譯
起始你的 locale
1. 下載Nvu 的英文版
2. 到 chrome 檔案夾抓 en-US.jar 與 cascades.jar 檔,把它們解壓道空白的檔案路徑。 (這些是一般的 ZIP 檔,任何 zip 工具應都可以處理它們,不過你可能須要把檔名尾改成 .zip。)
3. 移除 content/ 檔案夾,這是不能地方化的 CSS 編輯器用的。
4. 把 en-US/ 檔案夾重命名到你的 locale 碼(zh-tw)。
5. 把所有 contents.rdf 檔裡的 "en-US" 改成你的 locale 碼。
你現在已經可以開始翻譯資源檔了。
各類檔型
DTD 檔 (*.dtd)
UTF-8 編碼的文字檔,無 BOM (某些編輯器稱這編碼為 UTF-8N)
每個 DTD 檔列出一些實體(entities),這些需翻譯。這裡所定的實體是給作使用者介面的 XUL 檔所用。一個實體宣告(entity declaration)長的如下:
代碼:
<!ENTITY openCmd.label "Open Web Location...">
Above, to the entity with name/key "openCmd.label", has been assigned the value "Open Web Location...". The entity value is what needs to be localized. Usually the entity name (e.g. "openCmd.label") is self-explanatory: this one is the label of the Open menu command. If this is not enough, the author of the file adds a comment for the localizer. Comments referring to a particular entity are placed right above the entity declaration as: