Resource bundles
A resource bundle is a set of properties files with the same base name and a language-specific suffix. For example, if you create file_en.properties and file_de.properties, IntelliJ IDEA will recognize and combine them into a resource bundle.
IntelliJ IDEA marks resource bundles with the icon .
Create a new resource bundle
In the Project tool window, select the directory where the new resource bundle should be created.
On the File menu, point to New and click Resource Bundle, or press Alt+Insert and click Resource Bundle.
In the dialog that opens, do the following:
Specify the base name of the resource bundle.
If necessary, select the checkbox Use XML-based properties files.
Add the required locales. To do that, click and type the comma-separated suffixes of the required locales.
Click OK when ready.
The new node Resource Bundle '<base_name>' appears in the Project tool window:
By default, the bundle contains properties files for all specified locales. You can dissociate it and show only the properties files, without the bundle.
Dissociate a resource bundle
Right-click the resource bundle you want to dissociate.
From the context menu, click Dissociate Resource Bundle <base_name>.
Combine several properties files into a resource bundle
Select the properties files to be combined.
Right-click the selection.
From the context menu, click Combine to Resource Bundle.
Specify the base name of the resource bundle.
Editing resource bundles
Once you create several properties files with the same name, differing by locale suffix, IntelliJ IDEA automatically recognizes them and groups them in the Project view into a resource bundle.
IntelliJ IDEA includes a Resource Bundle editor for convenient editing of localizable strings in properties files.
To open the Resource Bundle editor, 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 a properties file that is a part of a bundle and click the Resource Bundle tab at the bottom of the editor:
Edit property keys
Open a properties file.
Add, change, or delete keys as required. The changes are reflected in the Resource Bundle editor.
Use the Resource Bundle editor to change property values, which will ensure that you edit the entire set of property files simultaneously. IntelliJ IDEA creates respective records in each file of the bundle.
Edit property values
Select the property key in the left pane of the resource bundle editor.
In the target locale frame, edit the value as required. The respective properties file is updated accordingly.
When editing a resource bundle, keep the following in mind:
Properties with no values or that are omitted in one of the properties files are highlighted in red.
To convert between escape sequences (for example,
\u00df
) and unicode literals (corresponding national characters, such asß
) in properties files and in the Resource Bundle editor, select the Transparent native-to-ascii conversion checkbox on the File Encoding page of the Settings/Preferences dialog. For more information, see Encoding.It is possible to encode non-ASCII symbols using both uppercase and lowercase hex sequences (for example,
\u00E3
and\u00e3
). By default, only uppercase sequences are enabled. To use lowercase hex sequences, set theidea.native2ascii.lowercase
property in the idea.properties file totrue
.For more information, see Platform properties.