File name for java.util.ResourceBundle : ResourceBundle « I18N « Java Tutorial






java.util.ResourceBundle class enables you to choose and read the properties file specific to the user's locale and look up the values.

A ResourceBundle object has a base name. In order for a ResourceBundle object to pick up a properties file, the filename must be composed of the ResourceBundle base name, followed by an underscore, followed by the language code, and optionally followed by another underscore and the country code.

The format for the properties file name is as follows:

basename_languageCode_countryCode

For example, suppose the base name is MyResources and you define the following three locales:

US-en
      DE-de
      CN-zh

Then you would have these three properties files:

MyResources_en_US.properties
      MyResources_de_DE.properties
      MyResources_zh_CN.properties








13.4.ResourceBundle
13.4.1.File name for java.util.ResourceBundle
13.4.2.Load resources via a resources file
13.4.3.Reading Properties Files using ResourceBundle
13.4.4.Convert ResourceBundle to Properties
13.4.5.Convert ResourceBundle to Map
13.4.6.An Internationalized Swing Application
13.4.7.JOptionPane Resources
13.4.8.Using the JDK 6 ResourceBundle class
13.4.9.Displaying Calendar Names
13.4.10.Customizing Resource Bundle Loading
13.4.11.XML resource bundle
13.4.12.Get resource bundle for a certain locale
13.4.13.Java file based resource bundle
13.4.14.ResourceBundle: avoid a performance penalty by superfluous resource (and classes loaded by Class.forName) lookups on web server in applets.