goog.locale
Functions
getLanguageSubTag( languageCode ) → string
string
getLocale() → string
string
Retrieve the current locale
warning Deprecated | Use goog.LOCALE and goog.i18n instead. |
---|
Parameters | None. | ||
---|---|---|---|
Returns |
|
getLocalizedCountryName( languageCode, opt_localeSymbols ) → string
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 http://go/js_locale_data. User of this method has to add dependency to
this.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getLocalizedLanguageName( languageCode, opt_localeSymbols ) → string
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 http://go/js_locale_data. User of this method has to add dependency to
this.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getLocalizedRegionNameFromRegionCode( regionCode, opt_localeSymbols ) → string
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 http://go/js_locale_data. User of this method has to add dependency to
this.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getNativeCountryName( countryCode ) → string
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.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getNativeLanguageName( languageCode ) → string
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.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getRegionSubTag( languageCode ) → string
string
getResource( resourceName, opt_locale ) → (Object|null|undefined)
(Object|null|undefined)
Retrieve specified resource for certain locale.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getResourceWithFallback( resourceName, opt_locale ) → (Object|null|undefined)
(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.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
getScriptSubTag( languageCode ) → string
string
getVariantSubTag( languageCode ) → string
string
isResourceRegistered( resourceName, localeName ) → boolean
boolean
registerLocaleNameConstants( dataObj, localeName ) → void
void
registerResource( dataObj, resourceName, localeName ) → void
void
registerTimeZoneAllLongNames( dataObj, localeName ) → void
void
registerTimeZoneConstants( dataObj, localeName ) → void
void
registerTimeZoneSelectedIds( dataObj, localeName ) → void
void
registerTimeZoneSelectedLongNames( dataObj, localeName ) → void
void
registerTimeZoneSelectedShortNames( dataObj, localeName ) → void
void
setLocale( localeName ) → void
void
Set current locale to the specified one.
Parameters |
|
---|
Properties
List of codes for countries valid today.
Native country and language names
The script code to list of language codes map.