Packageqnx.locale
Classpublic class Locale
InheritanceLocale Inheritance flash.events.EventDispatcher

The Locale class represents a specific locale. Each country or region uses a unique locale code and a locale-specific resource file structure to define language, symbols, or images that are specific to that region or country.

You can use the Locale class to change or access locale-specific items such as language resource strings or images. To change the locale of the entire application, you must use the LocaleManager class.

See also

LocaleManager
LocaleResourceBundle


Public Properties
 PropertyDefined By
  id : String
[read-only] Gets the ID of the locale.
Locale
Public Methods
 MethodDefined By
  
Locale(locale_id:String, loadResource:Boolean = false)
Creates a new Locale instance given an ID.
Locale
  
getResource(key:String, ... args):String
Returns the resource for the specified key from the currently loaded localization file.
Locale
  
Loads the resource property file for the current locale.
Locale
Events
 Event Summary Defined By
  Dispatched after a property file has been successfully loaded and parsed.Locale
Property Detail
idproperty
id:String  [read-only]

Gets the ID of the locale.


Implementation
    public function get id():String
Constructor Detail
Locale()Constructor
public function Locale(locale_id:String, loadResource:Boolean = false)

Creates a new Locale instance given an ID.

Parameters
locale_id:String — A String representing the ID of the locale. For example, en_US.
 
loadResource:Boolean (default = false) — An optional parameter that, when set to true, loads the resource.property file for the locale upon creation. The default value is false.

See also

Method Detail
getResource()method
public function getResource(key:String, ... args):String

Returns the resource for the specified key from the currently loaded localization file.

Parameters

key:String — The key of the resource that is returned.
 
... args — Optional parameters that can be used as wildcard replacements in the returned String.

Returns
String — A String representing the value of the key in the localization file.
loadResources()method 
public function loadResources():void

Loads the resource property file for the current locale. This method attempts to load a file in the following path locale/<locale id>/resource.properties, where <locale id> is the current locale ID.

Event Detail
complete Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

Dispatched after a property file has been successfully loaded and parsed.