StringTable

A locale-tagged collection of stable localization keys. One table is one .strings asset, holding the entries for exactly one locale.

Remarks

Keys are matched case-sensitively on purpose: they are authored identifiers such as menu.file, and folding case would make two keys that differ only in case collide.

Properties

Locale

(string) : The locale this table holds strings for.

Entries

(IReadOnlyCollection): Every entry, in insertion order.

Public Methods

Add

public void Add(StringTableEntry entry)

Adds an entry, replacing any entry with the same key.

Parameters:

  • entry (StringTableEntry): The entry to add.

TryGet

public bool TryGet(string key, StringTableEntry entry)

Looks up an entry by its exact key.

Parameters:

  • key (string): The localization key.
  • entry (StringTableEntry): The entry, when found.

Returns: bool

  • true when the table holds the key.

Get

public string? Get(string key, decimal? count = null)

Resolves a key to its translated (or source) string, without formatting plural blocks. The count is used only to pick a plural variant; formatting is LocaleService's job.

Parameters:

  • key (string): The localization key.
  • count (decimal?): The count a plural message selects its variant from, or null. (Default: null)

Returns: string?

  • The raw value, or null when the key is absent.