Documentation

Localization

JFormDesigner provides easy-to-use and powerful localization/internationalization support:

The locales combo box 1 in the toolbar allows you to select the locale used in the Design, Structure and Properties views. If you in-place-edit a localized string in the Design view 2, you change it in the current locale. Small flags 3 in front of property values in the Properties view indicates that the string is localized (stored in a properties file).

Localized Main Window

Create a new localized form

When creating a new form, you can specify that JFormDesigner should put all strings into a resource bundle (.properties file). In the New Form dialog select the Store strings in resource bundle check box, specify a resource bundle name and a prefix for generated keys. If Auto-externalize strings is selected, then JFormDesigner automatically puts all new strings into the properties file (auto-externalize). E.g. when you add a JLabel to the form and change the "text" and "toolTipText" properties, both strings will be put into the properties file.

To localize existing forms use Externalize Strings.

New localized form

Edit localization settings and resource bundle strings

To edit localization settings and resource bundle strings, select Form > Localize from the main menu or click the Localize button (Localize) in the toolbar. Here you can create or delete locales and edit strings. The light gray color used to draw the string "Name:" in the table column "German" indicates that the string is inherited from a parent locale.

Localize Dialog

The Resource bundle name field is used to locate the properties files within the Source Folders of the current Project. Use the Browse button to choose a resource bundle (.properties file).

In the Prefix for generated keys field you can specify a prefix for generated resource bundle keys. The format for generated keys is "<prefix>.<componentName>.<propertyName>". You can change the separator ('.') in the Localization preferences.

If the Auto-externalize strings check box is selected, then JFormDesigner automatically puts all new strings into the properties file. E.g. when you add a JLabel to the form and change the "text" and "toolTipText" properties, both strings will be put into the properties file. You can exclude properties from externalization in the Localization preferences.

Create new locale

To create a new locale, either select Form > New Locale from the main menu, New Locale (New Locale) from the toobar or click the New Locale button in the Localize dialog. Select a language and an optional country. You can copy strings from an existing locale into the new locale, but JFormDesigner fully supports inheritance in the same way as specified by java.util.ResourceBundle. E.g. if a message is not in locale "de_AT" then it will be loaded from locale "de".

New Locale Dialog

Delete a locale

To delete an existing locale, either select Form > Delete Locale from the main menu, Delete Locale (Delete Locale) from the toobar or click the Delete Locale button in the Localize dialog. Select the locale to delete.

Delete Locale

Externalize strings

Externalizing allows you to move strings from a .jfd file to a .properties file. If you want localize existing forms, start here.

Select Form > Externalize Strings from the main menu or Externalize Strings (Externalize Strings) from the toolbar, specify the resource bundle name, the prefix for generated keys and select/deselect the strings to externalize. You can exclude properties from externalization in the Localization preferences.

Externalize Dialog

You can also externalize and internalize properties in the Properties view.

Properties view: localize property value

Internalize strings

Internalizing allows you to move strings from a .properties file to a .jfd file.

Select Form > Internalize Strings from the main menu or Internalize Strings (Internalize Strings) from the toolbar, specify the locale to internalize from and select/deselect the strings to internalize. If you internalize all strings, JFormDesigner asks you whether you want to disable localization for the form.

Internalize Dialog

Choose existing strings

The flag button (Choose Key) in the Properties view, which is only available for localized forms and string properties, allows you to choose existing strings from the resource bundle of the form.

String Property Editor

In the Choose Key dialog you can search for keys and/or values. Then select a key in the table and press OK to use its value in the form.

Choose Key