Pacotemx.resources
Classepublic class Locale
HerançaLocale Inheritance Object

The Locale class can be used to parse a locale string such as "en_US_MAC" into its three parts: a language code, a country code, and a variant.

The localization APIs in the IResourceManager and IResourceBundle interfaces use locale strings rather than Locale instances, so this class is seldom used in an application.

Veja também

mx.resources.IResourceBundle
mx.resources.IResourceManager


Propriedades Públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  country : String
[read-only] The country code of this Locale instance.
Locale
  language : String
[read-only] The language code of this Locale instance.
Locale
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  variant : String
[read-only] The variant part of this Locale instance.
Locale
Métodos Públicos
 MétodoDefinido por
  
Locale(localeString:String)
Constructor.
Locale
  
[static] If you compiled your application for a single locale, this method returns a Locale object representing that locale.
Locale
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Returns the locale String that was used to construct this Locale instance.
Locale
 Inherited
Returns the primitive value of the specified object.
Object
Detalhes da propriedade
countrypropriedade
country:String  [read-only]

The country code of this Locale instance. [Read-Only]


Implementação
    public function get country():String

Exemplo
How to use examples
      var locale:Locale = new Locale("en_US_MAC");
      trace(locale.country); // outputs "US"
      
languagepropriedade 
language:String  [read-only]

The language code of this Locale instance. [Read-Only]


Implementação
    public function get language():String

Exemplo
How to use examples
      var locale:Locale = new Locale("en_US_MAC");
      trace(locale.language); // outputs "en"
      
variantpropriedade 
variant:String  [read-only]

The variant part of this Locale instance. [Read-Only]


Implementação
    public function get variant():String

Exemplo
How to use examples
      var locale:Locale = new Locale("en_US_MAC");
      trace(locale.variant); // outputs "MAC"
      
Detalhes do construtor
Locale()Construtor
public function Locale(localeString:String)

Constructor.

Parâmetros
localeString:String — A 1-, 2-, or 3-part locale String, such as "en", "en_US", or "en_US_MAC". The parts are separated by an underscore. The first part should be a 2-letter lowercase language code as defined by ISO-639, such as "en" for English. The second part should be a 2-letter uppercase country code as defined by ISO-3166, such as "US" for the United States. The third part is a variant string which can be used as you wish to distinguish multiple locales for the same language and country. It is sometimes used to indicate the operating system that the locale should be used with, such as "MAC", "WIN", or "UNIX".
Detalhes do método
getCurrent()método
public static function getCurrent(sm:ISystemManager):Locale
Deprecated Since 3.0: Please use ResourceManager.localeChain

If you compiled your application for a single locale, this method returns a Locale object representing that locale. Otherwise, it returns null.

This method has been deprecated because the Flex framework now supports having resource bundles for multiple locales in the same application. You can use the getLocale() method of IResourceManager to find out which locales the ResourceManager has resource bundles for. You can use the localeChain property of IResourceManager to determine which locales the ResourceManager searches for resources.

Parâmetros

sm:ISystemManager

Retorna
Locale
toString()método 
public function toString():String

Returns the locale String that was used to construct this Locale instance.

Retorna
String

Exemplo
How to use examples
      var locale:Locale = new Locale("en_US_MAC");
      trace(locale.toString()); // outputs "en_US_MAC"