IBM Worklight - WL.App.getDeviceLanguage() API method does not return correct language code in iOS

僤鯓⒐⒋嵵緔 提交于 2019-11-29 18:03:57

When using iOS, the relevant setting is that of Region Format.


  1. Created a new Worklight project and application with the iPhone and Android environments
  2. Added in wlCommonInit(): alert(WL.App.getDeviceLanguage());
  3. Build All and Deploy, launch in device

In iOS
There are two settings related to language:

  1. Settings.app >> General >> International >> Region Format

    I currently have Hebrew (Israel) selected.
    Launching the app shows me an alert with he.

    Changing to Gusii (Kenya) and re-launching the app then shows me gu, and so on for other region formats.

  2. Settings.app >> General >> International >> Language

    Changes done here will take no effect.


In Android
There is only one setting related to language:

  1. Settings >> Language and input

    I currently have עברית (Hebrew) selected.
    Launching the app shows me an alert with iw.

    Changing to English (United States) and re-launching the app then shows me en, and so on for other languages.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!