以下引用自: http://www.uusam.com/uu/blog/article/269.htm

       我一直在尋找一個(gè)Ext中的I18N的解決方案,事實(shí)上我在官方并沒有找到。在Google搜索之后,發(fā)現(xiàn)Mr.Max 寫了一個(gè)Ext的插件解決了這個(gè)問題,他的文章地址是:http://elmasse.blogspot.com/2008/04/i18n-with-extjs-resource-bundle.html
     以下是翻譯:

引用內(nèi)容 引用內(nèi)容
上周我主要工作在Ext的I18處理上, 有一個(gè)在JSP捆綁資源的功能我沒有想到。所以我就實(shí)現(xiàn)了這個(gè)功能-可以簡(jiǎn)單的得到資源從頁面中,這個(gè)類的名字是Ext.i18n.ResourceBundle.主要的想法是建立一個(gè)對(duì)象并得到一個(gè)資源包的類,它意味著通過這個(gè)資源類,IE拿到資源的名稱和語言,然后試圖找一個(gè).properties文件。 如果這語言是es-ES, 它將試圖尋找這[bundle]_es-ES。properties文件。如果不存在就讀取[bundle].properties文件。

然后你就能用getMsg(key)方法,得到一個(gè)字符串通過這個(gè)key屬性。
這是整個(gè)代碼和一點(diǎn)例子,享受它吧:)

Bundle.js and Test.js可以在這里找到: Ext.forum
http://extjs.com/forum/showthread.php?t=32456

使用方法:
var bundle = new Ext.i18n.Bundle({bundle='Application'});
bundle.onReady(
alert('example'+ bundle.getMsg('key1'));
);

如果語言是es-ES,它將會(huì)讀取一個(gè) Application_es-ES.properties 文件,文件內(nèi)容像這樣:
key1 "Mensaje para la propiedad key1"


如果Application_es-ES.properties 文件不存在,它將讀取Application.properties文件:
#This is a simple comment
key1 "this is the message for key1"

類的構(gòu)造函數(shù)是Bundle(config),參數(shù)config的格式是: {bundle: , patch:}
bundle: properties文件的名字.
{bundle: 'mybundle'}
它將查找這樣的一個(gè)文件在:
http:/yourdomain/yourApp/mybundle_[language].properties.
所以如果你不想做I18n,但又要保證以后可以擴(kuò)展,至少建立一個(gè)mybundle.properties文件.


patch: (可選) 這個(gè)properties文件的地址.
{bundle: 'mybundle, path: 'resources'}
它將查找這個(gè)文件:
http:/yourdomain/yourApp/resources/mybundle_[language].properties.


Take into account that you need to write your application in the bundle.onReady() method in order to be able to access to your bundle.

你需要考慮到寫一個(gè)bundle。onReady方法來保證資源已經(jīng)加載完成后在使用。

注意:
這個(gè)資源已經(jīng)存儲(chǔ)到一個(gè) Ext.data.Store 對(duì)象緩存里面,不會(huì)重復(fù)讀取。

完整demo:
//Test for Bundle


Ext.onReady(function(){
    var bundle = new Ext.i18n.Bundle({bundle:'Application', path: 'resources'});
    bundle.onReady(function(){
        
        alert("culo"+bundle.getMsg('key1'));

    });
});