Translator
Translator =
object
Defined in: translator.ts:13
What an application holds: a negotiated chain of catalogues, and a lookup that always answers.
Where a MessageCatalogue answers null for a message it lacks, a
translator falls through to the next catalogue in the chain and finally to
the source text, so a call site never has to handle a miss.
Properties
Section titled “Properties”locales
Section titled “locales”
readonlylocales: readonlystring[]
Defined in: translator.ts:15
The catalogue locales that were selected, most preferred first.
Methods
Section titled “Methods”getMessage()
Section titled “getMessage()”getMessage(
id,options?):string
Defined in: translator.ts:17
The translation of id, or id itself when nothing carries it.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”string
getPluralMessage()
Section titled “getPluralMessage()”getPluralMessage(
id,pluralId,count,options?):string
Defined in: translator.ts:23
The translation of id for count, or the untranslated source text — id
for one, pluralId otherwise, which is the English rule gettext applies
when a message is missing.
Parameters
Section titled “Parameters”string
pluralId
Section titled “pluralId”string
number
options?
Section titled “options?”Returns
Section titled “Returns”string