Class FileTranslationSource
Base class for translation sources that are backed by a file. This class reads the translations from the backing file and registers them with LocalizationService.
Inheritance
FileTranslationSource
Inherited Members
Namespace: NoSuchStudio.Localization
Assembly: NoSuchStudio-Localization.dll
Syntax
[ExecuteInEditMode]
public abstract class FileTranslationSource : BaseTranslationSource, ITranslationSource, ILocalizationServiceComponent, IServiceComponent<LocalizationService>
Fields
_error
Declaration
protected string _error
Field Value
| Type | Description |
|---|---|
| String |
_textAsset
The backing text asset.
Declaration
[SerializeField]
protected TextAsset _textAsset
Field Value
| Type | Description |
|---|---|
| UnityEngine.TextAsset |
Properties
error
Declaration
public string error { get; }
Property Value
| Type | Description |
|---|---|
| String |
textAsset
Declaration
public TextAsset textAsset { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.TextAsset |
Methods
OnValidate()
Declaration
public virtual void OnValidate()
ReadTranslationsFromFile()
Subclasses should implement this method to read the file contents and populate the _translations field.
Declaration
protected abstract List<TranslationEntry> ReadTranslationsFromFile()
Returns
| Type | Description |
|---|---|
| List<TranslationEntry> |
Reload()
Declaration
public void Reload()
Reset()
Declaration
protected override void Reset()
Overrides
Start()
Declaration
protected virtual void Start()
Implements
IServiceComponent<>