i18n


Mojo supports internationalization with with the mojo-i18n module.

Installation

npm install mojo-i18n --save-exact

Basic Example

i18n.translations

The available translations for the application.

{
  "locale": {
    "path": {
      "to": "translation __with__ __optional__ __params__"
    }
  }
}

i18n.locale

The locale of the application. This can be dynamically changed without reloading the application.

Template Modifiers

t(params[, alternativeText])

translates the given string with the provided params - params are defined within the template as param. If the translation doesn't exist, the alternative text is used instead.

{{ "messages.hello" | t(null, "Hello world") }}