Interface mozILocaleServiceType

Hierarchy

Properties

appLocaleAsBCP47: string
appLocaleAsLangTag: string

Returns the best locale that the application should be localized to.

The result is a valid locale ID and it should be used for all APIs that do not handle language negotiation.

When retrieving the locales for language negotiation and matching to language resources, use the language tag form. When retrieving the locales for Intl API or ICU locale settings, use the BCP47 form.

Where possible, appLocales* should be preferred over this API and all callsites should handle some form of "best effort" language negotiation to respect user preferences in case the use case does not have data for the first locale in the list.

Example: "zh-Hans-HK"

defaultLocale: string

Default locale of the browser. The locale we are guaranteed to have resources for that should be used as a last resort fallack in cases where requested locales do not match available locales.

isAppLocaleRTL: boolean

Returns whether the current app locale is RTL.

lastFallbackLocale: string

Last fallback is the final fallback locale we're going to attempt if all else fails in any language negotiation or locale resource retrieval situations.

At the moment it returns en-US.

requestedLocale: string

Returns the top-requested locale from the user, or an empty string if none is set.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

Generated using TypeDoc