| Package | vegas.i18n |
| Class | public final class Lang |
| Inheritance | Lang Object |
| Implements | Evaluable, Serializable |
Example :
import vegas.i18n.Lang ;
trace( "Lang.ES.toString() : " + Lang.ES.toString() ) ; // es
trace( "Lang.ES.valueOf() : " + Lang.ES.valueOf() ) ; // es
trace( "Lang.ES.toSource() : " + Lang.ES.toSource() ) ; // new vegas.i18n.Lang("es","Spanish")
trace( "Lang.ES.label : " + Lang.ES.label ) ; // Spanish
trace( "Lang.get('fr') == Lang.FR : " + ( Lang.get("fr") == Lang.FR ) ) ; // true
trace( "Lang.validate('fr') : " + Lang.validate('fr') ) ; // true
trace( "Lang.validate( Lang.FR ) : " + Lang.validate( Lang.FR ) ) ; // true
trace( "Lang.LANGS : " + Lang.LANGS ) ;
// {pl:pl,nl:nl,es:es,tr:tr,it:it,da:da,pt:pt,fi:fi,zh-CN:zh-CN,no:no,ja:ja,de:de,ru:ru,fr:fr,zh-TW:zh-TW,xu:xu,ko:ko,en:en,sv:sv,cs:cs,hu:hu}
trace( "Lang.LANGS.size() : " + Lang.LANGS.size() ) ; // 21
See also
| Property | Defined By | ||
|---|---|---|---|
| label : String
The label of the current Lang instance. | Lang | ||
| LANGS : HashMap [static]
The map of all existing Lang reference in the application. | Lang | ||
| value : String
The value of the current Lang instance. | Lang | ||
| Method | Defined By | ||
|---|---|---|---|
Lang(id:String, label:String)
Creates a new Lang instance. | Lang | ||
eval(o:*):*
Evaluates the specified object. | Lang | ||
[static]
Returns a Lang instance with the specified 'id' value. | Lang | ||
[static]
Insert a new key/value entry with a passed-in Lang argument. | Lang | ||
[static]
Removes the specified Lang reference in the static LANGS HashMap. | Lang | ||
size():uint [static]
Returns the number of Lang reference register in the static LANGE HashMap. | Lang | ||
toSource(indent:int = 0):String
Returns the eden string representation of the object. | Lang | ||
toString():String
Returns the string representation of this instance. | Lang | ||
validate(lang:*):Boolean [static]
Returns true if the passed value is a valid Lang reference. | Lang | ||
valueOf():String
Returns the value of this instance. | Lang | ||
| Constant | Defined By | ||
|---|---|---|---|
| CS : Lang [static]
Indicates the 'Czech' language reference. | Lang | ||
| DA : Lang [static]
Indicates the 'Dasnish' language reference. | Lang | ||
| DE : Lang [static]
Indicates the 'German' language reference. | Lang | ||
| EN : Lang [static]
Indicates the 'English' language reference. | Lang | ||
| ES : Lang [static]
Indicates the 'Spanish' language reference. | Lang | ||
| FI : Lang [static]
Indicates the 'Finnish' language reference. | Lang | ||
| FR : Lang [static]
Indicates the 'French' language reference. | Lang | ||
| HU : Lang [static]
Indicates the 'Hungarian' language reference. | Lang | ||
| IT : Lang [static]
Indicates the 'Italian' language reference. | Lang | ||
| JA : Lang [static]
Indicates the 'Japanese' language reference. | Lang | ||
| KO : Lang [static]
Indicates the 'Korean' language reference. | Lang | ||
| NL : Lang [static]
Indicates the 'Dutch' language reference. | Lang | ||
| NO : Lang [static]
Indicates the 'Norwegian' language reference. | Lang | ||
| PL : Lang [static]
Indicates the 'Italian' language reference. | Lang | ||
| PT : Lang [static]
Indicates the 'Portuguese' language reference. | Lang | ||
| RU : Lang [static]
Indicates the 'Russian' language reference. | Lang | ||
| SV : Lang [static]
Indicates the 'Swedish' language reference. | Lang | ||
| TR : Lang [static]
Indicates the 'Turkish' language reference. | Lang | ||
| XU : Lang [static]
Indicates the 'Other/unknown' language reference. | Lang | ||
| ZH_CN : Lang [static]
Indicates the 'Simplified Chinese' language reference. | Lang | ||
| ZH_TW : Lang [static]
Indicates the 'Traditional Chinese' language reference. | Lang | ||
| label | property |
public var label:StringThe label of the current Lang instance.
| LANGS | property |
public static var LANGS:HashMapThe map of all existing Lang reference in the application.
| value | property |
public var value:StringThe value of the current Lang instance.
| Lang | () | Constructor |
public function Lang(id:String, label:String)Creates a new Lang instance.
Parametersid:String — The lang language specified as a lowercase two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code from ISO 3166 distinguishes between Simplified and Traditional Chinese.
| |
label:String — The label value of the language.
|
| eval | () | method |
public function eval(o:*):*Evaluates the specified object.
Parameters
o:* |
* |
| get | () | method |
public static function get(id:String):LangReturns a Lang instance with the specified 'id' value.
Parameters
id:String |
Lang — a Lang instance with the specified 'id' value.
|
| put | () | method |
public static function put(lang:Lang):*Insert a new key/value entry with a passed-in Lang argument.
Parameters
lang:Lang |
* |
| remove | () | method |
public static function remove(lang:Lang):*Removes the specified Lang reference in the static LANGS HashMap.
Parameters
lang:Lang |
* |
| size | () | method |
public static function size():uintReturns the number of Lang reference register in the static LANGE HashMap.
Returnsuint — the number of Lang reference register in the static LANGE HashMap.
|
| toSource | () | method |
public function toSource(indent:int = 0):StringReturns the eden string representation of the object.
Parameters
indent:int (default = 0) |
String — the eden string representation of the object.
|
| toString | () | method |
public function toString():StringReturns the string representation of this instance.
ReturnsString — the string representation of this instance.
|
| validate | () | method |
public static function validate(lang:*):BooleanReturns true if the passed value is a valid Lang reference.
Parameters
lang:* |
Boolean — true if the passed value is a valid Lang reference.
|
| valueOf | () | method |
public function valueOf():StringReturns the value of this instance.
ReturnsString — the value of this instance.
|
| CS | Constant |
public static const CS:LangIndicates the 'Czech' language reference.
| DA | Constant |
public static const DA:LangIndicates the 'Dasnish' language reference.
| DE | Constant |
public static const DE:LangIndicates the 'German' language reference.
| EN | Constant |
public static const EN:LangIndicates the 'English' language reference.
| ES | Constant |
public static const ES:LangIndicates the 'Spanish' language reference.
| FI | Constant |
public static const FI:LangIndicates the 'Finnish' language reference.
| FR | Constant |
public static const FR:LangIndicates the 'French' language reference.
| HU | Constant |
public static const HU:LangIndicates the 'Hungarian' language reference.
| IT | Constant |
public static const IT:LangIndicates the 'Italian' language reference.
| JA | Constant |
public static const JA:LangIndicates the 'Japanese' language reference.
| KO | Constant |
public static const KO:LangIndicates the 'Korean' language reference.
| NL | Constant |
public static const NL:LangIndicates the 'Dutch' language reference.
| NO | Constant |
public static const NO:LangIndicates the 'Norwegian' language reference.
| PL | Constant |
public static const PL:LangIndicates the 'Italian' language reference.
| PT | Constant |
public static const PT:LangIndicates the 'Portuguese' language reference.
| RU | Constant |
public static const RU:LangIndicates the 'Russian' language reference.
| SV | Constant |
public static const SV:LangIndicates the 'Swedish' language reference.
| TR | Constant |
public static const TR:LangIndicates the 'Turkish' language reference.
| XU | Constant |
public static const XU:LangIndicates the 'Other/unknown' language reference.
| ZH_CN | Constant |
public static const ZH_CN:LangIndicates the 'Simplified Chinese' language reference.
| ZH_TW | Constant |
public static const ZH_TW:LangIndicates the 'Traditional Chinese' language reference.