Hierarchy

  • Translator

Constructors

Properties

formatter: RichMessageFormatter = ...

The underlying ICU MessageFormatter util.

translations: Translations = {}

A map of translation keys to their translated values.

Methods

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

    Returns {
        plural: ((value: string, matches: string, locale: string, values: Record<string, any>, format: ((text: string, values: Record<string, any>) => string)) => string);
        select: ((value: string, matches: string, locale: string, values: Record<string, any>, format: ((text: string, values: Record<string, any>) => string)) => string);
    }

    • plural: ((value: string, matches: string, locale: string, values: Record<string, any>, format: ((text: string, values: Record<string, any>) => string)) => string)
        • (value: string, matches: string, locale: string, values: Record<string, any>, format: ((text: string, values: Record<string, any>) => string)): string
        • Parameters

          • value: string
          • matches: string
          • locale: string
          • values: Record<string, any>
          • format: ((text: string, values: Record<string, any>) => string)
              • (text: string, values: Record<string, any>): string
              • Parameters

                • text: string
                • values: Record<string, any>

                Returns string

          Returns string

    • select: ((value: string, matches: string, locale: string, values: Record<string, any>, format: ((text: string, values: Record<string, any>) => string)) => string)
        • (value: string, matches: string, locale: string, values: Record<string, any>, format: ((text: string, values: Record<string, any>) => string)): string
        • Parameters

          • value: string
          • matches: string
          • locale: string
          • values: Record<string, any>
          • format: ((text: string, values: Record<string, any>) => string)
              • (text: string, values: Record<string, any>): string
              • Parameters

                • text: string
                • values: Record<string, any>

                Returns string

          Returns string

  • Sets the formatter's locale to the provided value.

    Parameters

    • locale: string

    Returns void

Generated using TypeDoc v0.23.24