Interface I18N<KeyType>

The i18n information of a bundle.

interface I18N<KeyType> {
    get<ExpectedType>(locale?): ExpectedType;
    load(locale?): Promise<I18N<KeyType>>;
    loc<ExpectedType>(key, locale?): ExpectedType;
}

Type Parameters

Methods

Methods

  • Get all i18n entries of the bundle.

    Type Parameters

    Parameters

    • Optional locale: string

      e.g. de or en (optional)

    Returns ExpectedType

    the i18n data

  • Loads the i18n data. This method is used during the 'resolve' phase of a bundle.

    Parameters

    • Optional locale: string

      e.g. de, en. (optional)

    Returns Promise<I18N<KeyType>>

    a promise resolving to the i18n data.

  • Look up an i18n value for a given key. Note, that this method supports chained keys, e.g. "a.b" This will return 1 from the i18n data structure { 'a': { 'b': '1' }}

    Type Parameters

    Parameters

    • key: string

      the i18n key.

    • Optional locale: string

      e.g. de or en (optional)

    Returns ExpectedType

    the i18n value

Generated using TypeDoc