Class LocalizableString
A serializable string that is localized at run-time.
Implements
Inherited Members
Namespace: Unity.Tutorials.Core.Editor
Assembly: Unity.Tutorials.Core.Editor.dll
Syntax
[Serializable]
public class LocalizableString : ISerializationCallbackReceiver
Constructors
LocalizableString()
Default-constructs with empty strings.
Declaration
public LocalizableString()
LocalizableString(string)
Constructs with an untranslated string.
Declaration
public LocalizableString(string untranslated)
Parameters
| Type | Name | Description |
|---|---|---|
| string | untranslated | The untranslated string of text |
Properties
Translated
The localized strings, if it exists.
Declaration
public string Translated { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Untranslated
Setting Untranslated string overwrites Translated so make sure to translate again.
Declaration
public string Untranslated { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Value
The translated string, if exists, untranslated otherwise.
Declaration
public string Value { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
OnAfterDeserialize()
UnityEngine.ISerializationCallbackReceiver override, do not call.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
UnityEngine.ISerializationCallbackReceiver override, do not call.
Declaration
public void OnBeforeSerialize()
Operators
implicit operator LocalizableString(string)
Implicitly constructs from an untranslated string.
Declaration
public static implicit operator LocalizableString(string untranslated)
Parameters
| Type | Name | Description |
|---|---|---|
| string | untranslated | The untranslated string of text |
Returns
| Type | Description |
|---|---|
| LocalizableString | The LocalizedString from an untranslated entry |
implicit operator string(LocalizableString)
Implicit conversion to string returns the Value.
Declaration
public static implicit operator string(LocalizableString str)
Parameters
| Type | Name | Description |
|---|---|---|
| LocalizableString | str | The LocalizableString to convert to a string |
Returns
| Type | Description |
|---|---|
| string | This LocalizableString as a string |