| Page 1 of 1 | [ 1 post ] |
|
I create a custom module,and a language file,then using YUI builder build these files,they have this structure:
build -----myModle ---------assets ---------lang --------------myModle_en.js ---------myModle.js myModle.js: Y.add("mymodle", function(Y) { ...... },"1.0.0" ,{lang:['en'], requires:['intl']});); myModle_en.js: YUI.add("lang/mymodle_en",function(a){a.Intl.add("mymodle","en",{OK:"Ok",CANCEL:"Cancel"});},"1.0.0"); the page: YUI({ filter: "raw", modules : { "mymodle" : { type : "js", fullpath : build/myModle/myModle.js?time="+ (new Date()).getTime() +"" }, lang : "en" }).use("mymodle", function (Y) {...}); in myModle.js, I use Y.Intl.get("mymodle").OK,it return undefined. why it can not get the resource bundle? If I add lang/mymodle_en to mymodle's requeres: requires:['intl', 'lang/mymodle_en '] and In YUI config, the modules add myModle_en.js: modules : { "mymodle" : { type : "js", fullpath : build/myModle/myModle.js }, "lang/mymodle_en" : { type : "js", fullpath : build/myModle/lang/mymodle_en.js }, } then it can get the resource I saw the console module, it's not these complicated. Is anything I forget to set? |
| Page 1 of 1 | [ 1 post ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group