getLocale |
Returns the locale object
Syntax
Locale.getLocale(srcObject)
Parameters
Parameter |
Description |
---|---|
srcObject |
Optional. Either it can be an HTML element or Window object. |
Note: If the Window URL or element contains locale, the Locale object with the locale value is returned. Otherwise locale value is taken from the preferences. If nothing is present by default the browser language is considered as the locale value.
Return Value
Returns the Locale object
Example
The following example displays how this method is used.
importType("wcp.library.util.LocaleFormat"); importType("wcp.library.util.Locale"); var localeObject = Locale.getLocale(srcObject);//srcObject is optional.