Changeset 10795 for branches


Ignore:
Timestamp:
2005-10-31T12:26:01+13:00 (18 years ago)
Author:
chi
Message:

The latest development of GAI when Chi leave on 31/10/2005.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/core/Dictionary.java

    r9973 r10795  
    4444import javax.swing.text.*;
    4545import javax.swing.tree.*;
    46 import org.greenstone.core.util.Utility;
     46//import org.greenstone.core.util.Utility;
    4747
    4848/** Extends the ResourceBundle class to allow for the automatic insertion of arguments.<BR>
     
    5757 * SString  ::= String . ['"','#',...] -> ['\"','\#',...] <BR>
    5858 * <BR>
    59  * In order to add a new dictionary Locale, simply copy the existing dictionary.properties files, replace the values (Strings after the ':') with the new language specific ones being careful to maintain formatting and Gatherer placed arguments, then save the new dictionary as: <br>
     59 * In order to add a new dictionary Locale, simply copy the existing dictionary.properties files,
     60 * replace the values (Strings after the ':') with the new language specific ones being careful to
     61 * maintain formatting and Gatherer placed arguments, then save the new dictionary as: <br>
    6062 * <BR>
    6163 * dictionary_<I>locale</I>.properties<BR>
    6264 * <BR>
    63  * where locale is made of two two-letter codes seperated by an underscore. The first code is in lower-case and defines the language. The second is in upper-case and defines the country. For example the default dictionary could also correctly be called:
     65 * where locale is made of two two-letter codes seperated by an underscore. The first code is in
     66 * lower-case and defines the language. The second is in upper-case and defines the country. For example
     67 * the default dictionary could also correctly be called:
    6468 * <BR>
    6569 * dictionary_en_NZ.properties<BR>
     
    8791    this.locale = ((locale == null) ? Locale.getDefault() : locale);
    8892    this.dictionary = ResourceBundle.getBundle("dictionary", this.locale);
     93    if (this.dictionary==null) {
     94        System.err.println("dictionary is null");
     95    }
    8996    }
    9097
     
    113120
    114121
    115     /** Used to retrieve a property value from the Locale specific ResourceBundle, based upon the key and arguments supplied. If the key cannot be found or if some other part of the call fails a default (English) error message is returned. <BR>
    116      * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned.
     122    /**Used to retrieve a property value from the Locale specific ResourceBundle, based upon
     123     * the key and arguments supplied. If the key cannot be found or if some other part of the
     124     * call fails a default (English) error message is returned. <BR>
     125     * Here the get recieves a second argument which is an array of Strings used to populate
     126     * argument fields, denoted {<I>n</I>}, within the value String returned.
    117127     * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    118128     * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.
    119      * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
     129     * @return A <strong>String</strong> which has been referenced by the key String and that either contains
     130     * no argument fields, or has had the argument fields automatiically populated with formatting Strings
     131     * of with argument String provided in the get call.
    120132     */
    121133    static public String get(String key, String[] args)
    122     {
     134
     135    {
     136    //System.err.println("*** Dictionary get key:" +key);
     137    //System.err.println("**** Locale:"+ dictionary.getBundle("dictionary"));
    123138    try {
    124139        String initial_raw = dictionary.getString(key);
     
    269284    private String text = null;
    270285    private String tooltip = null;
    271 
    272286
    273287    public ComponentUpdateTask(Component component, String text, String tooltip)
Note: See TracChangeset for help on using the changeset viewer.