Reference Source
import Translator from 'flarum/common/Translator'
public class | source

Translator

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

The underlying ICU MessageFormatter util.

public

A map of translation keys to their translated values.

Method Summary

Public Methods
public

addTranslations(translations: undefined)

public

formatterTypeHandlers(): {"plural": *, "select": *}

An extensible entrypoint for extenders to register type handlers for translations.

public

A temporary system to preprocess parameters.

public

setLocale(locale: undefined)

public

trans(id: undefined, parameters: undefined): *

Public Constructors

public constructor() source

Public Members

public formatter: * source

The underlying ICU MessageFormatter util.

public translations: {} source

A map of translation keys to their translated values.

Public Methods

public addTranslations(translations: undefined) source

Params:

NameTypeAttributeDescription
translations undefined

public formatterTypeHandlers(): {"plural": *, "select": *} source

An extensible entrypoint for extenders to register type handlers for translations.

Return:

{"plural": *, "select": *}

public preprocessParameters(parameters: undefined): * source

A temporary system to preprocess parameters. Should not be used by extensions. TODO: An extender will be added in v1.x.

Params:

NameTypeAttributeDescription
parameters undefined

Return:

*

public setLocale(locale: undefined) source

Params:

NameTypeAttributeDescription
locale undefined

public trans(id: undefined, parameters: undefined): * source

Params:

NameTypeAttributeDescription
id undefined
parameters undefined

Return:

*