Changeset 10795
- Timestamp:
- 2005-10-31T12:26:01+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ant-install-branch/gsdl3/src/java/org/greenstone/core/Dictionary.java
r9973 r10795 44 44 import javax.swing.text.*; 45 45 import javax.swing.tree.*; 46 import org.greenstone.core.util.Utility;46 //import org.greenstone.core.util.Utility; 47 47 48 48 /** Extends the ResourceBundle class to allow for the automatic insertion of arguments.<BR> … … 57 57 * SString ::= String . ['"','#',...] -> ['\"','\#',...] <BR> 58 58 * <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> 60 62 * <BR> 61 63 * dictionary_<I>locale</I>.properties<BR> 62 64 * <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: 64 68 * <BR> 65 69 * dictionary_en_NZ.properties<BR> … … 87 91 this.locale = ((locale == null) ? Locale.getDefault() : locale); 88 92 this.dictionary = ResourceBundle.getBundle("dictionary", this.locale); 93 if (this.dictionary==null) { 94 System.err.println("dictionary is null"); 95 } 89 96 } 90 97 … … 113 120 114 121 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. 117 127 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle. 118 128 * @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. 120 132 */ 121 133 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")); 123 138 try { 124 139 String initial_raw = dictionary.getString(key); … … 269 284 private String text = null; 270 285 private String tooltip = null; 271 272 286 273 287 public ComponentUpdateTask(Component component, String text, String tooltip)
Note:
See TracChangeset
for help on using the changeset viewer.