dojo-webpack-loader icon indicating copy to clipboard operation
dojo-webpack-loader copied to clipboard

dojo/i18n plugin - doesn't resolve against locale before returning result?

Open RoystonS opened this issue 8 years ago • 1 comments

Not sure whether I'm missing something, but it looks like references to 'dojo/i18n!some_module' always return the root values for some_module rather than something related to the current locale.

I can see in the generated file for a root NLS file that it injects all of the specified languages (as, say, lang_fr, lang_en, variables etc.) but they don't appear to be used anywhere in the generated module.

(For more context, this is the code that generates those variables:

           module.inject.dependencies.push({
               dep: "./" + lang + "/" + path.basename(module.resourcePath, ".js"),
               name: "lang_" + lang.replace(/-/g, "_")
           });

Is this something that's meant to work at the moment, or is it still in progress?

Thanks!

RoystonS avatar Aug 24 '16 13:08 RoystonS

I found that the dojo-webpack-loader wasn't correctly loading my dojo/text modules (with the raw-loader) until I used this in my webpack config:

resolveLoader: { alias: { "dojo/text": 'raw-loader' } }

This aliases dojo/text directly instead of the dojo-webpack-loader to load these files. Maybe this is related to the problem you were having?

slimeygecko avatar Nov 08 '16 02:11 slimeygecko