Open GoogleCodeExporter opened 8 years ago
I implemented this jquery plugin but are not exactly sure about the intent of
the code block below.
In my case, I don't specify a language. So the first call successfully loads
and parse my properties file. Then the code tries to load _en.properties and I
get a 404 and then continues to try and load _en-US.properties and I get a 404.
It does this because a few lines above the browser supplied the language as
en-US. This is annoying since my server logs get filled up with 404's and the
javascript console display these errors too.
I would like the plugin to quit loading after it successfully loads my
properties file.
Maybe an addition of a setting to tell the plugin to not use the browser
language will solve this problem. Then the language length will be smaller than
2 hence the 2 last if statements won't execute.
for(i=0; i<files.length; i++) {
// 1. load base (eg, Messages.properties)
loadAndParseFile(settings.path + files[i] + '.properties', settings);
// 2. with language code (eg, Messages_pt.properties)
if(settings.language.length >= 2) {
loadAndParseFile(settings.path + files[i] + '_' + settings.language.substring(0, 2) +'.properties',settings);
}
// 3. with language code and country code (eg, Messages_pt_PT.properties)
if(settings.language.length >= 5) {
loadAndParseFile(settings.path + files[i] + '_' + settings.language.substring(0, 5) +'.properties',settings);
}
}
Original comment by Lind...@gmail.com
on 23 Oct 2013 at 6:52
Can u please explain how to use this For loop for selecting a particular locale
since same error also comes for me.
Original comment by rishic1...@gmail.com
on 3 Apr 2014 at 6:34
Original issue reported on code.google.com by
vinyoliv...@gmail.com
on 19 Mar 2013 at 12:54