ILocalizer interface
Plugin for localizing messages sent to the user by a bot.
Methods
gettext(string, string) | Loads a localized string for the specified language. |
ngettext(string, string, string, number) | Loads the plural form of a localized string for the specified language. |
Method Details
gettext(string, string)
Loads a localized string for the specified language.
function gettext(language: string, msgid: string)
Parameters
- language
-
string
Desired language 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.
Returns
string
ngettext(string, string, string, number)
Loads the plural form of a localized string for the specified language.
function ngettext(language: string, msgid: string, msgid_plural: string, count: number)
Parameters
- language
-
string
Desired language 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.
Returns
string