Class: TranslationCore
utilities/translation-core.TranslationCore
Constructors
constructor
• new TranslationCore(options?
): TranslationCore
Parameters
Name | Type |
---|---|
options? | Partial <TranslationOptions > |
Returns
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
Name | Type |
---|---|
val | string |
Returns
void
Defined in
src/utilities/translation-core.ts:329
Methods
_preTransform
▸ _preTransform(key
, phrase
, options
, settings?
): [MessageAST
, any
, string
]
Parameters
Name | Type |
---|---|
key | string |
phrase | string |
options | any |
settings | ParseTranslationSettings |
Returns
[MessageAST
, any
, string
]
Defined in
src/utilities/translation-core.ts:517
_processAST
▸ _processAST(ast
, data
, locale
): any
[]
Parameters
Name | Type |
---|---|
ast | MessageAST |
data | any |
locale | string |
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
Name | Type |
---|---|
phrases | RecursivePhraseMap |
prefix? | string |
Returns
string
[]
Defined in
src/utilities/translation-core.ts:448
formatCurrency
▸ formatCurrency(value
, currency
): string
Parameters
Name | Type |
---|---|
value | number | bigint |
currency | string |
Returns
string
Defined in
src/utilities/translation-core.ts:354
formatDate
▸ formatDate(value
, format?
): string
Parameters
Name | Type |
---|---|
value | string | number | Date |
format? | string |
Returns
string
Defined in
src/utilities/translation-core.ts:391
formatDateTime
▸ formatDateTime(value
, format?
): string
Parameters
Name | Type |
---|---|
value | string | number | Date |
format? | string |
Returns
string
Defined in
src/utilities/translation-core.ts:429
formatDuration
▸ formatDuration(value
): string
Parameters
Name | Type |
---|---|
value | number |
Returns
string
Defined in
src/utilities/translation-core.ts:387
formatNode
▸ formatNode(node
, data
, locale
, out
, ast
): any
Parameters
Name | Type |
---|---|
node | MessageNode |
data | any |
locale | null | string |
out | any [] |
ast | MessageAST |
Returns
any
Defined in
src/utilities/translation-core.ts:584
formatNumber
▸ formatNumber(value
, format
): string
Parameters
Name | Type |
---|---|
value | number | bigint |
format | string |
Returns
string
Defined in
src/utilities/translation-core.ts:368
formatRelativeTime
▸ formatRelativeTime(value
, format?
): string
Parameters
Name | Type |
---|---|
value | string | number | Date |
format? | string |
Returns
string
Defined in
src/utilities/translation-core.ts:343
formatTime
▸ formatTime(value
, format?
): string
Parameters
Name | Type |
---|---|
value | string | number | Date |
format? | string |
Returns
string
Defined in
src/utilities/translation-core.ts:410
has
▸ has(key
): boolean
Parameters
Name | Type |
---|---|
key | string |
Returns
boolean
Defined in
src/utilities/translation-core.ts:497
replace
▸ replace(phrases
): void
Parameters
Name | Type |
---|---|
phrases | RecursivePhraseMap |
Returns
void
Defined in
src/utilities/translation-core.ts:512
set
▸ set(key
, phrase
): void
Parameters
Name | Type |
---|---|
key | string |
phrase | string |
Returns
void
Defined in
src/utilities/translation-core.ts:501
t
▸ t(key
, phrase
, data
, settings?
): string
Parameters
Name | Type |
---|---|
key | string |
phrase | string |
data | any |
settings? | ParseTranslationSettings |
Returns
string
Defined in
src/utilities/translation-core.ts:576
tList
▸ tList(key
, phrase
, data
, settings?
): any
[]
Parameters
Name | Type |
---|---|
key | string |
phrase | string |
data | any |
settings? | ParseTranslationSettings |
Returns
any
[]
Defined in
src/utilities/translation-core.ts:580
toLocaleString
▸ toLocaleString(thing
): any
Parameters
Name | Type |
---|---|
thing | any |
Returns
any
Defined in
src/utilities/translation-core.ts:337
unset
▸ unset(phrases
, prefix
): void
Parameters
Name | Type |
---|---|
phrases | string | string [] |
prefix | string |
Returns
void