Search |
||
I18n How-to: ResourceBundle namingPosted by joconner on April 23, 2004 at 4:46 PM PDT
Two types of ResourceBundles are provided in the Java platform:
Starting were we left off, let's assume we have text strings in a bundle named Once you've loaded the bundle, you can retrieve the localizable text with res.getString("SOME_KEY"). However, how do you create a localized file, and how do you retrieve that bundle?
Create a localized bundle by translating all resource text and placing it in a separate resource bundle. If your original bundle is named GreetingResource.properties, your new bundle should be named GreetingResource_
The first two lowercase letters of the
When you load bundles, the JRE will search for appropriate bundle for your locale even if you do not specify a locale in the method. Be careful that you do not include the locale designation within the bundle name argument. For example,
If you want to specify a locale in the method, you must provide the locale as a second argument: In brief,
»
Related Topics >>
Java Desktop Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|