IntelliJ IDEA 13.1 Web Help

The GUI Designer extends I18N Support to the GUI forms, and enables you to find components that contain hard-coded strings and transfer these strings to properties files. Having produced the various locales, you can change them at design time and preview how the localized forms will look like.

In this section, you can find general recommendations for applying i18n support to GUI forms:

General localization procedure

To localize your gui forms, perform the following major steps
  1. Make sure that Hard-Coded Strings inspection is activated. Refer to the section Recognizing Hard-Coded String Literals for details. If the inspection is activated, the appropriate tool tips for components display in the UI Designer tool window, and quick fix i18nize property<name> is displayed in the Form Workspace and UI Designer tool window.
  2. Create properties files for each locale you want to provide for the GUI, and a default properties file without a postfix.

    For example, for a dialog developed in English and localized to German and French, you might create the following properties files:

    1. Subscription.properties
    2. Subscription_de.properties
    3. Subscription_fr.properties
  3. Go through the form, and select each component that contains hard-coded strings. Click the quick fix icon, or press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1 to show the list of available intention actions, and select i18nize property <name>, as shown on the following image:

    img

  4. In the I18nize Hard Coded String Literal dialog box, extract hard-coded string literals to the specified properties files. Refer to the section Extracting Hard-Coded String Literals for details.
  5. Edit the extracted strings in the resource bundle. Refer to the section Editing Resource Bundle for details.

    Note

    See samples in the section Using Resource Bundles for Components.

Suppressing i18nize hard-coded string quick fix

To suppress i18nize quick fix
  1. Select a component that contains hard-coded text property.
  2. Click the quick fix icon, or press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1 to show the list of available intention actions.
  3. Hover the mouse cursor over the i18nize property <name> quick fix, and click the right arrow icon img (or press right arrow key) to reveal the submenu, as shown on the following image:

    img

  4. Click the option Suppress for component or Suppress for all components. The list suppressed inspections appears in the GUI Designer tool window:

    img

Tip

To cancel suppression, select the desired inspection under the Suppressed Inspections node, and press DeleteDeleteDeleteDeleteDelete or Ctrl+DDeleteDeleteDeleteDeleteDelete or BackspaceDeleteDelete or Backspace key.

Changing design-time locale

To change locale at design time
  1. With the GUI Designer tab having the focus, click the Change Local combo box img on the main toolbar.
  2. Select the desired locale from the drop-down list.

See Also

Reference:

Web Resources: