Revision 4736

View differences:

trunk/libraries/libInternationalization/src/org/gvsig/i18n/package.html
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
6
<title>org.gvsig.i18n package</title>
7
</head>
8
<body>
9
<p>Provides classes which offer some methods to provide internationalization services
10
to other projects. Currently, it only consist on the Messages class.</p>
11
</body>
12
</html>
0 13

  
trunk/libraries/libInternationalization/src/org/gvsig/i18n/Messages.java
41 41
    
42 42
	private static Hashtable localeResources = new Hashtable(_INITIALSIZE, 2);; // contains the translations, indexed by key 
43 43
	private static Vector _preferredLocales = new Vector(); // contains the ordered list of prefered languages/locales (class Locale)
44
	private static Vector _availableLocales;
44
//	private static Vector _availableLocales;
45 45
	
46 46
	/**
47 47
	 * <p>Gets the localized message associated with the provided key.
......
97 97
	public static String getText(String key, boolean log) {
98 98
		if (key==null) return null;
99 99
		return (String) localeResources.get(key);
100
	}	
100
	}
101
	
102
	/**
103
	 * <p>Gets the localized message associated with the provided key.
104
	 * If the key is not in the dictionary, it returns null and the failure
105
	 * is only registered in the log if the param log is true.</p>
106
	 * 
107
	 * @param key         An String which identifies the translation that we want to get.
108
	 * @param callerName  A symbolic name given to the caller of this method, to
109
	 *                    show it in the log if the key was not found
110
	 * @param log         Determines whether log a key failure or not
111
	 * @return            an String with the message associated with the provided key,
112
	 *                    or null if the key is not in the dictionary.
113
	 */
114
	public static String getText(String key, String callerName, boolean log) {
115
		if (key==null) return null;
116
		return (String) localeResources.get(key);
117
	}
101 118

  
102 119
	/**
103 120
	 * <p>Adds an additional family of resource files containing some translations.

Also available in: Unified diff