Closed SongChen closed 11 years ago
SongChen and Coderifous,
I have the same concern along those lines, so let's turn that into a question to see if we can get a response.
What is the easiest way to set the plugin so that it goes after the base locale only? I see one of the options is called "options.loadBase". This would call the full locale and country specific language passing the base locale file if this is set to false. However, it will call both if set to true.
How can we set a loadBaseOnly option in the code?
Any help is appreciated.
Similar to Artofbi, is there a way to just load the locale without the country? I'm loading languages offline and I only have xx-en.json. It's just annoying on the debugger that it's still trying to load xx-en-US.json, when in fact I'm very aware that it's non-existent ? Thanks...
The plugin tries to load everything that the language
setting implies might be available. If you don't ever want the plugin to look for the region-specific language packs, then just truncate the region specifier from the language setting. For example, reduce "en-US" to just "en".
The plugin does some basic default language detection/setting and, for better or worse, makes that available via $.defaultLanguage
. You should be able to avoid generating requests for the region-specific language packs by doing something like $(...).localize("foo", { language: $.defaultLanguage.substr(0,2) });