Changeset 14397

Show
Ignore:
Timestamp:
03.09.2007 13:09:22 (12 years ago)
Author:
xiao
Message:

modify the method getInterfaceText so that if a interface text string is not found in the dir classes/, try a subdirectory named by the site name.

Files:
1 modified

Legend:

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

    r13270 r14397  
    33import java.util.Date; 
    44import java.util.Locale; 
     5import java.util.MissingResourceException; 
     6import java.io.File; 
    57import java.text.SimpleDateFormat; 
    68 
     
    9496    } 
    9597    Dictionary dict = new Dictionary("interface_"+interface_name, lang); 
    96         String result = dict.get(key, args); 
     98    String result = dict.get(key, args); 
     99    if (result == null) { // not found 
     100        //if not found, search a separate subdirectory named by the interface name 
     101        String sep_interface_dir = interface_name + File.separatorChar + lang + File.separatorChar + "interface";  
     102        dict = new Dictionary(sep_interface_dir, lang); 
     103        result = dict.get(key, args); 
     104        if(result != null) { 
     105            return result; 
     106        }    
     107     } 
    97108 
    98109    if (result == null && !interface_name.equals("default")) { // not found, try the default interface 
     
    102113         
    103114        if (result == null) { // not found 
    104             return "_"+key+"_"; 
     115                return "_"+key+"_"; 
    105116        } 
    106117        return result;