| Page 1 of 1 | [ 6 posts ] |
Francesco PongiluppiYUI Contributor
|
This is my situation:
- a custom YUI_config in the page that defines a group (among other things) that will be served through Apache (no combo handler), which uses the configFn to adjust the path that will be used to load the .js file (mygroup-mymodule-1.4 turns into mymodule/1.4/mymodule-min.js). - a module like this: Code: YUI.add('mygroup-mymodule-1.4', function(Y) { var strings = Y.Intl.get('mygroup-mymodule-1.4'); Y.myTranslatedFunction = function() { return strings.test } }, '1.4.0', {"requires": ["collection", "node", "intl"], "lang": ['it', 'en']}); - a page with inlined translations about a custom module: Code: YUI.add("lang/mygroup-mymodule-1.4", function(Y) { Y.Intl.add("mygroup-mymodule-1.4", '', { 'test': 'stringa di test' }); }, '1.4', {'requires': ['intl']}); YUI.add("lang/mygroup-mymodule-1.4_en", function(Y) { Y.Intl.add("mygroup-mymodule-1.4_en", '', { 'test': 'test string' }); }, '1.4', {'requires': ['intl']}); - lastly, a YUI().use: Code: YUI().use("mygroup-mymodule-1.4", function(Y) { Y.log('Sandbox 0'); Y.log(Y.myTranslatedFunction()); }); YUI().use("mygroup-mymodule-1.4", function(Y) { Y.log('Sandbox 1'); Y.log(Y.myTranslatedFunction()); }); YUI().use("node", "event", "mygroup-mymodule-1.4", function(Y) { Y.one("#test").on('click', function(e) { alert(Y.myTranslatedFunction()); }); }); Result is: Code: Sandbox 0 undefined Sandbox 1 undefined Clicking on the #test element produces an alert with "undefined". Oddly enough, when tested through the console, and only there, I get my translated text. Code: YUI().use("mygroup-mymodule-1.4", function(Y) { Y.log(Y.myTranslatedFunction()); }); Putting a log in the definition of the language modules reveals that they are pulled in (executed) only in this last case. I really can't see what's wrong here. |
|
What version of YUI are you using for this? I "think" I fixed this issue in 3.5.0..
|
Francesco PongiluppiYUI Contributor
|
Sorry, I forgot this key piece of info!
I'm facing this *after* upgrading from 3.4.1 to 3.5.0; I thought this could be related to #2531451 myself too, but I simply can't go through all the Loader code! |
|
Can you put together a repro case that I case test against so I can debug it? Open a ticket and attach the test case so I can get to the root of the issue.
|
Francesco PongiluppiYUI Contributor
|
I opened this ticket and put the test case.
#2532268 There will be chances that this fix will eventually land in 3.5.1? We need to plan ahead our transition to 3.5.x. Thank you! |
|
3.5.1's code freeze is already over. But if I can get it in today it will make it into 3.6.0PR1
|
| Page 1 of 1 | [ 6 posts ] |
| 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