Code Formats for Internationalized Strings
See Also
If you use the IDE's Internationalization dialog box or Internationalization
wizard to internationalize your strings, you can customize the formats
for those strings. You open the Internationalization wizard by choosing
Tools > Internationalization > Internationalization Wizard. You open
the Internationize dialog box by choosing
Tools > Internationalization > Internationalize.
You can choose from the following code formats:
- Use the identifier format when you want to cache the bundle in
a specific class. You can also use this format when you want to create a variable
that points to the resource bundle. You can then use the variable as a method
argument rather than the full resource bundle's name.
- Use the Utilities format when you want to have a single resource
bundle for a group of classes, such as all of the classes in a package. Use
this format if you want to use your own custom classes as resource bundles.
- Use java.util.ResourceBundle.getBundle if you want to use the standard
Java utility class.
- Use java.text.MessageFormat if you want to use strings that are
constructed dynamically at runtime. You can add arguments to specify the dynamically
added elements of the string.
- Use org.openide.util.NbBundle.getMessage or org.openide.util.NbBundle.getBundle
if you want to use the NetBeans APIs to build
modules for use by the IDE.
If none of these formats suits your purpose, you can enter your own code format.
Make sure that your format uses a correct argument structure.
- See Also
- Adding Arguments for Message Formats
- Inserting Internationalizated Strings Into Source Code
- About Resource Bundles
Legal Notices