Changeset 29556 for main/trunk
- Timestamp:
- 2014-12-08T14:40:17+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java
r29092 r29556 7 7 import org.apache.log4j.Logger; 8 8 import org.greenstone.gsdl3.core.ModuleInterface; 9 import org.greenstone.gsdl3.util.Dictionary; 9 10 import org.greenstone.gsdl3.util.GSConstants; 10 11 import org.greenstone.gsdl3.util.GSParams; … … 314 315 return format_elem; 315 316 } 317 318 protected String getTextString(String key, String lang, String dictionary, String[] args) 319 { 320 logger.error("lang = "+lang); 321 if (dictionary != null) 322 { 323 // just try the one specified dictionary 324 Dictionary dict = new Dictionary(dictionary, lang); 325 String result = dict.get(key, args); 326 if (result == null) 327 { // not found 328 return "_" + key + "_"; 329 } 330 return result; 331 } 332 333 // otherwise we try class names for dictionary names 334 String class_name = this.getClass().getName(); 335 class_name = class_name.substring(class_name.lastIndexOf('.') + 1); 336 Dictionary dict = new Dictionary(class_name, lang); 337 String result = dict.get(key, args); 338 if (result != null) 339 { 340 return result; 341 } 342 343 // we have to try super classes 344 Class c = this.getClass().getSuperclass(); 345 while (result == null && c != null) 346 { 347 class_name = c.getName(); 348 class_name = class_name.substring(class_name.lastIndexOf('.') + 1); 349 if (class_name.equals("ServiceRack")) 350 { 351 // this is as far as we go 352 break; 353 } 354 dict = new Dictionary(class_name, lang); 355 result = dict.get(key, args); 356 c = c.getSuperclass(); 357 } 358 if (result == null) 359 { 360 return "_" + key + "_"; 361 } 362 return result; 363 364 } 365 316 366 }
Note:
See TracChangeset
for help on using the changeset viewer.