For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


The WL.ClientMessages object

We can see a list of the system messages that are stored in the WL.ClientMessages object, and enable the translation of these system messages.

The WL.ClientMessages object is an object that stores the system messages that are defined in the worklight/messages/messages.json file. This file is in the environment folder of the projects that you generated with IBM MobileFirstâ„¢ Platform Foundation. To enable the translation of a system message, we must override the value of this message in the WL.ClientMessages object, as indicated in the following code example:

WL.ClientMessages.invalidUsernamePassword="The custom user name and password are not valid";

Note: You must override the system messages on a global JavaScript level because some parts of the code run only after the application successfully initialized.

Parent topic: JavaScript client-side API