Revision 42761 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.i18n/src/main/java/org/gvsig/i18n/Messages.java
Messages.java | ||
---|---|---|
100 | 100 |
private static Set resourceFamilies = new HashSet(); |
101 | 101 |
private static Set classLoaders = new HashSet(); |
102 | 102 |
|
103 |
private static List familyDescriptors = new ArrayList();
|
|
103 |
private static List<FamilyDescriptor> familyDescriptors = new ArrayList<>();
|
|
104 | 104 |
|
105 | 105 |
/* |
106 | 106 |
* The language considered the origin of translations, which will |
... | ... | |
356 | 356 |
* |
357 | 357 |
* @param family The family name (or base name) which is used to search |
358 | 358 |
* actual properties files. |
359 |
* @param dir The search path to locate the property files
|
|
359 |
* @param folder The search path to locate the property files
|
|
360 | 360 |
* @throws MalformedURLException |
361 | 361 |
* @see <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html">ResourceBundle</a> |
362 | 362 |
*/ |
363 |
public static void addResourceFamily(String family, File dir) throws MalformedURLException{
|
|
363 |
public static void addResourceFamily(String family, File folder) throws MalformedURLException{
|
|
364 | 364 |
// use our own classloader |
365 |
URL[] urls = new URL[1]; |
|
366 |
urls[0] = dir.toURL(); |
|
365 |
URL[] urls = new URL[] { folder.toURI().toURL() }; |
|
367 | 366 |
ClassLoader loader = new MessagesClassLoader(urls); |
368 |
addResourceFamily(family, loader, ""); |
|
367 |
for (FamilyDescriptor familyDescriptor : familyDescriptors) { |
|
368 |
if( familyDescriptor.callerName.equals(folder.getAbsolutePath()) && |
|
369 |
familyDescriptor.family.equals(family) ) { |
|
370 |
// Already added |
|
371 |
return; |
|
372 |
} |
|
373 |
} |
|
374 |
addResourceFamily(family, loader, folder.getAbsolutePath()); |
|
369 | 375 |
} |
370 | 376 |
|
371 | 377 |
|
Also available in: Unified diff