|
Smart Localization
2.3
|
The language worker class for runtime language handling More...
Public Member Functions | |
| void | ChangeLanguage (SmartCultureInfo cultureInfo) |
| Change the language into a specified culture More... | |
| void | ChangeLanguage (string languageCode) |
| Change the language into a specified culture More... | |
| void | ChangeLanguageWithData (string languageDataInResX, string languageCode) |
| Tries to load a language with the specified data. Loading data from outside the project currently only supports text unless the asset is apparent(and correctly named in the right folder) in the workspace. More... | |
| bool | AppendLanguageWithTextData (string languageDataInResX) |
| Appends the current language with text data. The method does not support appending localized assets. If duplicates are found, the old value will be overwritten with the new one. More... | |
| bool | IsLanguageSupported (string languageCode) |
| Checks if the language is supported by this application languageName = strings like "en", "es", "sv" More... | |
| bool | IsLanguageSupportedEnglishName (string englishName) |
| Checks if the language is supported with the english name. i.e. "English" "French" etc. More... | |
| bool | IsLanguageSupported (SmartCultureInfo cultureInfo) |
| Checks if a language is supported with a culture info class More... | |
| SmartCultureInfo | GetCultureInfo (string languageCode) |
| Gets the culture info from the available languages list. If the language is not supported it will return null More... | |
| string | GetSystemLanguageEnglishName () |
| Gets the name of the system language in an english name. If its SystemLanguage.Unknown, a string with the value "Unknown" will be returned. More... | |
| SmartCultureInfo | GetSupportedSystemLanguage () |
| Gets the smart culture info of the system language if it is supported. otherwise it will return null More... | |
| string | GetSupportedSystemLanguageCode () |
| Gets the language code of the system language if it is supported. otherwise it will return an empty string. More... | |
| List< SmartCultureInfo > | GetSupportedLanguages () |
| Returns a list of all the supported languages in the project More... | |
| List< string > | GetKeysWithinCategory (string category) |
| Returns a list of keys within a specified category. Example: If you have keys named My.Key, the category would be "My." More... | |
| string | GetTextValue (string key) |
| Returns a text value in the current language for the key. Returns null if nothing is found. More... | |
| AudioClip | GetAudioClip (string key) |
| Gets the audio clip for the current language, returns null if nothing is found More... | |
| GameObject | GetPrefab (string key) |
| Gets the prefab game object for the current language, returns null if nothing is found More... | |
| Texture | GetTexture (string key) |
| Gets a texture for the current language, returns null if nothing is found More... | |
| bool | HasKey (string key) |
| Returns whether or not the key is available in the system. More... | |
Static Public Member Functions | |
| static void | SetDontDestroyOnLoad () |
| Sets DontDestroyOnLoad flag on the LanguageManager object. More... | |
Public Attributes | |
| ChangeLanguageEventHandler | OnChangeLanguage |
| Occurs when a new language is loaded and initialized create a delegate method(ChangeLanguage(LanguageManager languageManager)) and subscribe More... | |
| string | defaultLanguage = "en" |
| The default language More... | |
Properties | |
| static LanguageManager | Instance [get] |
| Returns an instance of the language manager. Creates a new one if no one exist. If you don't want to create a new one, check the LanguageManager.HasInstance variable first. More... | |
| static bool | HasInstance [get] |
| Returns if there is an active instance of the language manager in the game. More... | |
| SortedDictionary< string, LocalizedObject > | LanguageDatabase [get] |
| The loaded language values of the currently loaded language More... | |
| Dictionary< string, string > | RawTextDatabase [get] |
| Gets all the language values in raw text. NOTE: Potentially performance expensive. Use with caution. More... | |
| int | NumberOfSupportedLanguages [get] |
| The number of supported languages in this project More... | |
| string | LoadedLanguage [get] |
| The language code of the currently loaded language More... | |
| SmartCultureInfo | CurrentlyLoadedCulture [get] |
| Gets the currently loaded SmartCultureInfo. More... | |
| bool | VerboseLogging [get, set] |
| Set this to true if you want extensive error logging More... | |
The language worker class for runtime language handling
| bool SmartLocalization.LanguageManager.AppendLanguageWithTextData | ( | string | languageDataInResX | ) |
Appends the current language with text data. The method does not support appending localized assets. If duplicates are found, the old value will be overwritten with the new one.
| languageDataInResX | The language data to append in the .resx format |
| void SmartLocalization.LanguageManager.ChangeLanguage | ( | SmartCultureInfo | cultureInfo | ) |
Change the language into a specified culture
| cultureInfo | The culture to change to |
| void SmartLocalization.LanguageManager.ChangeLanguage | ( | string | languageCode | ) |
Change the language into a specified culture
| languageCode | The culture to change to |
| void SmartLocalization.LanguageManager.ChangeLanguageWithData | ( | string | languageDataInResX, |
| string | languageCode | ||
| ) |
Tries to load a language with the specified data. Loading data from outside the project currently only supports text unless the asset is apparent(and correctly named in the right folder) in the workspace.
| languageDataInResX | The language data to load in the .resx format |
| languageCode | The ISO-639 code of the language to load |
| AudioClip SmartLocalization.LanguageManager.GetAudioClip | ( | string | key | ) |
Gets the audio clip for the current language, returns null if nothing is found
| SmartCultureInfo SmartLocalization.LanguageManager.GetCultureInfo | ( | string | languageCode | ) |
Gets the culture info from the available languages list. If the language is not supported it will return null
| List<string> SmartLocalization.LanguageManager.GetKeysWithinCategory | ( | string | category | ) |
Returns a list of keys within a specified category. Example: If you have keys named My.Key, the category would be "My."
| category | If you have keys named My.Key, the category would be "My." |
| GameObject SmartLocalization.LanguageManager.GetPrefab | ( | string | key | ) |
Gets the prefab game object for the current language, returns null if nothing is found
| List<SmartCultureInfo> SmartLocalization.LanguageManager.GetSupportedLanguages | ( | ) |
Returns a list of all the supported languages in the project
| SmartCultureInfo SmartLocalization.LanguageManager.GetSupportedSystemLanguage | ( | ) |
Gets the smart culture info of the system language if it is supported. otherwise it will return null
| string SmartLocalization.LanguageManager.GetSupportedSystemLanguageCode | ( | ) |
Gets the language code of the system language if it is supported. otherwise it will return an empty string.
| string SmartLocalization.LanguageManager.GetSystemLanguageEnglishName | ( | ) |
Gets the name of the system language in an english name. If its SystemLanguage.Unknown, a string with the value "Unknown" will be returned.
| Texture SmartLocalization.LanguageManager.GetTexture | ( | string | key | ) |
Gets a texture for the current language, returns null if nothing is found
| string SmartLocalization.LanguageManager.GetTextValue | ( | string | key | ) |
Returns a text value in the current language for the key. Returns null if nothing is found.
| bool SmartLocalization.LanguageManager.HasKey | ( | string | key | ) |
Returns whether or not the key is available in the system.
| bool SmartLocalization.LanguageManager.IsLanguageSupported | ( | string | languageCode | ) |
Checks if the language is supported by this application languageName = strings like "en", "es", "sv"
| bool SmartLocalization.LanguageManager.IsLanguageSupported | ( | SmartCultureInfo | cultureInfo | ) |
Checks if a language is supported with a culture info class
| cultureInfo | The culture info to check |
| bool SmartLocalization.LanguageManager.IsLanguageSupportedEnglishName | ( | string | englishName | ) |
Checks if the language is supported with the english name. i.e. "English" "French" etc.
| englishName | The english name of the language |
|
static |
Sets DontDestroyOnLoad flag on the LanguageManager object.
| string SmartLocalization.LanguageManager.defaultLanguage = "en" |
The default language
| ChangeLanguageEventHandler SmartLocalization.LanguageManager.OnChangeLanguage |
Occurs when a new language is loaded and initialized create a delegate method(ChangeLanguage(LanguageManager languageManager)) and subscribe
|
get |
Gets the currently loaded SmartCultureInfo.
The currently loaded culture.
|
staticget |
Returns if there is an active instance of the language manager in the game.
|
staticget |
Returns an instance of the language manager. Creates a new one if no one exist. If you don't want to create a new one, check the LanguageManager.HasInstance variable first.
|
get |
The loaded language values of the currently loaded language
|
get |
The language code of the currently loaded language
|
get |
The number of supported languages in this project
|
get |
Gets all the language values in raw text. NOTE: Potentially performance expensive. Use with caution.
|
getset |
Set this to true if you want extensive error logging