Extending : Widget extension : Advanced topics : Adding NLS support to a widget
  
Adding NLS support to a widget
Eclipse already provides much convenience for NLS support. UNICOM® Digital Transformation Toolkit (UDTT™) follows the same way to enable a widget to support NLS. Many description and label fields support NLS.
To leverage the NLS support that is provided by Eclipse and UDTT, a technical developer must complete the following tasks:
Define Bundle-Localization path in MANIFEST.MF. Bundle-Localization entry defines which *.properties files are loaded at runtime. These entry defined name and the corresponding properties file is used to translate the plugin strings which start with the prefix "%". Below is a sample definition entry:
Bundle-Localization: plugin
Move translatable strings into *.properties files. When Bundle-Localization path has been defined, Eclipse will use [path]_[locale].properties file for specific locale. For example, if the path is ‘plugin', then Eclipse will use the plugin.properties file as the default locale, the plugin_zh.properties file to support Chinese locale, and the plugin_es.properties file to support Spanish locale. A technical developer must move translatable strings into specific properties file to support specific language.
Use %* strings for NLS support property or attribute. For example, the description attribute of an event tag supports NLS. So when defining the description, a technical developer must use %[description]; for example, <event name="onClick" description="%desc_event_onclick" />
A technical developer must also add description messages into different properties files. For example, in the following line can be added to the plugin.properties file:
desc_event_onclick = event triggered when the widget is clicked
For more information on how to enable NLS support, refer to the How to Internationalize your Eclipse Plug-In section in the Eclipse website.
Go up to
Advanced topics