Changeset 6537


Ignore:
Timestamp:
2004-01-16T15:55:50+13:00 (20 years ago)
Author:
jmt12
Message:

Modified so they use the new language file and refresh properly

Location:
trunk/gli/src/org/greenstone/gatherer/msm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/ElementWrapper.java

    r6142 r6537  
    230230
    231231    public String toString() {
     232    return getNamespace() + MSMUtils.NS_SEP + getIdentity();
     233    /*
    232234    String element_name = getName();
    233235    String element_identifier = getIdentity();
     
    247249    //    return element_name + " (" + element_identifier + ")";
    248250    //}
     251    */
    249252    }
    250253}
  • trunk/gli/src/org/greenstone/gatherer/msm/MSMUtils.java

    r5785 r6537  
    314314    static final public Element getAttributeNodeNamed(Node element, String name) {
    315315    Element attribute = null;
    316     String language_code = Locale.getDefault().getLanguage();
     316    String language_code = Gatherer.config.getLanguage();
    317317    for(Node n = element.getFirstChild(); n != null; n = n.getNextSibling()) {
    318318        if(n.getNodeName().equals("Attribute")) {
     
    382382        comment = StaticStrings.SPACE_CHARACTER + comment;
    383383    }
    384     String description = definition + comment;
    385     return Utility.stripNL(description.trim());
     384    //String description = definition + comment;
     385    return definition + comment; //Utility.stripNL(description.trim());
    386386    }
    387387
     
    495495    String identifier = null;
    496496    // Determine locale code.
    497     String language_code = Locale.getDefault().getLanguage();
     497    String language_code = Gatherer.config.getLanguage();
    498498    // Get the 'identifier' Element with the correct locale
    499499    for(Node node = element.getFirstChild(); node != null;
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataSet.java

    r5785 r6537  
    6262    /** The list of metadata elements which are, of course, children of the root node. */
    6363    private NodeList elements = null;
     64
     65    private String current_language_code;
    6466    /** The description of this metadata set. Cached as it takes more computation time. */
    6567    private String description = null;
     
    434436     */
    435437    public String getName() {
     438    if(current_language_code != null && !Gatherer.config.getLanguage().equals(current_language_code)) {
     439        name = null;
     440    }
    436441    if(name == null) {
    437442        // Determine the code.
    438         String language_code = Gatherer.dictionary.getLanguage();
     443        current_language_code = Gatherer.config.getLanguage();
    439444        // Recover all Name elements
    440445        NodeList names = document.getElementsByTagName("Name");
     
    444449        Element pos_name = (Element) names.item(i);
    445450        String pos_name_code = pos_name.getAttribute("language");
    446         if(pos_name_code.equalsIgnoreCase(language_code)) {
     451        if(pos_name_code.equalsIgnoreCase(current_language_code)) {
    447452            name = MSMUtils.getValue(pos_name);
    448453            found = true;
     
    458463        }
    459464        names = null;
    460         language_code = null;
    461                 // Failing all that set an error message
     465        // Failing all that set an error message
    462466        if(name == null) {
    463467        name = Dictionary.get("MSM.No_Name");
Note: See TracChangeset for help on using the changeset viewer.