i18n

Server.Modules. i18n

# new i18n(coreObj) → {Server.Modules.i18n}

This is the i18n Module of the Blackrock Application Server. It provides industry standard internationalisation and localisation support.

Parameters:
Name Type Description
coreObj Server.Modules.Core

The Core Module Singleton

Author:
  • Darren Smith
License:
  • Licensed under the LGPL license.
Returns:

module - The i18n Module Singleton

Type
Server.Modules.i18n
Example
Tbc...

Extends

Methods

# (static) addResource(lng, ns, key, value, options) → {*}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

key string

Translation Key

value string

Translation Value (for this key)

options object

Options Object

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) addResourceBundle(lng, ns, resources, deep, overwrite) → {*}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

resources array

Array of Resources

deep boolean

To be defined

overwrite boolean

To be defined

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) addResources(lng, ns, resources) → {*}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

resources array

Array of Resources

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) changeLanguage(lng, callback) → {*}

Tbc...

Parameters:
Name Type Description
lng string

Language to Change To

callback function

Callback Function

Returns:

output - True for Success, False for Failure

Type
*
Example
Tbc...

# (static) cloneInstance(options) → {object}

Tbc...

Parameters:
Name Type Description
options object

Options Object

Returns:

t - Translation App Object

Type
object
Example
Tbc...

# (static) createAppInstances(apps, cb)

Creates an i18n translation instance for each of the specified Blackrock apps

Parameters:
Name Type Description
apps array

Array of App Names

cb function

Callback Function

Example
Tbc...

# (static) createInstance(options, callback) → {object}

Tbc...

Parameters:
Name Type Description
options object

Options Object

callback function

Callback Function

Returns:

t - Translation App Object

Type
object
Example
Tbc...

# (static) dir(lng) → {*}

Tbc...

Parameters:
Name Type Description
lng string

Language

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) exists(key, options) → {*}

Tbc...

Parameters:
Name Type Description
key string

Translation Lookup Key

options object

Options Object

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) format(data, format, lng) → {*}

Tbc...

Parameters:
Name Type Description
data *

To be defined

format *

To be defined

lng string

Language

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) getDataByLanguage(lng) → {*}

Tbc...

Parameters:
Name Type Description
lng string

Language

Returns:

data - To be Defined

Type
*
Example
Tbc...

# (static) getFixedT(lng, ns) → {*}

Tbc...

Parameters:
Name Type Description
lng *

To be defined

ns *

To be defined

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) getResource(lng, ns, key, options) → {object}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

key string

Translation Key

options object

Options Object

Returns:

resource - Resource Object

Type
object
Example
Tbc...

# (static) getResourceBundle(lng, ns) → {object}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

Returns:

resourceBundle - Requested Resource Bundle

Type
object
Example
Tbc...

# (static) hasResourceBundle(lng, ns) → {boolean}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

Returns:

result - True if the namespace has the specified language, else False

Type
boolean
Example
Tbc...

# (static) init(options, callback) → {function}

Tbc...

Parameters:
Name Type Description
options object

Options Object

callback function

Callback Function

Returns:

t - The t Function

Type
function
Example
Tbc...

# (static) loadLanguages(lngs, callback) → {*}

Tbc...

Parameters:
Name Type Description
lngs string | array

Namespace(s) to Load

callback function

Callback Function

Returns:

output - True for Success, False for Failure

Type
*
Example
Tbc...

# (static) loadNamespaces(ns, callback) → {*}

Tbc...

Parameters:
Name Type Description
ns string | array

Namespace(s) to Load

callback function

Callback Function

Returns:

output - True for Success, False for Failure

Type
*
Example
Tbc...

# (static) off(name, myFn) → {*}

Tbc...

Parameters:
Name Type Description
name string

Event Name

myFn function

Function to Remove Listener From

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) on(name, myFn) → {*}

Tbc...

Parameters:
Name Type Description
name string

Event Name

myFn function

Function to Execute

Returns:

output - To be defined

Type
*
Example
Tbc...

# (static) reloadResources() → {*}

Tbc...

Returns:

output - True for Success, False for Failure

Type
*
Example
Tbc...

# (static) removeResourceBundle(lng, ns) → {boolean}

Tbc...

Parameters:
Name Type Description
lng string

Language

ns string

Namespace

Returns:

result - True if Successful, else False

Type
boolean
Example
Tbc...

# (static) setDefaultNamespace(ns) → {*}

Tbc...

Parameters:
Name Type Description
ns string

Namespace to Set as Default

Returns:

output - True for Success, False for Failure

Type
*
Example
Tbc...

# (static) t(key) → {string}

Tbc...

Parameters:
Name Type Description
key string

Lookup Key for Translation

Returns:

translation - The translated text

Type
string
Example
Tbc...

# (static) use(module) → {*}

Tbc...

Parameters:
Name Type Description
module *

To be defined

Returns:

output - To be defined

Type
*
Example
Tbc...