Packagejp.nium.lang
Classpublic final class Locale
InheritanceLocale Inheritance Object

Locale クラスは、多言語テキストを制御するためのクラスです。 Locale クラスを直接インスタンス化することはできません。 new Locale() コンストラクタを呼び出すと、ArgumentError 例外がスローされます。 The Locale class is a class to handle muilti languages. Locale class can not instanciate directly. When call the new Locale() constructor, the ArgumentError exception will be thrown.

View the examples



Public Properties
 PropertyDefined By
  defaultLanguage : String
[static] [read-only] 指定された言語に対応したストリングが存在しなかった場合に、代替言語として使用される言語を取得します。
Locale
  language : String
[static] 現在設定されている言語を取得または設定します。 デフォルト設定は、Flash Player が実行されているシステムの言語コードになります。 Get or set the current language.
Locale
Public Methods
 MethodDefined By
  
getString(id:String):String
[static] 指定した id に関連付けられたストリングを現在設定されている言語表現で返します。 Returns the string which relate to the specified id by the current language expression.
Locale
  
getStringByLang(id:String, language:String):String
[static] 指定した id と言語に関連付けられたストリングを返します。 Returns the string which relates to the specified id and language.
Locale
  
setString(id:String, language:String, value:String):void
[static] ストリングを指定した id と言語に関連付けます。 Relate the specified string to the language.
Locale
Public Constants
 ConstantDefined By
  EN : String = en
[static] 言語設定が英語になるよう指定します。 Set the language configuration to "English".
Locale
  JA : String = ja
[static] 言語設定が日本語になるよう指定します。 Set the language configuration to "Japanese".
Locale
Property Detail
defaultLanguageproperty
defaultLanguage:String  [read-only]

指定された言語に対応したストリングが存在しなかった場合に、代替言語として使用される言語を取得します。


Implementation
    public static function get defaultLanguage():String
languageproperty 
language:String

現在設定されている言語を取得または設定します。 デフォルト設定は、Flash Player が実行されているシステムの言語コードになります。 Get or set the current language. The default setting will be same as System language code which executing the Flash Player.


Implementation
    public static function get language():String
    public static function set language(value:String):void
Method Detail
getString()method
public static function getString(id:String):String

指定した id に関連付けられたストリングを現在設定されている言語表現で返します。 Returns the string which relate to the specified id by the current language expression.

Parameters

id:Stringストリングに関連付けられた識別子です。 The identifier relates to the string.

Returns
String関連付けられたストリングです。 Related string.
getStringByLang()method 
public static function getStringByLang(id:String, language:String):String

指定した id と言語に関連付けられたストリングを返します。 Returns the string which relates to the specified id and language.

Parameters

id:Stringストリングに関連付けられた識別子です。 The identifier relates to the string.
 
language:Stringストリングに関連付けられた言語です。 The language relates to the string.

Returns
String関連付けられたストリングです。 Related string.
setString()method 
public static function setString(id:String, language:String, value:String):void

ストリングを指定した id と言語に関連付けます。 Relate the specified string to the language.

Parameters

id:Stringストリングに関連付ける識別子です。 The identifier relates to the string.
 
language:Stringストリングに関連付ける言語です。 The language relates to the string.
 
value:String関連付けるストリングです。 Related string.

Constant Detail
ENConstant
public static const EN:String = en

言語設定が英語になるよう指定します。 Set the language configuration to "English".

JAConstant 
public static const JA:String = ja

言語設定が日本語になるよう指定します。 Set the language configuration to "Japanese".

Examples