NGUI: Next-Gen UI kit
3.7.2
|
Localization manager is able to parse localization information from text assets. Using it is simple: text = Localization.Get(key), or just add a UILocalize script to your labels. You can switch the language by using Localization.language = "French", for example. This will attempt to load the file called "French.txt" in the Resources folder, or a column "French" from the Localization.csv file in the Resources folder. If going down the TXT language file route, it's expected that the file is full of key = value pairs, like so: More...
Public Member Functions | |
delegate byte[] | LoadFunction (string path) |
Static Public Member Functions | |
static void | Load (TextAsset asset) |
Load the specified asset and activate the localization. More... | |
static void | Set (string languageName, byte[] bytes) |
Set the localization data directly. More... | |
static bool | LoadCSV (TextAsset asset) |
Load the specified CSV file. More... | |
static bool | LoadCSV (byte[] bytes) |
Load the specified CSV file. More... | |
static void | Set (string languageName, Dictionary< string, string > dictionary) |
Load the specified asset and activate the localization. More... | |
static string | Get (string key) |
Localize the specified value. More... | |
static string | Localize (string key) |
static bool | Exists (string key) |
Returns whether the specified key is present in the localization dictionary. More... | |
Static Public Attributes | |
static LoadFunction | loadFunction |
Want to have Localization loading be custom instead of just Resources.Load? Set this function. More... | |
static bool | localizationHasBeenSet = false |
Whether the localization dictionary has been loaded. More... | |
Properties | |
static Dictionary< string, string[]> | dictionary [get, set] |
Localization dictionary. Dictionary key is the localization key. Dictionary value is the list of localized values (columns in the CSV file). Be very careful editing this via code, and be sure to set the "KEY" to the list of languages. More... | |
static string[] | knownLanguages [get] |
List of loaded languages. Available if a single Localization.csv file was used. More... | |
static string | language [get, set] |
Name of the currently active language. More... | |
static bool | isActive [get] |
Localization manager is able to parse localization information from text assets. Using it is simple: text = Localization.Get(key), or just add a UILocalize script to your labels. You can switch the language by using Localization.language = "French", for example. This will attempt to load the file called "French.txt" in the Resources folder, or a column "French" from the Localization.csv file in the Resources folder. If going down the TXT language file route, it's expected that the file is full of key = value pairs, like so:
LABEL1 = Hello LABEL2 = Music Info = Localization Example
In the case of the CSV file, the first column should be the "KEY". Other columns should be your localized text values, such as "French" for the first row:
KEY,English,French LABEL1,Hello,Bonjour LABEL2,Music,Musique Info,"Localization Example","Par exemple la localisation"
|
static |
Returns whether the specified key is present in the localization dictionary.
|
static |
Localize the specified value.
|
static |
Load the specified asset and activate the localization.
|
static |
Load the specified CSV file.
|
static |
Load the specified CSV file.
delegate byte [] Localization.LoadFunction | ( | string | path | ) |
|
static |
|
static |
Set the localization data directly.
|
static |
Load the specified asset and activate the localization.
|
static |
Want to have Localization loading be custom instead of just Resources.Load? Set this function.
|
static |
Whether the localization dictionary has been loaded.
|
staticgetset |
Localization dictionary. Dictionary key is the localization key. Dictionary value is the list of localized values (columns in the CSV file). Be very careful editing this via code, and be sure to set the "KEY" to the list of languages.
|
staticget |
|
staticget |
List of loaded languages. Available if a single Localization.csv file was used.
|
staticgetset |
Name of the currently active language.