OCL Class

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

Methods

Name Value Summary
AddLanguage(SystemLanguage) 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(bool) List<SystemLanguage>
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) AudioClip
Returns localization of audioClipId for current language.
static
GetLocalization(AudioClip, SystemLanguage) 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) 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) Sprite
Returns localization of spriteId for current language.
static
GetLocalization(Sprite, SystemLanguage) 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) string
Returns localization of stringId for current language.
static
GetLocalization(string, SystemLanguage) 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) Texture
Returns localization of textureId for current language.
static
GetLocalization(Texture, SystemLanguage) 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
initStringsWithParameters() 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(SystemLanguage) 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(bool) void
Set Localization status.
static
SetLanguage(SystemLanguage) void
Set the languages used by OCL, has not effect if IsLanguageAuto is true.
static
setLanguageAuto(bool) void
Defines if OCL should use Application.systemLanguage (value true) or GetLanguage (value false) for localization.
static
SetLocalization(AudioClip, SystemLanguage, AudioClip) 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(object, SystemLanguage, object) 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(Sprite, SystemLanguage, Sprite) 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(string, SystemLanguage, string) 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(Texture, SystemLanguage, Texture) 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