locale.js
No description.

File Location

/goog/locale/locale.js


Public Protected Private

Enumerations

Global Functions

goog.locale.getLanguageSubTag(languageCode) string
Returns the language-subtag of the given language code.
Arguments:
languageCode : string
Language code to extract language subtag from.
Returns: string  Language subtag (in lowercase).
code »
goog.locale.getLocale() string
Use goog.LOCALE and goog.i18n instead. Retrieve the current locale
Returns: string  Current locale name string.
code »
goog.locale.getLocalizedCountryName(languageCodeopt_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__ available from http://go/js_locale_data. User of this method has to add dependency to this.
Arguments:
languageCode : string
Language code to lookup the country name for.
opt_localeSymbols : Object=
If omitted the current locale symbol set is used.
Returns: string  Localized country name.
code »
goog.locale.getLocalizedLanguageName(languageCodeopt_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__ available from http://go/js_locale_data. User of this method has to add dependency to this.
Arguments:
languageCode : string
Language code to lookup the language name for.
opt_localeSymbols : Object=
locale symbol set if given.
Returns: string  Localized language name of the provided language code.
code »
goog.locale.getNativeCountryName(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.
Arguments:
countryCode : string
Code to lookup the country name for.
Returns: string  Country name for the provided language code.
code »
goog.locale.getNativeLanguageName(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.
Arguments:
languageCode : string
Language code to lookup the language name for.
Returns: string  Language name for the provided language code.
code »
goog.locale.getRegionSubTag(languageCode) string
Returns the region-sub-tag of the given language code.
Arguments:
languageCode : string
Language code to extract region subtag from.
Returns: string  Region sub-tag (in uppercase).
code »
goog.locale.getResource(resourceNameopt_locale) Object | undefined
Retrieve specified resource for certain locale.
Arguments:
resourceName : string
String that represents the type of resource.
opt_locale : string=
Locale ID, if not given, current locale will be assumed.
Returns: Object | undefined  The resource object that hold all the resource data, or undefined if not available.
code »
goog.locale.getResourceWithFallback(resourceNameopt_locale) Object | 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.
Arguments:
resourceName : string
String that represents the type of resource.
opt_locale : string=
locale ID, if not given, current locale will be assumed.
Returns: Object | undefined  The resource object for desired locale.
code »
goog.locale.getScriptSubTag(languageCode) string
Returns the script subtag of the locale with the first alphabet in uppercase and the rest 3 characters in lower case.
Arguments:
languageCode : string
Language Code to extract script subtag from.
Returns: string  Script subtag.
code »
goog.locale.getVariantSubTag(languageCode) string
Returns the variant-sub-tag of the given language code.
Arguments:
languageCode : string
Language code to extract variant subtag from.
Returns: string  Variant sub-tag.
code »
goog.locale.isResourceRegistered(resourceNamelocaleName) boolean
Returns true if the required resource has already been registered.
Arguments:
resourceName : goog.locale.Resource | string
String that represents the type of resource.
localeName : string
Locale ID.
Returns: boolean  Whether the required resource has already been registered.
code »
registerLocalNameConstants()
No description.
code »
goog.locale.registerLocaleNameConstants(dataObjlocaleName)
Registers the LocaleNameConstants constants object for a given locale name.
Arguments:
dataObj : Object
The resource object.
localeName : string
Locale ID.
code »
goog.locale.registerResource(dataObjresourceNamelocaleName)
Register a resource object for certain locale.
Arguments:
dataObj : Object
The resource object being registered.
resourceName : goog.locale.Resource | string
String that represents the type of resource.
localeName : string
Locale ID.
code »
goog.locale.registerTimeZoneAllLongNames(dataObjlocaleName)
Registers the TimeZoneAllLongNames constants object for a given locale name.
Arguments:
dataObj : Object
The resource object.
localeName : string
Locale ID.
code »
registerTimeZoneAllLongNames()
No description.
code »
goog.locale.registerTimeZoneConstants(dataObjlocaleName)
Use goog.i18n.TimeZone, no longer need this. Registers the timezone constants object for a given locale name.
Arguments:
dataObj : Object
The resource object.
localeName : string
Locale ID.
code »
goog.locale.registerTimeZoneSelectedIds(dataObjlocaleName)
Registers the TimeZoneSelectedIds constants object for a given locale name.
Arguments:
dataObj : Object
The resource object.
localeName : string
Locale ID.
code »
registerTimeZoneSelectedIds()
No description.
code »
goog.locale.registerTimeZoneSelectedLongNames(dataObjlocaleName)
Registers the TimeZoneSelectedLongNames constants object for a given locale name.
Arguments:
dataObj : Object
The resource object.
localeName : string
Locale ID.
code »
registerTimeZoneSelectedLongNames()
No description.
code »
goog.locale.registerTimeZoneSelectedShortNames(dataObjlocaleName)
Registers the TimeZoneSelectedShortNames constants object for a given locale name.
Arguments:
dataObj : Object
The resource object.
localeName : string
Locale ID.
code »
registerTimeZoneSelectedShortNames()
No description.
code »
goog.locale.setLocale(localeName)
Set currnet locale to the specified one.
Arguments:
localeName : string
Locale name string. We are following the usage in CLDR, but can make a few compromise for existing name compatibility.
code »

Directory locale

File Reference