messageformat

  • Version 2.3.0
  • Published
  • 315 kB
  • 3 dependencies
  • MIT license

Install

npm i messageformat
yarn add messageformat
pnpm add messageformat

Overview

PluralFormat and SelectFormat Message and i18n Tool - A JavaScript Implemenation of the ICU standards.

Index

Classes

class MessageFormat

class MessageFormat {}

    constructor

    constructor(
    locales?: string | { [locale: string]: Function } | string[],
    options?: MessageFormat.Options
    );

      property addFormatters

      addFormatters: (format: { [name: string]: MessageFormat.Formatter }) => this;

        property compile

        compile: (
        messages: MessageFormat.SrcMessage,
        locale?: string
        ) => MessageFormat.Msg;

          property disablePluralKeyChecks

          disablePluralKeyChecks: () => this;

            property setBiDiSupport

            setBiDiSupport: (enable: boolean) => this;

              property setStrictNumberSign

              setStrictNumberSign: (enable: boolean) => this;

                Interfaces

                interface Options

                interface Options {}

                  property biDiSupport

                  biDiSupport?: boolean;

                    property customFormatters

                    customFormatters?: { [name: string]: Formatter };

                      property pluralKeyChecks

                      pluralKeyChecks?: boolean;

                        property strictNumberSign

                        strictNumberSign?: boolean;

                          interface SrcObject

                          interface SrcObject {}

                            index signature

                            [key: string]: SrcMessage;

                              Type Aliases

                              type Formatter

                              type Formatter = (val: any, lc: string, arg?: string) => string;

                                type Msg

                                type Msg = { (params: {}): string; toString(global?: string): string };

                                  type SrcMessage

                                  type SrcMessage = string | SrcObject;

                                    Package Files (1)

                                    Dependencies (3)

                                    Dev Dependencies (7)

                                    Peer Dependencies (0)

                                    No peer dependencies.

                                    Badge

                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/messageformat.

                                    • Markdown
                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/messageformat)
                                    • HTML
                                      <a href="https://www.jsdocs.io/package/messageformat"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>