Class: Locale

Locale(isoCode, countryCode)

Provides translations

Constructor

new Locale(isoCode, countryCode)

Instantiates a new locale.
Parameters:
Name Type Description
isoCode string ISO_639-1 code of the locale.
countryCode string ISO 3166-1 alpha-2 code of the country variant.
Source:

Methods

gen(template) → {string}

Generates a string from a template and escapes @here and @everyone mentions. Each argument replaces {n} in the input template.
Parameters:
Name Type Description
template string
Source:
Returns:
Type
string
Example
locale.gen("User {1} joined the server!", "TheBITLINK") // User TheBITLINK joined the server!
locale.gen("Not enough votes ({1}/{2})", count, required) // Not enough votes (4/9)

ugen(template) → {string}

Generates a string from a template without escaping @here and @everyone. Each argument replaces {n} in the input template.
Parameters:
Name Type Description
template string
Source:
Returns:
Type
string
Example
locale.ugen("User {1} joined the server!", "TheBITLINK") // User TheBITLINK joined the server!
locale.ugen("Not enough votes ({1}/{2})", count, required) // Not enough votes (4/9)
locale.ugen("This is a {1} mention", '@here') // This is a @here mention