Summary
One Click Localization Manager.
Use this class to access localizations and to modify its setup.
- Namespace
- OneClickLocalization
- Base Types
-
- object
graph BT
Type-->Base0["object"]
Type["OCL"]
class Type type-node
Syntax
public class OCL
Fields
Name | Constant Value | Summary |
---|---|---|
onActiveChanged |
static
|
|
onLanguageChanged |
static
|
|
onLanguagesChanged |
static
|
|
on |
static
|
|
parameterPattern |
static
|
|
runtimeSetup |
static
|
|
strings |
static
|
|
strings |
static
|
Methods
Name | Value | Summary |
---|---|---|
AddLanguage |
void |
Add a new language.
Has no effect if language is already in GetLanguages
static
|
GetLanguage |
SystemLanguage |
Returns language used by OCL.
If IsLanguageAuto is true : returns Application.systemLanguage.
If IsLanguageAuto is false : returns language defined with SetLanguage.
Default value is SystemLanguage.English
static
|
GetLanguages |
List |
Returns languages.
Use AddLanguage to add a new one and RemoveLanguage to remove one.
If addDefaultLanguage is false, defaultLanguage won't be returned in the list.
static
|
GetLocalization |
AudioClip |
Returns localization of audioClipId for current language.
static
|
GetLocalization |
AudioClip |
Returns localization of audioClipId for language.
This method shouldn't be called directly as it won't handle active, defaultLanguage, useDefaultLanguageForNullValues and forceLanguage parameters.
Call it only if you need to access localization data directly without taking care of OCL setup.
static
|
GetLocalization |
object |
Generic version of GetLocalization.
Returns localization for id and current language.
Supported types are :
- string
- Texture
- Sprite
- AudioClip
Returns null if id has no localization for current language or id's type is not supported.
static
|
GetLocalization |
Sprite |
Returns localization of spriteId for current language.
static
|
GetLocalization |
Sprite |
Returns localization of spriteId for language.
This method shouldn't be called directly as it won't handle active, defaultLanguage, useDefaultLanguageForNullValues and forceLanguage parameters.
Call it only if you need to access localization data directly without taking care of OCL setup.
static
|
GetLocalization |
string |
Returns localization of stringId for current language.
static
|
GetLocalization |
string |
Returns localization of stringId for language.
This method shouldn't be called directly as it won't handle active, defaultLanguage, useDefaultLanguageForNullValues and forceLanguage parameters.
Call it only if you need to access localization data directly without taking care of OCL setup.
static
|
GetLocalization |
Texture |
Returns localization of textureId for current language.
static
|
GetLocalization |
Texture |
Returns localization of textureId for language.
This method shouldn't be called directly as it won't handle active, defaultLanguage and forceLanguage parameters.
Call it only if you need to access localization data directly without taking care of OCL setup.
static
|
init |
void |
Initialize the cache for strings with parameters to make lookup faster
static
|
IsActive |
bool |
Returns if Localization is active.
static
|
IsLanguageAuto |
bool |
If true, OCL uses Application.systemLanguage for localization.
If false, OCL uses GetCustomLanguage for localization
static
|
RemoveLanguage |
void |
Removes a language.
Has no effect if language is not in GetLanguages.
By removing a language, you lose all translations attached to it.
static
|
SetActive |
void |
Set Localization status.
static
|
SetLanguage |
void |
Set the languages used by OCL, has not effect if IsLanguageAuto is true.
static
|
setLanguageAuto |
void |
Defines if OCL should use Application.systemLanguage (value true) or GetLanguage (value false) for localization.
static
|
SetLocalization |
void |
Set the AudioClip translation for id and language
Has no effect if language is not in GetLanguages. Use AddLanguage to add a new language.
static
|
SetLocalization |
void |
Generic version of SetLocalization.
Set the translation for id and language.
Has no effect if language is not in GetLanguages. Use AddLanguage to add a new language.
static
|
SetLocalization |
void |
Set the Sprite translation id and language
Has no effect if language is not in GetLanguages. Use AddLanguage to add a new language.
static
|
SetLocalization |
void |
Set the string translation for id and language.
Has no effect if language is not in GetLanguages. Use AddLanguage to add a new language.
static
|
SetLocalization |
void |
Set the Texture translation for id and language
Has no effect if language is not in GetLanguages. Use AddLanguage to add a new language.
static
|