To create a default resource bundle:
MyResources, that extends class java.util.ListResourceBundle.getContents method in the following way:
public Object[][] getContents() {
return contents;
}
static final Object[][] contents = {
};
}
static final Object[][] contents = {
// LOCALIZE THIS
{"CompanyName", "AnyCo Corporation"},
{"SiteName", "HR Application"},
{"FilterButton", "Filter"},
{"UpdateButton", "Update"},
// END OF MATERIAL TO LOCALIZE
};
The complete resource bundle class should look similar to that shown in the following code example.
Creating a Resource Bundle Class
public class MyResources extends ListResourceBundle {
public MyResources() {
super();
}
protected Object[][] getContents() {
return contents;
}
static final Object[][] contents = {
// LOCALIZE THIS
{"CompanyName", "AnyCo Corporation"},
{"SiteName", "HR Application"},
{"FilterButton", "Filter"},
{"UpdateButton", "Update this Record"},
// END OF MATERIAL TO LOCALIZE
};
}
To globalize your application, you must create the locale-specific versions of the resource bundle for the different locales you are supporting, containing text for the items in each language.