Is there a way to change the default "Worklight Settings" string in Android's OptionsMenu, as provided by Worklight?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Update: corrected the answer a bit...
Yes.
- Open yourApp.js (located at
yourProject\apps\yourApp\common
) Add the following object before
wlCommonInit()
:WL.ClientMessages.wlSettings = "הגדרות וורקלייט";
- This is also mentioned in slide 8 in the Enabling Translation training module.
- This is also mentioned in slide 8 in the Enabling Translation training module.
(Re-)Build and deploy, launch in Android emulator or device
Worklight Settings will now look like so when translated to Hebrew:
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.