IntelliJ IDEA 2017.2 Help

Editing Resource Bundle

On this page:

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.

img

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 .properties file that is a part of a bundle, and at the lower edge of the editor, click Resource Bundle tab:
    bundleEditor1

Editing property keys and values

To edit property keys, follow these general steps

  1. Open for editing the desired *.properties file.
  2. 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

  1. Select property key in the left pane of the resource bundle editor.
  2. In the target locale frame, edit the value as required. The respective .properties file will change accordingly.
    bundleEditor

Tips and tricks

  • The properties missing values, or omitted in one of the .properties files are red-highlighted.
  • All escaped characters in the *.properties files 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 *.properties file as a corresponding escaped character in the format \uXXXX.

    For example, if the *.properties file 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' vs '\u00e3'). Upper case is used by default. To use lower case, set 'idea.native2ascii.lowercase' property in the bin/idea.properties file to true.

    Refer to the section Tuning IntelliJ IDEA for details.

Last modified: 29 November 2017

See Also