You can use the IBM MobileFirst Platform Foundation framework to enable the translation of applications into other languages.
Items that can be translated are:
The platform can automatically translate application strings according to a designated file.
The default workspace encoding in Eclipse is Cp1252.
Before you create the MobileFirst project and start the translation work, you must change the default encoding of the Eclipse workspace.
In Eclipse, navigate to Window > Preferences > General > Workspace, and change the encoding to
Enabling translation of application strings
You can find the messages.js file, which is intended for application strings, in the common\js folder.
Application messages that are stored in the messages.js file can be referenced in two ways:
Enabling translation of system messages
It is also possible to translate system messages that the application shows, for example "Internet connection is not available" or "Invalid username or password".
System messages are stored in the WL.ClientMessages object.
You can find a full list of system messages in the www\default\worklight\messages\messages.json file, which is inside the generated projects (iOS, Android, Windows Phone 8, and so on,…).
Set up the default application strings in the messages.js file.
Override specific strings when required.
Update GUI components with the new strings.
You can perform more tasks, such as setting text direction for right-to-left languages such as Hebrew or Arabic.
Each time that an element is updated, it is updated with different strings according to the active language.
Detecting the device locale and language
It is possible to detect the locale and the language of the device.
Use the WL.App.getDeviceLocale() and WL.App.getDeviceLanguage() functions to detect the current locale.
Click to download the Studio project.▲