Public Member Functions

nsILocaleService Interface Reference

The Locale service interface. More...

import "nsILocaleService.idl";

List of all members.

Public Member Functions

nsILocale newLocale (in AString aLocale)
 Create a new nsILocale from a locale string.
nsILocale getSystemLocale ()
 Get the user preference for locale from the operating system.
nsILocale getApplicationLocale ()
 Get the user preference for locale from the operating system.
nsILocale getLocaleFromAcceptLanguage (in string acceptLanguage)
 Get the most preferred locale from a list of locale preferences.
AString getLocaleComponentForUserAgent ()
 Get the user preference for locale from the operating system.

Detailed Description

The Locale service interface.

This is a singleton object, and should be obtained from the nsServiceManager.


Member Function Documentation

nsILocale nsILocaleService::getApplicationLocale (  ) 

Get the user preference for locale from the operating system.

NOTE: This has nothing to do with the locale used for localization of the application (UI text strings etc.). This method returns something similar to getSystemLocale.

Returns:
User's OS setting for preferred locale.
AString nsILocaleService::getLocaleComponentForUserAgent (  ) 

Get the user preference for locale from the operating system.

NOTE: This has nothing to do with any HTTP User-Agent. This method returns the same as getSystemLocale, but as a string.

Returns:
User's OS setting for preferred locale in the format described in nsILocale.
nsILocale nsILocaleService::getLocaleFromAcceptLanguage ( in string  acceptLanguage  ) 

Get the most preferred locale from a list of locale preferences.

Parameters:
acceptLanguage Locale preference in the same format as the Accept-Language HTTP header.
Returns:
The most preferred locale according to the acceptLanguage parameter.
nsILocale nsILocaleService::getSystemLocale (  ) 

Get the user preference for locale from the operating system.

Returns:
User's OS setting for preferred locale.
nsILocale nsILocaleService::newLocale ( in AString  aLocale  ) 

Create a new nsILocale from a locale string.

Parameters:
aLocale A locale code as described in nsILocale.
Returns:
A nsILocale representing the given locale.

The documentation for this interface was generated from the following file: