Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ILocalizer

Plugin for localizing messages sent to the user by a bot.

Hierarchy

  • ILocalizer

Index

Methods

gettext

  • gettext(locale: string, msgid: string, namespace?: string): string
  • Loads a localized string for the specified language.

    Parameters

    • locale: string

      Desired locale of the string to return.

    • msgid: string

      String to use as a key in the localized string table. Typically this will just be the english version of the string.

    • Optional namespace: string

      (Optional) namespace for the msgid keys.

    Returns string

load

  • load(locale: string, callback: function): void
  • Loads the localized table for the supplied locale, and call's the supplied callback once the load is complete.

    Parameters

    • locale: string

      The locale to load.

    • callback: function

      callback that is called once the supplied locale has been loaded, or an error if the load fails.

        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

ngettext

  • ngettext(locale: string, msgid: string, msgid_plural: string, count: number, namespace?: string): string
  • Loads the plural form of a localized string for the specified language.

    Parameters

    • locale: string

      Desired locale of the string to return.

    • msgid: string

      Singular form of the string to use as a key in the localized string table.

    • msgid_plural: string

      Plural form of the string to use as a key in the localized string table.

    • count: number

      Count to use when determining whether the singular or plural form of the string should be used.

    • Optional namespace: string

      (Optional) namespace for the msgid and msgid_plural keys.

    Returns string

trygettext

  • trygettext(locale: string, msgid: string, namespace?: string): string
  • Loads a localized string for the specified language.

    Parameters

    • locale: string

      Desired locale of the string to return.

    • msgid: string

      String to use as a key in the localized string table. Typically this will just be the english version of the string.

    • Optional namespace: string

      (Optional) namespace for the msgid keys.

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method