Ignore:
Timestamp:
2022-09-08T11:08:46+12:00 (20 months ago)
Author:
kjdon
Message:

modified Dictionary, so that if a lang fragment starts with [PENDING], then don't use it. This is to allow the addition of old strings which will help the translators, but which are too out of date to display in the interface. OTher classes use of Dictionary modified so that they go through getTextString, or createDictionaryAndGetString, thereby benifitting from the pending stuff

File:
1 edited

Legend:

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

    r36508 r36592  
    257257
    258258        // 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);
    261260        if (result == null) {
    262261          // fall back to a general interface text search
     
    300299    // now we allow looking for files in the interface's resources folder
    301300    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);
    305302    if (result == null)
    306303      { 
    307304    //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?
    308305    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);
    311307    if (result != null)
    312308      {
     
    317313    if (result == null && !interface_name.startsWith("default")) {
    318314      // not found, try the default interface
     315      String dictionary_name;
    319316      if (interface_name.endsWith("2")) { // hack for interface_xxx2.properties
    320     dict = new Dictionary("interface_default2", lang);
     317    dictionary_name = "interface_default2";
    321318      } else {
    322     dict = new Dictionary("interface_default", lang);
    323    
     319    dictionary_name = "interface_default";
    324320      }
    325       result = dict.get(key, args);
     321      result = Dictionary.createDictionaryAndGetString(dictionary_name, my_loader, key, lang, args);
    326322    }
    327323       
     
    409405
    410406            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);
    413408            if (result != null)
    414409            {
     
    437432  public static String getGenericTextWithArgs(String dictionary_name, String lang, String key, String[] args)
    438433  {
    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);
    441435    if (result == null) {
    442436      return "_"+dictionary_name+"_"+key+"_";
Note: See TracChangeset for help on using the changeset viewer.