Search Results for

    Show / Hide Table of Contents

    Class StandaloneTranslationSource

    Use this class to translate phrases in Unity Editor.

    Inheritance
    Object
    BaseTranslationSource
    StandaloneTranslationSource
    Implements
    ITranslationSource
    ILocalizationServiceComponent
    IServiceComponent<LocalizationService>
    Inherited Members
    BaseTranslationSource._translations
    BaseTranslationSource.translations
    BaseTranslationSource.LoadTranslationEntries(List<TranslationEntry>)
    BaseTranslationSource._readyToConnect
    BaseTranslationSource._connected
    BaseTranslationSource.mono
    BaseTranslationSource.IsConnected<ST>()
    BaseTranslationSource.Connect<ST>()
    BaseTranslationSource.Disconnect<ST>()
    BaseTranslationSource.Awake()
    BaseTranslationSource.Reset()
    BaseTranslationSource.GetTranslation(String, String)
    BaseTranslationSource.Clear()
    Namespace: NoSuchStudio.Localization.Source
    Assembly: NoSuchStudio-Localization.dll
    Syntax
    [ExecuteAlways]
    public class StandaloneTranslationSource : BaseTranslationSource, ITranslationSource, ILocalizationServiceComponent, IServiceComponent<LocalizationService>, ISerializationCallbackReceiver

    Properties

    persistChangesToFile

    Declaration
    public bool persistChangesToFile { get; }
    Property Value
    Type Description
    Boolean

    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
    Type Description
    String

    Methods

    AddPhrase(String)

    Declaration
    public bool AddPhrase(string phrase)
    Parameters
    Type Name Description
    String phrase
    Returns
    Type Description
    Boolean

    AddTranslation(String, String, String)

    Declaration
    public bool AddTranslation(string phrase, string locale, string value)
    Parameters
    Type Name Description
    String phrase
    String locale
    String value
    Returns
    Type Description
    Boolean

    DeletePersistentFile()

    Delete the presistent translations file. persistentFileName

    Declaration
    public void DeletePersistentFile()

    Init()

    Declaration
    protected override void Init()
    Overrides
    BaseTranslationSource.Init()

    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
    BaseTranslationSource.OnDisable()

    OnEnable()

    Declaration
    protected override void OnEnable()
    Overrides
    BaseTranslationSource.OnEnable()

    OnValidate()

    Declaration
    public void OnValidate()

    RemoveTranslation(String, String, String)

    Declaration
    public bool RemoveTranslation(string phrase, string locale, string value)
    Parameters
    Type Name Description
    String phrase
    String locale
    String value
    Returns
    Type Description
    Boolean

    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

    ITranslationSource
    ILocalizationServiceComponent
    IServiceComponent<>
    In This Article
    Back to top Generated by DocFX