Provides localized text strings to GUI elements. This class hides most of the fiddly bits associated with {@linkplain Locale} and {@linkplain ResourceBundle} from other gt-swing classes.You do not create instances of this class, it is basically just a wrapper around static data. Text strings are stored in properties files as per standard Java internationalization. All files are located in the {@code org/geotools/swing/locale} directory of the swing module.
An application wishing to display GUI elements in a non-default locale must call either {@linkplain #setLocale(Locale)} or {@linkplain #setLocale(List)} before constructing any GUIelements which display localized text. At present, this class does not support switching locales for components that have already been constructed.
Clients retrieve text strings by specifying the base name of the relevant properties file and a key as shown here:
String localizedText = LocaleUtils.getValue("CursorTool", "ZoomInTool");
Adding support for a new language simply involves adding the new locale to all or some of the properties files. If the locale is only provided for some files, it will be recorded by as partially supported and used where available.
You can set a single working locale with {@linkplain #setLocale(Locale)}. If the specified locale is only partially supported, the {@linkplain #getValue(String,String)} method will fallback to the default {@linkplain Locale#ROOT} when retrieving text strings lacking this locale.Alternatively, you can specify a list of locales in order of preference using the {@linkplain #setLocale(List)} method.
If the {@code setLocale} method is not called, the locale defaults to{@linkplain Locale#ROOT} (which is English language in the properties files distributedwith GeoTools).
@author Michael Bedward
@since 8.0
@source $URL$
@version $Id$