getLocaleName


Purpose

Asynchronously obtains the string identifier for the client's current locale setting as a language code and a country code separated by the underscore character.

The string returned is a concatenation of language code (ISO-639), the underscore character ('_') and the country code (ISO 3166-1) - for instance: 'en_US', 'en_CA' or 'fr_CA'.

Under Android, the users preferred locale will be used as the current locale setting. Under iOS, the settings for the current user's chosen system locale overlaid with any custom settings the user has specified in System Preferences will be leveraged instead.

Signature

getLocaleName( callbacks )

Returns

This method does not return anything.

Parameters

Name Description Type Use
callbacks Passed to verify whether obtaining the locale name was successful or not. If successful, the onSuccess callback parameter will contain the current system locale as a string. undefined required

The getLocaleName method's callbacks object can be structured as follows:

{
 onSuccess: function( locale ) {...},
 onFailure: function() {...}
}

The table below lists all callbacks supported by the method.

Name Description Return type
onFailure Invoked when the current locale setting could not be obtained for any reason. undefined
onSuccess Invoked when obtaining the current local setting was successful. Its single parameter, locale, will contain the obtained system locale setting as a string. undefined

Related topics

Globalization
Legal notice | Copyright © 2017 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...