TLI18n

See source code
Table of contents

The editor's view of the host app's translations. Lets code with no access to React context — a ShapeUtil, say — translate a string in the user's locale.

interface TLI18n {}

Properties

dir

dir: "ltr" | "rtl";

locale

locale: string;

Methods

translate

Translate message in the current locale, substituting values into its ICU placeholders.

Takes the whole message rather than its id so an implementation can fall back to the English and still substitute into it. A message absent from the catalog — anything not yet through Lokalise — would otherwise have to come back as its own source text, placeholders and all.

Parameters

NameDescription

message

values

Returns

string;

Prev
TLHistoryMark
Next
TLI18nMessage