-
Notifications
You must be signed in to change notification settings - Fork 17
_y.normalizeLocale
Kerri Shotts edited this page Apr 5, 2014
·
1 revision
(part of _y)
Parameters: locale
Returns: normalized locale
YASMF operates on locales of the form la-RE
(language_REGION). This method converts incoming locales into the appropriate format. For example, enus
is converted to en-US
.
- if the locale only has a language, the returned locale is the language without any region information
- if the locale appears to have language and locale information, the returned value is a lowercase language, a dash, and an uppercase region.
var nLocale = _y.normalizeLocale ( "EN" ); // nLocale = en
var nLocale = _y.normalizeLocale ( "ENUS" ); // nLocale = en-US
var nLocale = _y.normalizeLocale ( "es_es" ); // nLocale = es-es