Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

public class LocalizedStringList : LocalizedString, IVariable, ILocalizedStringList

Remarks

The referenced entry holds every item in one value, for example
Low,Medium,High
, 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.
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

SeparatorThe text that separates the items inside the entry's value.

Inheritance