Changeset 30810 for main


Ignore:
Timestamp:
2016-09-15T11:21:36+12:00 (8 years ago)
Author:
kjdon
Message:

when loading all the text strings for a particular prefix into a javascript array, it was previously just looking through the file for a specified language. But these keys may be outdated. and some required strings may be missing. Instead we get all the key names from the english file, then look them up in the specifried language. If not found it defaults back to giving the english version. this was we always get the correct keys, and there will always be a value for them

File:
1 edited

Legend:

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

    r30770 r30810  
    771771        for (String dictName : new String[] { "interface_" + interface_name, "interface_default", "interface_default2" })
    772772        {
    773             Dictionary dict = new Dictionary(dictName, lang);
     773          // get all the keys from the english dictionary as this is a complete set
     774            Dictionary dict = new Dictionary(dictName, "en");
    774775            Enumeration keys = dict.getKeys();
    775776            if (keys == null)
     
    786787                if (key.startsWith(prefixwithdot))
    787788                {
     789                  // get the language dependent value for the key. This will return the english if no value found for the given lang
    788790                    String value = getInterfaceText(interface_name, dictName, lang, key, null);
    789791
Note: See TracChangeset for help on using the changeset viewer.