本手册由zengl开源网的站长提供 首页:www.zengl.com Interface Localization  界面的本地化 The languages files must be placed inside the "editor/lang" directory of the project. Y...

本手册由zengl开源网的站长提供 首页:www.zengl.com

Interface Localization  界面的本地化

The languages files must be placed inside the "editor/lang" directory of the project. You can use the file "en.js" as the base file for your translations. The file names are based on the RFC 3066 standards (but in lowercase) and theISO 639-1. So, for example, a file for the Portuguese language should be called "pt.js".
语言文件必须放置在 项目的"editor/lang" 目录中。你可以使用"en.js"作为你的翻译语言的基础文件。语言文件的命名是基于 RFC 3066 标准(但是是小写)以及 ISO 639-1字符,例如,针对葡萄牙语的文件应该命名为"pt.js"。

Translation could also be localized for a specific country. In this case, for example, a Brazilian Portuguese translation file must be called "pt-br.js."
翻译语言也可以针对指定的国家,例如,巴西葡萄牙语的翻译文件必须命名为"pt-br.js" 。

The browser’s language auto detection system uses the first available language that best fits the client settings.
浏览器的语言自动检测系统会使用最符合客户端设置的第一个可用的语言。

For example, if a client computer is set to Brazilian Portuguese and there is no pt-br.js file available, the pt.js is used if available. If still not available, the default language is used (from the configuration file, by default English).
例如,如果客户端电脑设置的是 巴西葡萄牙语,但是没有 pt-br.js文件可用,那么就会使用pt.js文件,如果pt.js文件也没有,那么就使用配置文件中的默认语言,默认是英语。

When creating new language files, you need to add an entry for it in the "editor/_source/internals/fcklanguagemanager.js" file. Something like this:
当创建一个新的语言文件时,你需要在"editor/_source/internals/fcklanguagemanager.js"文件中添加一个入口,如下所示:

AvailableLanguages =
{
en : 'English',
pt : 'Portuguese'  //加了个葡萄牙语。
}

To test your language file, you could run the editor using the source scripts. Just open the "_samples/html/sample03.html" files.
要测试你的语言文件,你需要以原始代码方式运行编辑器(也就是用_source目录内的脚本),其实只需打开 "_samples/html/sample03.html"文件即可,该示例就是专门用于测试各种翻译语言的。

When you feel the translation is completed and the tests are done, you will need to "re-generate" the compressed JavaScript files of FCKeditor using the FCKpackager
当你觉得翻译已经完成,并且测试通过了,你就需要重新使用 FCKpackager软件来压缩编辑器的脚本文件。

File Encoding 文件编码

NOTE: An important thing is to save the files in the UTF-8 encoded text format. Otherwise, some strange characters could appear instead of any special characters used by different languages, like accented letters, symbols, etc.
注意:有个需要注意的地方就是在保存文件时,要使用 UTF-8的编码格式。否则,会出现乱码。

Publishing  发布

A ticket must be opened at our development web site for each new or updated language file contribution.
你可以在development web site 网站注册一个账号,然后就可以发布ticket(类似于帖子的东东),这样就可以将自己的语言文件发布出去了。

Before starting a new translation, please take a look at our web site and check if there is no translator assigned to your language. Of course you can also check if there are no translations made already.
在开始做一个翻译语言之前,可以到our web site 网站查看是否已经有人做了这种翻译,免得白忙活一趟,呵呵。
OK,本章结束,休息,休息一哈。

如果本文有翻译不周的地方,或有其他方面的评论,可以到下方发表评论。

上下篇

下一篇: FCKeditor手册结束语

上一篇: FCKeditor的服务端开发

相关文章

FCKeditor的调试

FCKeditor的服务端开发

FCKeditor脚本压缩

FCKeditor手册结束语

FCKeditor开发者向导

FCKeditor的样式设置