Internationalisation (i18n)
Loads and parse lang files for use by Larynx and specifically phrase, the Larynx Handlebars helper
As the phrase helper is essentially a Handlebars template in its own right, it can contain variables and nested phrases
Returns
BauplanI18N
- Type
- instance
- Source:
- See:
-
- phrase
Methods
defaultlang() → {string}
Gets the default language as specified in the config
- Source:
Returns
Default language
- Type
- string
init(callback)
Parameters
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
load(langs, callback)
Load app lang files
Parameters
Name | Type | Description |
---|---|---|
langs |
object | Language path key/value pairs |
callback |
function |
- Source:
parse(data) → {object}
Parses a string representing a resource bundle .properties file
- lines beginning with comments are ignored
- values can span multiple lines
Parameters
Name | Type | Description |
---|---|---|
data |
string |
- Source:
Returns
lang
- Type
- object
process(langs, callback)
Parses all lang files and then merges the results for all defined locales
First specified values for a phrase key are always honoured
Parameters
Name | Type | Description |
---|---|---|
langs |
array | Array of language key/value pairs |
callback |
function |
- Source: