Global

Methods

F(item, fmtName) → {string|Array.<string>}

Format given item
Parameters:
Name Type Description
item string | number | Array.<string> | Array.<number> string, number or array to be translated
fmtName string name of formatter
Source:
Returns:
Type
string | Array.<string>

getLang()

Get current language
Source:

L(lang, error, successopt)

Set current language
Parameters:
Name Type Attributes Default Description
lang string locale string
error function call when setting failed
success function <optional>
reload call when setting success
Source:

register(fmtName, func)

Register formatters
Parameters:
Name Type Description
fmtName string formatter name
func fmtFunction formatter function
Source:

T(item, interpolations) → {string|Array.<string>}

Translate given string
Parameters:
Name Type Description
item string | Array.<string> string or array to be translated
interpolations object interpolations of placeholders in template
Source:
Returns:
Type
string | Array.<string>

Type Definitions

fmtFunction(content, lang) → {string}

Parameters:
Name Type Description
content string | number content to be formatted
lang string locale string
Source:
Returns:
format result
Type
string

getTransFile(lang, resolve) → {string|string}

Parameters:
Name Type Description
lang object
Properties
Name Type Description
systemLang string system language
selectedLang string stored language
resolve function
Source:
Returns:
  • format result
    Type
    string
  • selected language
    Type
    string

readyCallback(switcher)

Parameters:
Name Type Description
switcher object the created instance
Source: