Editing Resource Bundle
On this page:
- Resource bundle editor basics
- Invoking properties editor for a resource bundle
- Editing property keys and values
- Tips and tricks
Resource bundle editor basics
Once you create several
.properties files with the same name, differing by locale suffix, IntelliJ IDEA automatically recognizes them and groups in the Project view into a Resource Bundle.
Invoking properties editor for a resource bundle
To invoke properties editor for a resource bundle, do one of the following:
- In the Project tool window, right-click a resource bundle and choose Jump to Source.
- Select a resource bundle in the Project tool window, and press F4.
- Open for editing a
.propertiesfile that is a part of a bundle, and at the lower edge of the editor, click Resource Bundle tab:
Editing property keys and values
To edit property keys, follow these general steps
- Open for editing the desired
- Add, change, or delete keys as required. The changes are reflected in the Resource Bundle editor.
For changing values, use the resource bundle editor that enables you to edit an entire set of property files at a time. IntelliJ IDEA takes care of creating respective records in each file of the bundle.
To edit a property value
- Select property key in the left pane of the resource bundle editor.
- In the target locale frame, edit the value as required. The respective
.propertiesfile will change accordingly.
Tips and tricks
- The properties missing values, or omitted in one of the
.propertiesfiles are red-highlighted.
- All escaped characters in the
*.propertiesfiles in the format
\uXXXX, are displayed in the resource bundle editor as un-escaped unicode literals.
Vice versa, if a non-ASCII character is entered in the resource bundle editor, it is reflected in the underlying
*.propertiesfile as a corresponding escaped character in the format
For example, if the
*.propertiesfile contains a property value
Was ich nicht wei\u00df, macht mich nicht hei\u00df
then the resource bundle editor will show
Was ich nicht weiß, macht mich nicht heiß
Resource bundle editor itself does not perform any conversion. To have escape sequences properly resolved in properties files, select the check box Transparent native-to-ascii conversion in the File Encoding page of the Settings/Preferences dialog.
- It is possible to encode non-ascii symbols using both upper- and lower-case hex symbols (e.g.
'\u00e3'). Upper case is used by default. To use lower case, set 'idea.native2ascii.lowercase' property in the
bin/idea.propertiesfile to true.
Refer to the section Tuning IntelliJ IDEA for details.