LocalizedStringList
A localized string list stored as one table entry whose value is split on a separator.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.Localization
- Assembly: UnityEngine.LocalizationRuntimeModule
- Inherits from: LocalizedString
- Implements: IVariable, ILocalizedStringList
public class LocalizedStringList : LocalizedString, IVariable, ILocalizedStringList
Remarks
The referenced entry holds every item in one value, for example , and the list splits it on LocalizedStringList.Separator. One entry keeps the items together for translators, who can reorder them per language. Splitting does not trim the value, so spaces around the separator stay part of the items.
Low,Medium,HighAdditional Resources: ILocalizedStringList, LocalizedStringGroup
Resolve a list of options and fill a dropdown.
Examples
using System.Collections.Generic;using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class LocalizedStringListExample { public async Awaitable Load() { // The entry's value holds every option, for example "Low,Medium,High". var options = new LocalizedStringList { Separator = "," }; options.SetReference("My Strings", "QUALITY OPTIONS"); List<string> values = await options.GetLocalizedListAsync(); Debug.Log(values.Count); } }}
Properties
Property | Description |
|---|---|
| Separator | The text that separates the items inside the entry's value. |