HQU supports the I18N internationalization model. The scaffolding tool creates a PropertyResourceBundle file for localization strings properties, plugin_name_i18n.properties in /ui_plugins/{plugin/etc.
Contents of the I18n Properties as Created
Upon creation plugin_name_i18n.properties contains two key-value pairs.
plugin_name.description=[new plugin] plugin_name
Congrats=Congratulations
The first line defines the link name for plugins attached to the portal, where:
-
plugin_name is the name you assigned to the plugin when running the scaffolding task.
-
new plugin is an arbitrary string that will be prefixed to plugin_name
The menu item the is created is:
new plugin plugin_name
The second line defines the string to present in Views for the text item whose key is Congrats.
Understanding How Plugin Views Obtain Localization Strings
A special variable in the .gsp rendered for an action allows it to obtain localized resource bundles from etc/myplugin_i18n.properties. The variable, a lower-case letter 'l', is of the type 'BundleMapFacade' which provides a map-like facade, allowing you to access resource bundle attributes like regular Map entries. For example, in a line from a .gsp, in either of these forms:
${l.Congrats}
$l['Congrats']
The variable l.Congrats points at etc/myplugin_i18n.properties:Congrats
For information about how a plugin controller can obtain localized resource bundles, see Obtaining Localized Strings.