Skip to content
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.

Usage

  var nLocale = _y.normalizeLocale ( "EN" ); // nLocale = en
  var nLocale = _y.normalizeLocale ( "ENUS" ); // nLocale = en-US
  var nLocale = _y.normalizeLocale ( "es_es" ); // nLocale = es-es
Clone this wiki locally