TranslationBundle: {
    __(msgid, ...args): string;
    _n(msgid, msgid_plural, n, ...args): string;
    _np(msgctxt, msgid, msgid_plural, n, ...args): string;
    _p(msgctxt, msgid, ...args): string;
    dcnpgettext(domain, msgctxt, msgid, msgid_plural, n, ...args): string;
    gettext(msgid, ...args): string;
    ngettext(msgid, msgid_plural, n, ...args): string;
    npgettext(msgctxt, msgid, msgid_plural, n, ...args): string;
    pgettext(msgctxt, msgid, ...args): string;
}

Bundle of gettext-based translation functions for a specific domain.

Type declaration

  • __:function
    • Alias for gettext (translate strings without number inflection)

      Parameters

      • msgid: string

        message (text to translate)

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • _n:function
    • Alias for ngettext (translate accounting for plural forms)

      Parameters

      • msgid: string

        message for singular

      • msgid_plural: string

        message for plural

      • n: number

        determines which plural form to use

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • _np:function
    • Alias for npgettext (translate accounting for plural forms in given context)

      Parameters

      • msgctxt: string

        context

      • msgid: string

        message for singular

      • msgid_plural: string

        message for plural

      • n: number

        number used to determine which plural form to use

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • _p:function
    • Alias for pgettext (translate in given context)

      Parameters

      • msgctxt: string

        context

      • msgid: string

        message (text to translate)

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • dcnpgettext:function
    • Do a plural-forms lookup of a message id. msgid is used as the message id for purposes of lookup in the catalog, while n is used to determine which plural form to use. Otherwise, when n is 1 msgid is returned, and msgid_plural is returned in all other cases.

      Parameters

      • domain: string

        The translations domain.

      • msgctxt: string

        The message context.

      • msgid: string

        The singular string to translate.

      • msgid_plural: string

        The plural string to translate.

      • n: number

        The number for pluralization.

      • Rest ...args: any[]

        Any additional values to use with interpolation

      Returns string

      A translated string if found, or the original string.

  • gettext:function
    • Look up the message id in the catalog and return the corresponding message string. Otherwise, the message id is returned.

      Parameters

      • msgid: string

        message (text to translate)

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • ngettext:function
    • Do a plural-forms lookup of a message id. msgid is used as the message id for purposes of lookup in the catalog, while n is used to determine which plural form to use. Otherwise, when n is 1 msgid is returned, and msgid_plural is returned in all other cases.

      Parameters

      • msgid: string

        message for singular

      • msgid_plural: string

        message for plural

      • n: number

        determines which plural form to use

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • npgettext:function
    • Do a plural-forms lookup of a message id. msgid is used as the message id for purposes of lookup in the catalog, while n is used to determine which plural form to use. Otherwise, when n is 1 msgid is returned, and msgid_plural is returned in all other cases.

      Parameters

      • msgctxt: string

        context

      • msgid: string

        message for singular

      • msgid_plural: string

        message for plural

      • n: number

        number used to determine which plural form to use

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.

  • pgettext:function
    • Look up the context and message id in the catalog and return the corresponding message string. Otherwise, the message id is returned.

      Parameters

      • msgctxt: string

        context

      • msgid: string

        message (text to translate)

      • Rest ...args: any[]

      Returns string

      A translated string if found, or the original string.