The complete knowledge base about ARender - How to install it and how to configure it as needed

Create custom localized labels

This guide will help you create custom localized labels.

Default custom localized resources path

ARender internationalization approach uses .properties files where localizable informations are stored in.

ARender allows you to customize localized labels from external custom resource files.

By default, ARender uses the following order to fetch custom localized resource files :

  • Configuration properties
  • <HOME_DIR>/ARenderCustomLabels/
  • <TOMCAT_DIR>/webapps/<ARENDER_HMI>/WEB-INF/classes/labels/

To go futher

Define the folder path containing the custom labels

To define the folder path where the custom labels are stored, you must edit the following property :
# ARender label configuration
# Define the folder path where the custom labels are stored
# Otherwise leave empty so that ARender can look in the <HOME_DIR>/ARenderCustomLabels/ or in the labels/ folder
# NB: Make sure the path ends with a file separator, the slash /

Create your own custom localized labels

Typical resource files are named as CustomLabels_{lang}.properties, which lang corresponds to locale code :

  • ar (Arabic)
  • de (German)
  • en (English)
  • es (Spanish)
  • fr (French)
  • he (Hebrew)
  • it (Italian)
  • ja (Japanese)
  • pl (Polish)
  • pt (Portuguese)
  • pt-BR (Brazilian Portuguese)
  • ru (Russian)
  • zh-CN (Simplified Chinese)
  • zh-TW (Traditional Chinese)

For each language or the one needed, store localizable informations in the form of case sensitive key-value pairs.

To provide a concrete example, suppose you need a custom label for a custom button in 3 differents language english, spanish and french :

These .properties files are to be placed whether in <HOME_DIR>/ARenderCustomLabels/ or in <TOMCAT_DIR>/webapps/<ARENDER_HMI>/WEB-INF/classes/labels/.
hello=Hello World
hello=Hola Mundo
hello=Bonjour le monde

To use this custom label, you will need to reference it with the tag customLabels#{label-key}.

<!-- Sample implementation of a Custom button -->
<bean id="customButton"
	<constructor-arg value="customButton"/>
	<property name="enabled" value="true" />
	<property name="imageResource">
			<property name="width" value="16" />
			<property name="height" value="16" />
			<property name="url" value="" />
    <!-- Your custom button label -->
	<property name="buttonTitle">
		<ref bean="customLabels#hello" />
	<property name="buttonHandler">
		<bean class="com.arondor.viewer.client.jsapi.toppanel.JSCallButtonHandler">
			<property name="jsCode">
					<!-- Custom JS action upon click/mouseDown/touch event -->