-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
You can contribute code to:
Contributing code is straight-forward, like you contribute to any other project—fork it, clone it, modify code, send pull request.
Translations files are written in YAML format.
The English translation file (translations/en.yaml
)
is used as the starting point for other translations. Terms and phrases are first added to English file and later translated into other languages.
It also contains some extra information about each term which is helpful for the frontend website.
Terms in English file has these keys:
-
description
: (string) Description of the term, such as how or where it is used. -
variants
: (key-value pairs) Spelling variants of the term. -
tags
: (array) Tags are used in the project's website to group similar terms together. -
similar
: (array) Similar terms are used in the project's website for recommending related terms.
Color:
description: Label for the word "Color".
variants:
Colour: UK # British spelling
tags:
- label
- button
Variants can have an empty value:
Email:
description: Label for email form field.
variants:
E mail:
E-mail:
tags:
- label
Tags can have these values:
-
label
: For form field labels, text used on links or headings. -
button
: For text used on buttons. -
error message
: For error messages. -
success message
: For success messages. -
confirmation message
: For non destructive confirmation messages. -
warning message
: For warnings and destructive confirmation messages.
You can create new tags if the above listed tags don't fit into any other category.
Run this python script to create an empty skeleton:
$ python scripts/create.py --name=Spanish --code=es
The create.py
script will create a new translation file using the code
argument. In this
case, it will create a file called es.yaml
inside translations
directory.
You can also create localised translation files:
$ python scripts/create.py --name="Mexican Spanish" --code=es-MX
This will create a file called es-MX.yaml
file in the translations
directory.
For languages, that are written right-to-left, you can also specify the direction:
$ python scripts/create.py --name=Arabic --code=ar --direction=rtl
You can open the newly created file add the translations for the terms.
When new terms are added to the English file and you want those new terms to appear in another language's translation file, you can run this helper script:
$ python scripts/update.py --filename=es.yaml
- Use two spaces for indentation.
- Start all terms with a capital letter.
- Don't use capital letters for words after first word. Eg.
Terms of use
and notTerms of Use
. - Use American spellings and show British spellings in the
variants
key. - Use full-stop at the end of the description.
- Leave one blank line between terms.