Skip to content

Class: TranslationCore

utilities/translation-core.TranslationCore

Constructors

constructor

new TranslationCore(options?): TranslationCore

Parameters

NameType
options?Partial<TranslationOptions>

Returns

TranslationCore

Defined in

src/utilities/translation-core.ts:291

Accessors

locale

get locale(): string

Returns

string

Defined in

src/utilities/translation-core.ts:325

set locale(val): void

Parameters

NameType
valstring

Returns

void

Defined in

src/utilities/translation-core.ts:329

Methods

_preTransform

_preTransform(key, phrase, options, settings?): [MessageAST, any, string]

Parameters

NameType
keystring
phrasestring
optionsany
settingsParseTranslationSettings

Returns

[MessageAST, any, string]

Defined in

src/utilities/translation-core.ts:517


_processAST

_processAST(ast, data, locale): any[]

Parameters

NameType
astMessageAST
dataany
localestring

Returns

any[]

Defined in

src/utilities/translation-core.ts:612


clear

clear(): void

Returns

void

Defined in

src/utilities/translation-core.ts:507


extend

extend(phrases, prefix?): string[]

Parameters

NameType
phrasesRecursivePhraseMap
prefix?string

Returns

string[]

Defined in

src/utilities/translation-core.ts:448


formatCurrency

formatCurrency(value, currency): string

Parameters

NameType
valuenumber | bigint
currencystring

Returns

string

Defined in

src/utilities/translation-core.ts:354


formatDate

formatDate(value, format?): string

Parameters

NameType
valuestring | number | Date
format?string

Returns

string

Defined in

src/utilities/translation-core.ts:391


formatDateTime

formatDateTime(value, format?): string

Parameters

NameType
valuestring | number | Date
format?string

Returns

string

Defined in

src/utilities/translation-core.ts:429


formatDuration

formatDuration(value): string

Parameters

NameType
valuenumber

Returns

string

Defined in

src/utilities/translation-core.ts:387


formatNode

formatNode(node, data, locale, out, ast): any

Parameters

NameType
nodeMessageNode
dataany
localenull | string
outany[]
astMessageAST

Returns

any

Defined in

src/utilities/translation-core.ts:584


formatNumber

formatNumber(value, format): string

Parameters

NameType
valuenumber | bigint
formatstring

Returns

string

Defined in

src/utilities/translation-core.ts:368


formatRelativeTime

formatRelativeTime(value, format?): string

Parameters

NameType
valuestring | number | Date
format?string

Returns

string

Defined in

src/utilities/translation-core.ts:343


formatTime

formatTime(value, format?): string

Parameters

NameType
valuestring | number | Date
format?string

Returns

string

Defined in

src/utilities/translation-core.ts:410


has

has(key): boolean

Parameters

NameType
keystring

Returns

boolean

Defined in

src/utilities/translation-core.ts:497


replace

replace(phrases): void

Parameters

NameType
phrasesRecursivePhraseMap

Returns

void

Defined in

src/utilities/translation-core.ts:512


set

set(key, phrase): void

Parameters

NameType
keystring
phrasestring

Returns

void

Defined in

src/utilities/translation-core.ts:501


t

t(key, phrase, data, settings?): string

Parameters

NameType
keystring
phrasestring
dataany
settings?ParseTranslationSettings

Returns

string

Defined in

src/utilities/translation-core.ts:576


tList

tList(key, phrase, data, settings?): any[]

Parameters

NameType
keystring
phrasestring
dataany
settings?ParseTranslationSettings

Returns

any[]

Defined in

src/utilities/translation-core.ts:580


toLocaleString

toLocaleString(thing): any

Parameters

NameType
thingany

Returns

any

Defined in

src/utilities/translation-core.ts:337


unset

unset(phrases, prefix): void

Parameters

NameType
phrasesstring | string[]
prefixstring

Returns

void

Defined in

src/utilities/translation-core.ts:479