Home

# Library goog.locale

Function Summary
| `getLanguageSubTag(string languageCode) ⇒ string` Returns the language-subtag of the given language code.
| `getLocale() ⇒ string` Retrieve the currnet locale
| `getLocalizedCountryName(string languageCode, ?Object= opt_localeSymbols) ⇒ string` Returns the localized country name for the provided language code in the current or provided locale symbols set. This method depends on goog.locale.LocaleNameConstants__<locale> available from //javascript/googledata/i18n/js_locale_data. User of this method has to add dependency to this.
| `getLocalizedLanguageName(string languageCode, ?Object= opt_localeSymbols) ⇒ string` Returns the localized language name for the provided language code in the current or provided locale symbols set. This method depends on goog.locale.LocaleNameConstants__<locale> available from //javascript/googledata/i18n/js_locale_data. User of this method has to add dependency to this.
| `getNativeCountryName(string countryCode) ⇒ string` Returns the country name of the provided language code in its native language. This method depends on goog.locale.nativeNameConstants available from nativenameconstants.js. User of this method has to add dependency to this.
| `getNativeLanguageName(string languageCode) ⇒ string` Returns the language name of the provided language code in its native language. This method depends on goog.locale.nativeNameConstants available from nativenameconstants.js. User of this method has to add dependency to this.
| `getRegionSubTag(string languageCode) ⇒ string` Returns the region-sub-tag of the given language code.
| `getResource(string resourceName, string= opt_locale) ⇒ (Object|null|undefined)` Retrieve specified resource for certain locale.
| `getResourceWithFallback(string resourceName, string= opt_locale) ⇒ (Object|null|undefined)` Retrieve specified resource for certain locale with fallback. For example, request of 'zh_CN' will be resolved in following order: zh_CN, zh, en. If none of the above succeeds, of if the resource as indicated by resourceName does not exist at all, undefined will be returned.
| `getScriptSubTag(string languageCode) ⇒ string` Returns the script subtag of the locale with the first alphabet in uppercase and the rest 3 characters in lower case.
| `getTimeZoneAllLongNames() ⇒ ?Array.<(Object|null)>` Returns the displayable list of long timezone names paired with its id for the current locale. This method depends on goog.locale.TimeZoneAllLongNames__<locale> available from http://go/js_locale_data. User of this method has to add dependacy to this.
| `getTimeZoneNameList_(string nameType, string= opt_resource) ⇒ ?Array.<(Object|null)>` Returns the displayable list of timezone names paired with its id for the current locale, selected based on the region or language provided. This method depends on goog.locale.TimeZone*__<locale> available from http://go/js_locale_data. User of this method has to add dependacy to this.
| `getTimeZoneSelectedLongNames(string= opt_regionOrLang) ⇒ ?Array.<(Object|null)>` Returns the displayable list of long timezone names paired with its id for the current locale, selected based on the region or language provided. This method depends on goog.locale.TimeZone*__<locale> available from http://go/js_locale_data. User of this method has to add dependacy to this.
| `getTimeZoneSelectedShortNames(string= opt_regionOrLang) ⇒ ?Array.<(Object|null)>` Returns the displayable list of short timezone names paired with its id for the current locale, selected based on the region or language provided. This method depends on goog.locale.TimeZone*__<locale> available from http://go/js_locale_data. User of this method has to add dependacy to this.
| `getVariantSubTag(string languageCode) ⇒ string` Returns the variant-sub-tag of the given language code.
| `isResourceRegistered((goog.locale.Resource|null|string) resourceName, string localeName) ⇒ boolean` Returns true if the required resource has already been registered.
| `registerLocaleNameConstants(?Object dataObj, string localeName)` Registers the LocaleNameConstants constants object for a given locale name.
| `registerResource(?Object dataObj, (goog.locale.Resource|null|string) resourceName, string localeName)` Register a resource object for certain locale.
| `registerTimeZoneAllLongNames(?Object dataObj, string localeName)` Registers the TimeZoneAllLongNames constants object for a given locale name.
| `registerTimeZoneConstants(?Object dataObj, string localeName)` Registers the timezone constants object for a given locale name.
| `registerTimeZoneSelectedIds(?Object dataObj, string localeName)` Registers the TimeZoneSelectedIds constants object for a given locale name.
| `registerTimeZoneSelectedLongNames(?Object dataObj, string localeName)` Registers the TimeZoneSelectedLongNames constants object for a given locale name.
| `registerTimeZoneSelectedShortNames(?Object dataObj, string localeName)` Registers the TimeZoneSelectedShortNames constants object for a given locale name.
| `setLocale(string localeName)` Set currnet locale to the specified one.