Class StandaloneTranslationSource
Use this class to translate phrases in Unity Editor.
Inheritance
StandaloneTranslationSource
Assembly: NoSuchStudio-Localization.dll
Syntax
[ExecuteAlways]
public class StandaloneTranslationSource : BaseTranslationSource, ITranslationSource, ILocalizationServiceComponent, IServiceComponent<LocalizationService>, ISerializationCallbackReceiver
Properties
persistChangesToFile
Declaration
public bool persistChangesToFile { get; }
Property Value
persistentFileName
The name of the persistent file to back up the translations to. If the persistChangesToFile flag is set, this file gets used to store translations between sessions.
Declaration
public string persistentFileName { get; set; }
Property Value
Methods
AddPhrase(String)
Declaration
public bool AddPhrase(string phrase)
Parameters
| Type |
Name |
Description |
| String |
phrase |
|
Returns
AddTranslation(String, String, String)
Declaration
public bool AddTranslation(string phrase, string locale, string value)
Parameters
Returns
DeletePersistentFile()
Declaration
public void DeletePersistentFile()
Init()
Declaration
protected override void Init()
Overrides
LoadTranslationsFromFile()
Load translations from the persistent file. Load is additive, meaning new translations will be added, duplicate ones will get overriden but no translations will get deleted.
persistentFileName
Declaration
public void LoadTranslationsFromFile()
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
OnValidate()
Declaration
RemoveTranslation(String, String, String)
Declaration
public bool RemoveTranslation(string phrase, string locale, string value)
Parameters
Returns
SaveTranslationsToFile()
Writes the current translations to a file. If persistChangesToFile flag is set, the file is loaded on load automatically.
Declaration
public void SaveTranslationsToFile()
Implements
IServiceComponent<>