LocalizationSetup Class

Summary

Class storing all the setup. Translations are stored in ILocalization. LocalizationSetup is persisted on disk as an asset in Resources folder. All the ILocalization, storing the translations, are persisted as sub-assets of LocalizationSetup. At runtime, OCL class is cloning the current setup to use it as its dataSource.
Namespace
OneClickLocalization.Core
Interfaces
  • ICloneable
Base Types
  • ScriptableObject
graph BT Type-->Base0["ScriptableObject"] Type-.->Interface0["ICloneable"] Type["LocalizationSetup"] class Type type-node

Syntax

[Serializable]
public class LocalizationSetup : ScriptableObject, ICloneable

Attributes

Type Description
SerializableAttribute

Constructors

Name Summary
LocalizationSetup()

Fields

Methods

Name Value Summary
AddId(object) void
Add a new id to the localization list
AddLanguage(SystemLanguage) void
Add a new language.
Clone() object
GetAllIds() List<object>
Returns all the ids for all supported types
GetDefaultLocalizationAsset(Type) ILocalization
Returns the ILocalization for the localizationType and the default language
GetIds<T>() List<T>
Returns all the ids for a specific type. Returns an empty list if type is not supported.
GetLocalization(object, SystemLanguage) object
Get the localization for id and language. Returns null if the id is not localized or the language not supported.
GetLocalizationAsset(Type, SystemLanguage) ILocalization
Returns the ILocalization for the localizationType and language.
HasId(object) bool
Test if id is present. Id can be present but with no localization.
LoadSubAssets(bool) void
Load setup subAssets Runtime uses cloneInstances=true to isolate from editor
RemoveId(object) void
Removes an id and its localizations
RemoveLanguage(SystemLanguage) bool
Remove a language
ReplaceId(object, object) void
Replace an Id, all translations are kept, only the id changes
SetLocalization(object, SystemLanguage, object) void
Set the localization of id for language. Id is created if not present.