- Timestamp:
- 2022-09-08T11:08:46+12:00 (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
r36508 r36592 257 257 258 258 // try the specified dictionary first 259 Dictionary dict = new Dictionary(dictionary_name, lang, my_loader); 260 String result = dict.get(key, args); 259 String result = Dictionary.createDictionaryAndGetString(dictionary_name, my_loader, key, lang, args); 261 260 if (result == null) { 262 261 // fall back to a general interface text search … … 300 299 // now we allow looking for files in the interface's resources folder 301 300 CustomClassLoader my_loader = new CustomClassLoader(XSLTUtil.class.getClassLoader(), GSFile.interfaceResourceDir(GlobalProperties.getGSDL3Home(), interface_name)); 302 Dictionary dict = new Dictionary("interface_" + interface_name, lang, my_loader); 303 304 String result = dict.get(key, args); 301 String result = Dictionary.createDictionaryAndGetString("interface_"+interface_name, my_loader, key, lang, args); 305 302 if (result == null) 306 303 { 307 304 //if not found, search a separate subdirectory named by the interface name. this is used for eg the flax interface. this could be replaced by new class loader option? 308 305 String sep_interface_dir = interface_name + File.separatorChar + lang + File.separatorChar + "interface"; 309 dict = new Dictionary(sep_interface_dir, lang); 310 result = dict.get(key, args); 306 result = Dictionary.createDictionaryAndGetString(sep_interface_dir, my_loader, key, lang, args); 311 307 if (result != null) 312 308 { … … 317 313 if (result == null && !interface_name.startsWith("default")) { 318 314 // not found, try the default interface 315 String dictionary_name; 319 316 if (interface_name.endsWith("2")) { // hack for interface_xxx2.properties 320 dict = new Dictionary("interface_default2", lang);317 dictionary_name = "interface_default2"; 321 318 } else { 322 dict = new Dictionary("interface_default", lang); 323 319 dictionary_name = "interface_default"; 324 320 } 325 result = dict.get(key, args);321 result = Dictionary.createDictionaryAndGetString(dictionary_name, my_loader, key, lang, args); 326 322 } 327 323 … … 409 405 410 406 CustomClassLoader class_loader = new CustomClassLoader(XSLTUtil.class.getClassLoader(), GSFile.collectionResourceDir(GSFile.siteHome(GlobalProperties.getGSDL3Home(), site_name), collection)); 411 Dictionary dict = new Dictionary("interface_custom", lang, class_loader); 412 String result = dict.get(key, args); 407 String result = Dictionary.createDictionaryAndGetString("interface_custom", class_loader, key, lang, args); 413 408 if (result != null) 414 409 { … … 437 432 public static String getGenericTextWithArgs(String dictionary_name, String lang, String key, String[] args) 438 433 { 439 Dictionary dict = new Dictionary(dictionary_name, lang); 440 String result = dict.get(key, args); 434 String result = Dictionary.createDictionaryAndGetString(dictionary_name, null, key, lang, args); 441 435 if (result == null) { 442 436 return "_"+dictionary_name+"_"+key+"_";
Note:
See TracChangeset
for help on using the changeset viewer.