Packageandromeda.i18n
Classpublic final class Lang
InheritanceLang Inheritance CoreObject

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 andromeda.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 andromeda.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 = "null"
The label of the current Lang instance.
Lang
  LANGS : HashMap
[static] The map of all existing Lang reference in the application.
Lang
  value : String = "null"
The value of the current Lang instance.
Lang
Public Methods
 MethodDefined by
  
Lang(id:String, label:String)
Creates a new Lang instance.
Lang
  
get(id:String):Lang
[static] Returns a Lang instance with the specified 'id' value.
Lang
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
  
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
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
  
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 = "null"

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 = "null"

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 English names of the language.
Method detail
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 override 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 override 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.