Translate adapter

ioBroker is used worldwide. For an adapter to be understood everywhere, three things need to be translated:

  • the texts of the configuration interface,
  • title anddesc in theio-package.json ,
  • the change notes (news ) in theio-package.json .

English and German are mandatory. Everything else is voluntary, but welcome.

The supported languages

en ,de ,ru ,pt ,nl ,fr ,it ,es ,pl ,uk ,zh-cn .

The tool

Translation is done with@iobroker/adapter-dev It belongs to the category of developmental dependencies:

npm install --save-dev @iobroker/adapter-dev

In thepackage.json It will receive an entry underscripts :

"scripts": {
    "translate": "translate-adapter"
}

An adapter from Adapter Creator already includes this feature.

!> The oldgulp translate It's no longer available. Anyone who still has one...Gruntfile or agulpfile.js For translations in the package, replace them withadapter-dev .

The process

New texts are only written to the English file, i.e., inadmin/i18n/en.json oradmin/src/i18n/en.json . Thereafter:

npm run translate

This fills in all the missing translations in the other language files and in theio-package.json only certain languages:

npm run translate -- -l de fr it

An interface in the old HTML style also has awords.js It is no longer cultivated by hand, but produced:

npm run translate all

This translates and then writeswords.js from the JSON files. Anyone who doesn't have any JSON files yet should call [command/method] once.npm run translate to-json to remove them from the existingwords.js to produce.

The commands come in three forms: written out (to-json ), as a sign (j ) and under the old gulp name (adminWords2languages They do the same thing.

What is translated with

Used without any further settingsadapter-dev The free Google Translate service has a limited number of uses. DeepL provides better results. This only requires one environment variable:

export DEEPL_API_KEY="…"
npm run translate

Is alsoGOOGLE_APPLICATION_CREDENTIALS If set to this order, it is DeepL, then Google Translate V3, then the free Google Translate.

Machine translation is a start, not a solution. The German and English texts should always be proofread manually. The section on technical terms in the style guide illustrates how often a machine gets it wrong.

Weblate

For community-based translation, there's weblate.iobroker.net . If you register your adapter there, you'll receive translations from native speakers instead of a machine. Weblate callsto-words even as soon as something changes.

The adapter documentation

A separate procedure applies to the pages under Adapter . It is described under Documentation Style Guide and Documentation Template .