How-to guides

Community translation

The community can translate your Komod's Hungarian and English texts to other languages on the KOFA site (kofa.kncsk.hu/forditas). The translations reach the users two ways: running KOFA servers download them, and you can build them into the next version of your Komod.

Where do the texts come from?

When you upload a released (not preview) version to the Komod store, and it is the Komod's newest release, the site takes over the hu.json and en.json dictionaries of the package's i18n/ and i18n/client/ folders. See Multilingual Komods.

  • Only the keys of hu.json are taken; the English text helps the translator, the editor field starts from it.
  • A new key shows up as untranslated in every language. A key left out turns obsolete; its translations stay for older versions.
  • When the English text changes, the existing translations are marked "stale" until someone reviews them.
  • The metadata (name, description, ports) can be translated too when their keys are in hu.json.
  • A broken dictionary never stops the upload; the texts are just not translatable then.

Note

Preview versions do not count: translators always see the texts of the latest release.

Who translates?

Users of the site with an activated account can add languages and translations. The Hungarian and English texts belong to your package: they cannot be changed on the site, only with a new version.

The Komod's page in the store shows its community languages and how much of it is translated. Clicking a language opens the editor with the Komod's untranslated keys only.

Maintainer rights

The Komod's owner and co-uploaders (and the admins) can:

  • Turn off the community translation on the Komod's page. Then only they translate the Komod, and the language packs leave out its community texts.
  • Revert any change of the Komod's keys in the translation history.

How does it reach the users?

A language counts as released when enough of the program's own texts are translated (60% by default). Running KOFA servers download the released languages daily, without a reinstall; users see them in the language selector.

For your Komod's texts your own translation wins: a community text only fills the keys your package does not translate to that language.

Building them into the next version

kofa-pack i18n pull acme.demo.thermostat MyKomod MyKomod.Ui
  • The first argument is the package id, then the project folders (default: the current folder). Every project needs an i18n/hu.json.
  • A key goes to the project whose hu.json has it. The other keys of i18n/<lang>.json stay; the site's text replaces the file's.
  • Only translations that are not stale are pulled. Keys of older versions are skipped and counted.
  • The languages are described in i18n/languages.json.
  • --server <url>: another site (default https://kofa.kncsk.hu).

Then build and upload the next version: from then on these are the Komod's own translations.

Language description (languages.json)

A language that is not built in needs a description: its names, its fallback language and its plural rule. kofa-pack i18n pull writes it, but you can add one by hand too:

[
  { "code": "pl", "name": "Polish", "nativeName": "Polski", "fallback": "en", "plural": "polish" }
]

The plural value decides which plural forms the dictionary needs:

plural Languages Forms
one-other Hungarian, English, German, Spanish, Italian … one, other
none Japanese, Chinese, Korean, Vietnamese other
french French, Portuguese (0 is singular too) one, other
east-slavic Russian, Ukrainian, Belarusian one, few, many, other
polish Polish one, few, many, other
czech Czech, Slovak one, few, many, other
arabic Arabic zero, one, two, few, many, other

A single language can also be described by i18n/language.json (one object with the same fields). kofa-pack rejects a package with an unknown plural value.