Packagevegas.i18n
Classpublic final class Lang
InheritanceLang Inheritance Object
Implements Evaluable, Serializable

This static enumeration class defines the language code of the system on which the player is running. The language is 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. The languages codes are based on the English names of the language: for example, 'hu' specifies Hungarian.

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

Capabilities.language


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined By
  
Lang(id:String, label:String)
Creates a new Lang instance.
Lang
  
eval(o:*):*
Evaluates the specified object.
Lang
  
get(id:String):Lang
[static] Returns a Lang instance with the specified 'id' value.
Lang
  
put(lang:Lang):*
[static] Insert a new key/value entry with a passed-in Lang argument.
Lang
  
remove(lang: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
Public Constants
 ConstantDefined 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
Property Detail
labelproperty
public var label:String

The label of the current Lang instance.

LANGSproperty 
public static var LANGS:HashMap

The map of all existing Lang reference in the application.

valueproperty 
public var value:String

The value of the current Lang instance.

Constructor Detail
Lang()Constructor
public function Lang(id:String, label:String)

Creates a new Lang instance.

Parameters
id: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.
Method Detail
eval()method
public function eval(o:*):*

Evaluates the specified object.

Parameters

o:*

Returns
*
get()method 
public static function get(id:String):Lang

Returns a Lang instance with the specified 'id' value.

Parameters

id:String

Returns
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

Returns
*
remove()method 
public static function remove(lang:Lang):*

Removes the specified Lang reference in the static LANGS HashMap.

Parameters

lang:Lang

Returns
*
size()method 
public static function size():uint

Returns the number of Lang reference register in the static LANGE HashMap.

Returns
uint — the number of Lang reference register in the static LANGE HashMap.
toSource()method 
public function toSource(indent:int = 0):String

Returns the eden string representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the eden string representation of the object.
toString()method 
public function toString():String

Returns the string representation of this instance.

Returns
String — the string representation of this instance.
validate()method 
public static function validate(lang:*):Boolean

Returns true if the passed value is a valid Lang reference.

Parameters

lang:*

Returns
Boolean — true if the passed value is a valid Lang reference.
valueOf()method 
public function valueOf():String

Returns the value of this instance.

Returns
String — the value of this instance.
Constant Detail
CSConstant
public static const CS:Lang

Indicates the 'Czech' language reference.

DAConstant 
public static const DA:Lang

Indicates the 'Dasnish' language reference.

DEConstant 
public static const DE:Lang

Indicates the 'German' language reference.

ENConstant 
public static const EN:Lang

Indicates the 'English' language reference.

ESConstant 
public static const ES:Lang

Indicates the 'Spanish' language reference.

FIConstant 
public static const FI:Lang

Indicates the 'Finnish' language reference.

FRConstant 
public static const FR:Lang

Indicates the 'French' language reference.

HUConstant 
public static const HU:Lang

Indicates the 'Hungarian' language reference.

ITConstant 
public static const IT:Lang

Indicates the 'Italian' language reference.

JAConstant 
public static const JA:Lang

Indicates the 'Japanese' language reference.

KOConstant 
public static const KO:Lang

Indicates the 'Korean' language reference.

NLConstant 
public static const NL:Lang

Indicates the 'Dutch' language reference.

NOConstant 
public static const NO:Lang

Indicates the 'Norwegian' language reference.

PLConstant 
public static const PL:Lang

Indicates the 'Italian' language reference.

PTConstant 
public static const PT:Lang

Indicates the 'Portuguese' language reference.

RUConstant 
public static const RU:Lang

Indicates the 'Russian' language reference.

SVConstant 
public static const SV:Lang

Indicates the 'Swedish' language reference.

TRConstant 
public static const TR:Lang

Indicates the 'Turkish' language reference.

XUConstant 
public static const XU:Lang

Indicates the 'Other/unknown' language reference.

ZH_CNConstant 
public static const ZH_CN:Lang

Indicates the 'Simplified Chinese' language reference.

ZH_TWConstant 
public static const ZH_TW:Lang

Indicates the 'Traditional Chinese' language reference.