Skip to content

API Function tHtml

github-actions[bot] edited this page Nov 30, 2026 · 2 revisions

Function: tHtml()

function tHtml(key, args?): string;

Defined in: src/engine/localisation/t.ts:47

ADR 0429: the message of key as inline HTML, for {@html tHtml("hud.coins", { count })} in a Svelte component. A message may carry the inline subset (You have <b>{count}</b> coins; translators keep the tags), which then draws as styled runs. Each string argument is escaped, so text from a player (a name) shows as typed and can never add markup; numbers and dates format as in t, and a LocalText argument is another message, kept as written, with its own string arguments escaped the same way. Follows language changes as t does.

Parameters

key

string

args?

Readonly<Record<string, MessageArg>>

Returns

string

Clone this wiki locally