Skip to main content

Localization

HUB Client has built-in support for multiple locales and an easy way to manage translations. All translation keys are being stored in src/translates folder under appropriate YAML files: {LANG}.yml and should be described in index.yml project configuration file:
Translations can be stored under nested keys, e.g.
In order to use translation key with some parameter, the following notation can be used:
There are two ways to use translations in YAML:
  • Use the !t function. It can value for any property in any object.
  • Use !expression and call the function t.
To change locale, use the action changeLocale, in which the first parameter is target locale name. Examples:

Markdown and HTML content in translations

Translation key value can have string, HTML or Markdown as a value:
In order to use Markdown/HTML you need to use !te tag instead of !t: