Home
Thursday, 03 October 2024
 
 
如何对扩展的原有描述进行本地化?(适用于 Gecko 1.9 之前版本) Print
Written by Goofy   
Saturday, 26 January 2008

作者:Goofy / 汉化:fang5566

如何对 Mozilla 应用程序的扩展的原有描述进行本地化?

  这篇简短的教程主要是面向那些已经对如何编辑和本地化如 Firefox、Thunderbird、Mozilla 的基于 Gecko 引擎的应用程序有一些基本了解的用户,教程的内容出自 Mozilla Developer Center 的 Localizing extension descriptions 。

  以下是对我们称之为 tournicoti 的扩展的描述进行本地化的几个步骤:

            1)检查该扩展是否包含有如下的树型结构,如果不是的话按下面的结构创建所缺的部分:

 

                            |---install.rdf
                            |

tournicoti.xpi==|---install.js
                            |
                            |---
defaults------preferences-----
prefs.js
                            |                  
                            |---chrome.manifest                   
                            |                                                                
|--content
                            |---chrome---------
tournicoti.jar=====|                                                     
                                                                                              |---skin               
                                                                                              |                               
                                                                                              |---locale--|
                                                                                                                |

                                                                                                        tournicoti
                                                                                                                |
                                                                                                       ---------------.....
                                                                                                      |         |         |
                                                                                                 en-US        (其他语言...)
                                                                                                                |
                                                                                                       --------------
                                                                                                       |       |        |
                                                                                     contents.rdf     |    tournicoti.dtd
                                                                                                               |
                                                                                             
tournicoti.properties

= = = = = 表示解压缩
紫色表示需创建的文件夹
蓝色表示需创建的文件


2) 在 prefs.js 文件中添加下面这行:

pref("extensions.{616f2aa8-9674-4009-90de-94ce4ea9d29a}.description", "chrome://tournicoti/locale/tournicoti.properties"); 
 
注:其中蓝色的数字串是您从 install.rdf 复制并粘贴过来的扩展 ID 号 。
 
如果您使用伪 email 地址作为您扩展的 id,您可以去掉扩展 ID 号外围的中括号并修改为像下面红色部分所示的地址:
 
pref("extensions. This e-mail address is being protected from spam bots, you need JavaScript enabled to view it .description", "chrome://tournicoti/locale/tournicoti.properties");  

3) 在 tournicoti.properties 文件中添加下面这行:

extensions.{616f2aa8-9674-4009-90de-94ce4ea9d29a}.description = An extension that makes you dizzy.
 
或是
 
extensions. This e-mail address is being protected from spam bots, you need JavaScript enabled to view it .description= An extension that makes you dizzy.
 
 ã€€æŽ¥ç€æ‚¨å¯ä»¥å°†æ‰€æœ‰å†…容按原来的结构重新打包回去,这样就完成了对扩展描述的本地化工作!
 
 
          goofy
Last Updated ( Saturday, 31 May 2008 )
 
 
Top! Top!
'; ?>