JFormDesigner provides easy-to-use and powerful localization/internationalization support:
- Externalize and internalize strings.
- Edit resource bundle strings.
- Create new locales.
- Delete locales.
- Switch locale used in Design view.
- In-place-editing strings of current locale.
- Auto-externalize strings.
- Choose existing strings.
- Updates resource keys when renaming components.
- Copies resource strings when copying components.
- Removes resource strings when deleting components.
- Localization preferences.
- Use .properties or .xml files.
- Fully integrated in undo/redo.
The locales combo box 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 , you change it in the current locale. Small flags in front of property values in the Properties view indicates that the string is localized (stored in a properties file).
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.
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 () 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.
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 () 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
java.util.ResourceBundle. E.g. if a message is not in locale
"de_AT" then it will be loaded from locale "de".
Delete a locale¶
To delete an existing locale, either select Form > Delete Locale from the main menu, Delete Locale () from the toobar or click the Delete Locale button in the Localize dialog. Select the locale to delete.
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 () 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.
You can also externalize and internalize properties in the Properties view.
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 () 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.
Choose existing strings¶
The flag button () 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.
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.