Home » IBM » C5050-408 » Which Worklight APIs can the application developer use to detect the specific device locale and language?
An application developer is working on a mobile application for a bank. The requirement is to globalize this application to display user messages, currency, date and time according to the locale and language settings on the device.
Which Worklight APIs can the application developer use to detect the specific device locale and language?
A. WL.Client.getLocale()
WL.Client.getLanguage()
B. WL.Device.getLocale()
WL.Device.getLanguage()
C. WL.App.getDeviceLocale()
WL.App.getDeviceLanguage()
D. WL.G11N.getLocaleName()
WL.G11N.getPrefferedLanguage()
Correct Answer: D
Explanation/Reference:
The getLocaleName function gets the client current locale setting on the device.
The getPreferredLanguage function gets the current language of the client.
Note: The following listings and figures show the Cordova globalization API. Dojo is used to demonstrate the user interface.
Table 2. Listing 1: Using the Cordova globalization API function onDeviceReady(){ g11n = window.plugins.globalization; }
References: https://www.ibm.com/support/knowledgecenter/SSZH4A_6.1.0/com.ibm.worklight.dev.doc/dev/c_globalization_in_ibm_worklight.html
Download Printable PDF. VALID exam to help you PASS.
|
|