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

Translator

Translator with the same API as Symfony's.

Derived from https://github.com/willdurand/BazingaJsTranslationBundle which is available under the MIT License. Copyright (c) William Durand william.durand1@gmail.com

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

locale: *

public

A map of translation keys to their translated values.

Method Summary

Public Methods
public

apply(translation: *, input: *): *

public

convertNumber(number: *): *

public

pluralPosition(number: *, locale: *): number

public

pluralize(translation: *, number: *): *

public

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

public

transChoice(id: *, number: *, parameters: *): *

Public Constructors

public constructor() source

Public Members

public locale: * source

public translations: Object source

A map of translation keys to their translated values.

Public Methods

public apply(translation: *, input: *): * source

Params:

NameTypeAttributeDescription
translation *
input *

Return:

*

public convertNumber(number: *): * source

Params:

NameTypeAttributeDescription
number *

Return:

*

public pluralPosition(number: *, locale: *): number source

Params:

NameTypeAttributeDescription
number *
locale *

Return:

number

public pluralize(translation: *, number: *): * source

Params:

NameTypeAttributeDescription
translation *
number *

Return:

*

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

Params:

NameTypeAttributeDescription
id *
parameters *

Return:

*

public transChoice(id: *, number: *, parameters: *): * source

Params:

NameTypeAttributeDescription
id *
number *
parameters *

Return:

*