Changeset 38153 for main/trunk/greenstone3/src
- Timestamp:
- 2023-09-18T14:44:54+12:00 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
r38004 r38153 255 255 public static String getInterfaceText(String interface_name, String dictionary_name, String lang, String key, String args_str) 256 256 { 257 // now we allow looking for files in the interface's resources folder 258 CustomClassLoader my_loader = new CustomClassLoader(XSLTUtil.class.getClassLoader(), GSFile.interfaceResourceDir(GlobalProperties.getGSDL3Home(), interface_name)); 259 String[] args = null; 257 String i_name = interface_name; 258 if (i_name.endsWith("2")) { 259 i_name = i_name.substring(0, i_name.length()-1); 260 } 261 // now we allow looking for files in the interface's resources folder 262 CustomClassLoader my_loader = new CustomClassLoader(XSLTUtil.class.getClassLoader(), GSFile.interfaceResourceDir(GlobalProperties.getGSDL3Home(), i_name)); 263 264 String[] args = null; 260 265 if (args_str != null && !args_str.equals("")) 261 266 { … … 266 271 String result = Dictionary.createDictionaryAndGetString(dictionary_name, my_loader, key, lang, args); 267 272 if (result == null) { 273 268 274 // fall back to a general interface text search 269 275 return getInterfaceTextWithArgs(interface_name, lang, key, args); … … 305 311 { 306 312 // now we allow looking for files in the interface's resources folder 307 CustomClassLoader my_loader = new CustomClassLoader(XSLTUtil.class.getClassLoader(), GSFile.interfaceResourceDir(GlobalProperties.getGSDL3Home(), interface_name)); 313 String i_name = interface_name; 314 if (i_name.endsWith("2")) { 315 i_name = i_name.substring(0, i_name.length()-1); 316 } 317 CustomClassLoader my_loader = new CustomClassLoader(XSLTUtil.class.getClassLoader(), GSFile.interfaceResourceDir(GlobalProperties.getGSDL3Home(), i_name)); 308 318 String result = Dictionary.createDictionaryAndGetString("interface_"+interface_name, my_loader, key, lang, args); 309 319 if (result == null) 310 { 320 { 311 321 //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? 312 322 String sep_interface_dir = interface_name + File.separatorChar + lang + File.separatorChar + "interface"; … … 889 899 // The dictionaries to pull keys from 890 900 String[] dictionaries = new String[] { 891 "interface_" + interfaceName,892 901 "interface_default", 893 "interface_default2" 902 "interface_default2", 903 "interface_" + interfaceName 904 894 905 }; 895 906
Note:
See TracChangeset
for help on using the changeset viewer.