Adobe Flex 2 Language Reference - collected by Jimbob | Back to MY RESOURCES


Packagemx.resources
Classpublic class Locale
InheritanceLocale Inheritance Object

You can use this class to query the current Locale. The locale is settlable through the XML configuration file,an mxmlc compiler argument or through Flex builder. However, locale is not settable through the Locale class at run time. The framework currently supports en_US and ja_JP only. However, you can create properties files for any language and keep them under a locale folder, such as fr_FR for French. eg: Locale.getCurrent(Application.application.systemManager).country returns the current country.

See also

mx.resources.ResourceBundle


Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  country : String
[read-only] The country of current locale [Read-Only].
Locale
  language : String
[read-only] The language of current locale [Read-Only].
Locale
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  variant : String
[read-only] The variant of current locale [Read-Only].
Locale
Public Methods
 MethodDefined by
  
Locale(localeStr:String)
Constructor.
Locale
  
[static] Gets the current locale.
Locale
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
  
Returns locale in the form language_country_variant if variant is present else language_country
Locale
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
countryproperty
country:String  [read-only]

The country of current locale [Read-Only].

The default value is "EN".

Implementation
    public function get country():String

Example
      Locale.getCurrent(Application.application.systemManager).country
      

languageproperty 
language:String  [read-only]

The language of current locale [Read-Only].

The default value is "en".

Implementation
    public function get language():String

Example
      Locale.getCurrent(Application.application.systemManager).language
      

variantproperty 
variant:String  [read-only]

The variant of current locale [Read-Only].

The default value is "".

Implementation
    public function get variant():String

Example
      Locale.getCurrent(Application.application.systemManager).variant
      

Constructor detail
Locale()constructor
public function Locale(localeStr:String)

Constructor.

Parameters
localeStr:String
Method detail
getCurrent()method
public static function getCurrent(sm:ISystemManager):Locale

Gets the current locale.

Parameters
sm:ISystemManager

Returns
Locale

Example
      Locale.getCurrent(Application.application.systemManager).country
      

toString()method 
public function toString():String

Returns locale in the form language_country_variant if variant is present else language_country

Returns
String

Example
      Locale.getCurrent(Application.application.systemManager).toString()
      






collected by Jimbob 2007.05