Changeset 33671 for main


Ignore:
Timestamp:
2019-11-14T14:12:44+13:00 (4 years ago)
Author:
kjdon
Message:

added a static getTextString method - currently this is in Action.java and Servicerack.java. And now I want it in LibraryServiet. Added a simple one here. At a later stage, merge these all into Dictionary so all places can use it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/Dictionary.java

    r32318 r33671  
    233233        }
    234234    }
     235
     236  public static String getTextString(String key, String lang, String dictionary_name, ClassLoader class_loader, String[] args)
     237  {
     238
     239      // we want to use the collection class loader in case there are coll specific files
     240      if (dictionary_name != null)
     241        {
     242          // just try the one specified dictionary
     243          Dictionary dict = new Dictionary(dictionary_name, lang, class_loader);
     244          String result = dict.get(key, args);
     245          if (result == null)
     246        { // not found
     247         
     248          logger.error("couldn't find key in dict, "+key);
     249          return "_" + key + "_";
     250          //return null;
     251        }
     252          return result;
     253        }
     254      return "_" + key + "_";
     255  }
     256
    235257}
Note: See TracChangeset for help on using the changeset viewer.