| Package | qnx.locale |
| Class | public class Locale |
| Inheritance | Locale flash.events.EventDispatcher |
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
| Property | Defined By | ||
|---|---|---|---|
| id : String [read-only]
Gets the ID of the locale. | Locale | ||
| Method | Defined 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 | ||
loadResources():void
Loads the resource property file for the current locale. | Locale | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched after a property file has been successfully loaded and parsed. | Locale | |||
| id | property |
id:String [read-only] Gets the ID of the locale.
public function get id():String| Locale | () | Constructor |
public function Locale(locale_id:String, loadResource:Boolean = false)
Creates a new Locale instance given an ID.
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
| getResource | () | method |
public function getResource(key:String, ... args):StringReturns 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.
|
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.
| complete | Event |
flash.events.Eventflash.events.Event.COMPLETEDispatched after a property file has been successfully loaded and parsed.