Question

Is there a way to change the default "Worklight Settings" string in Android's OptionsMenu, as provided by Worklight?

Was it helpful?

Solution

Update: corrected the answer a bit...

Yes.

  1. Open yourApp.js (located at yourProject\apps\yourApp\common)
  2. Add the following object before wlCommonInit():

    WL.ClientMessages.wlSettings = "הגדרות וורקלייט";
    
  3. (Re-)Build and deploy, launch in Android emulator or device

Worklight Settings will now look like so when translated to Hebrew:

enter image description here

Some notes:

  • Make sure to change the Eclipse workspace encoding to "UTF-8" (in Eclipse Preferences > Workspace > Text file encoding). You will need to create a new Worklight project afterwards.

  • If you add android:targetSdkVersion="10" or above to the application's AndroidManifest.xml, the OptionsMenu will not display as Google switched in this API Level to ActionBar, which is not yet available in Worklight.

  • And a quick FYI to make sure you are aware that this feature is not meant for end-user consumption once moving to Production (it can fit for in-house apps to employees, but not your regular end-users; You don't want them to change the Worklight Server URL... ;).

  • To better familiarize with Worklight, please go through the IBM Worklight Getting Started training modules.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top