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 |
---|---|
Serializable |
Constructors
Name | Summary |
---|---|
LocalizationSetup |
Fields
Name | Constant Value | Summary |
---|---|---|
active | ||
allLocalizations | ||
defaultLanguage | ||
forcedLanguage | ||
forceLanguage | ||
languages | ||
setupPersistName |
static
|
|
setupPersistPath |
static
|
|
setupResourceName |
static
|
|
use |
Methods
Name | Value | Summary |
---|---|---|
AddId |
void |
Add a new id to the localization list
|
AddLanguage |
void |
Add a new language.
|
Clone |
object | |
GetAllIds |
List |
Returns all the ids for all supported types
|
Get |
ILocalization |
Returns the ILocalization for the localizationType and the default language
|
GetIds |
List |
Returns all the ids for a specific type.
Returns an empty list if type is not supported.
|
GetLocalization |
object |
Get the localization for id and language.
Returns null if the id is not localized or the language not supported.
|
GetLocalizationAsset |
ILocalization |
Returns the ILocalization for the localizationType and language.
|
HasId |
bool |
Test if id is present.
Id can be present but with no localization.
|
LoadSubAssets |
void |
Load setup subAssets
Runtime uses cloneInstances=true to isolate from editor
|
RemoveId |
void |
Removes an id and its localizations
|
RemoveLanguage |
bool |
Remove a language
|
ReplaceId |
void |
Replace an Id, all translations are kept, only the id changes
|
SetLocalization |
void |
Set the localization of id for language.
Id is created if not present.
|