Revision 41044
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.i18n/src/main/java/org/gvsig/i18n/Messages.java | ||
---|---|---|
402 | 402 |
private static void addResourceFamily(Locale lang, Properties translations, |
403 | 403 |
String family, ClassLoader loader, String callerName) { |
404 | 404 |
Properties properties = new Properties(); |
405 |
String resource = family.replace('.', '/') + "_" + lang.toString()
|
|
406 |
+ ".properties";
|
|
405 |
String langCode = lang.toString();
|
|
406 |
String resource = family.replace('.', '/') + "_" + langCode + ".properties";
|
|
407 | 407 |
InputStream is = loader.getResourceAsStream(resource); |
408 |
if( is==null && langCode.contains("_") ) { |
|
409 |
try { |
|
410 |
langCode = langCode.split("_")[0]; |
|
411 |
resource = family.replace('.', '/') + "_" + langCode + ".properties"; |
|
412 |
is = loader.getResourceAsStream(resource); |
|
413 |
if( is==null ) { |
|
414 |
resource = family.replace('.', '/') + ".properties"; |
|
415 |
is = loader.getResourceAsStream(resource); |
|
416 |
} |
|
417 |
} catch(Exception ex) { |
|
418 |
// Do nothing, is are null and are handled later |
|
419 |
} |
|
420 |
} |
|
408 | 421 |
if (is != null) { |
409 | 422 |
try { |
410 | 423 |
properties.load(is); |
Also available in: Unified diff