Create Translations

How to create translations.

Setup Languages

Setup your Translations by creating a YAML file containing the default translation, the list of languages you want to translate, and the output formats for the Translations.

See Translations for details on the format.

Here is an example script:

cat > translations.yaml <<EOF
defaultCode: en
iso639Codes:
  de: Deutsch
  en: English
outputs:
- format: typescript
  package: index
  path: ../web/src/lib/yaml8n
translations:
EOF

Add Translations

You can add translations to this file by creating a new key under translations::

translations:
  HelloWorld:
    context: Greeting
    en: Hello World

You don’t have to add every language code (in the example above, de is missing). YAML8n will warn on missing translations so you can add them later.