Represents a resource entry whose localized value is a string.
A string entry stores the text for one key in one locale, returned by IStringEntry.Value before any Smart String
formatting is applied. Whether the value is formatted as a Smart String is a per-key flag on the collection's
SharedTableData, not a property of the entry. The built-in implementation is StringEntry;
fetch one from a table with ResourceTable.GetEntry using IStringEntry or
StringEntry as the type argument.
Additional resources: StringEntry, IResourceEntry, ResourceTable, SharedTableData
<para>Read the localized text through the string entry view.</para>
using Unity.Localization; using UnityEngine;
namespace Unity.Localization.Samples { public class IStringEntryOverviewExample { public void Run() { var shared = ScriptableObject.CreateInstance<SharedTableData>(); shared.TableCollectionName = "UI Text";
var table = ScriptableObject.CreateInstance<ResourceTable>(); table.SharedData = shared; table.LocaleIdentifier = new LocaleIdentifier("en");
table.AddStringEntry("greeting", "Hello"); IStringEntry entry = table.GetEntry<IStringEntry>("greeting");
Debug.Log(entry.Value); // Hello } } }
| Property | Description |
|---|---|
| Value | The localized text for this entry, before Smart String formatting. |