Create the following file in a folder:
java code:
import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;
public class PropertiesDemo
{
public static void main(String args[])
{
Locale[] supportedLocales = { Locale.FRANCE, Locale.GERMAN, Locale.ENGLISH };
ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle_de", supportedLocales[0]);
//ResourceBundle
labels = ResourceBundle.getBundle("LabelsBundle",
supportedLocales[1]);
Enumeration bundleKeys = labels.getKeys();
while (bundleKeys.hasMoreElements())
{
String key = (String)bundleKeys.nextElement();
String value = labels.getString(key);
System.out.println("key = " + key + ", " + "value = " + value);
}
}
}