If a ResourceBundle
class for the specified Locale
does not exist, getBundle
tries to find the closest match. For example, if ButtonLabel_fr_CA_UNIX
is the desired class and the default Locale
is en_US
, getBundle
will look for classes in the following order:
ButtonLabel_fr_CA_UNIX ButtonLabel_fr_CA ButtonLabel_fr ButtonLabel_en_US ButtonLabel_en ButtonLabel
Note that getBundle
looks for classes based on the default Locale
before it selects the base class (ButtonLabel)
. If getBundle
fails to find a match in the preceding list of classes, it throws a MissingResourceException
. To avoid throwing this exception, you should always provide a base class with no suffixes.
http://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html