Code Formats for Internationalized Strings
See Also
When inserting internationalized strings, the IDE uses the default code format
specified in the Internationalization settings. To set an alternate code format
choose Tools > Options and click Advanced Options,
then in the left pane of the Options window expand the Editing node and select Internationalization. Then click the ellipsis (...)
in the I18n String Format combo box.
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 NetBeansTM 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