Changeset 9423


Ignore:
Timestamp:
2005-03-15T13:49:07+13:00 (19 years ago)
Author:
kjdon
Message:

modified getTextSTring: if no dictionary is specified, now tries a collection specific one called collection.properties, located in teh resources directory of the collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/ServiceRack.java

    r9279 r9423  
    338338   
    339339    /** getTextString - retrieves a language specific text string for the given
    340 key and locale, from the specified resource_bundle
     340key and locale, from the specified resource_bundle (dictionary)
    341341    */
    342342    protected String getTextString(String key, String lang, String dictionary, String[] args) {
    343343
    344     //String class_name = this.getClass().getName();
    345     //class_name = class_name.substring(class_name.lastIndexOf('.')+1);
    346344    if (dictionary != null) {
    347345        // just try the one specified dictionary
     
    354352    }
    355353
    356     // else we try class names for dictionary names
     354    // If no dictionary was specified, we try collection specific one, then
     355    // dictionaries based on the class names
     356   
     357    // first we try a collection properties file
     358    Dictionary dict = new Dictionary("collection", lang, new CollectionClassLoader(this.site_home, this.cluster_name));
     359    String result = dict.get(key, args);
     360    if (result != null) {
     361        return result;
     362    }
     363   
     364    // then we try class names for dictionary names
    357365    String class_name = this.getClass().getName();
    358366    class_name = class_name.substring(class_name.lastIndexOf('.')+1);
    359     Dictionary dict = new Dictionary(class_name, lang);
    360     String result = dict.get(key, args);
     367    dict = new Dictionary(class_name, lang);
     368    result = dict.get(key, args);
    361369    if (result != null) {
    362370        return result;
     
    372380        break;
    373381        }
    374         dict = new Dictionary(class_name, lang);
     382        dict = new Dictionary(class_name, lang, new CollectionClassLoader(this.site_home, this.cluster_name));
    375383        result = dict.get(key, args);
    376384        c = c.getSuperclass();
Note: See TracChangeset for help on using the changeset viewer.