Skip to content

How to add a language

Rémi Bétin edited this page Jan 15, 2024 · 7 revisions

Interested in adding a new language to the WCAG-EM Report Tool? These are the steps to follow.

Getting started

  • Indicate you'd like to translate, by opening an issue for translation.
  • Fork this repository (See Fork a repo) and download the files to your file system
  • Create a new branch for your translations

Add translations

Add language to the list of translations

Add a language code (lang) and name (title) in src/locales/index.json.

Example:

{
  "lang": "de",
  "title": "Deutsch"
}

This tells the application this translation exists.

If some terms are left untranslated (for example, if the WCAG 2.2 success criteria are not translated yet), add "status": "draft"

Add UI translations

Getting started

Copy the en folder in src/locales and rename it to the language code you've just added, for instance de.

If you want to see the translations in action, you can start a local server. This is how: in a console, run npm install to install dependencies (this requires NodeJS) to be installed). Then, run npm run dev to start a server that serves your local version of the WCAG-EM Report Tool.

Translate all content in the JSON files to the new language, except for WCAG.json.

These files have keys and values. Only the values should be translated. The keys are in capitals.

Example:

"ASSERTION_RESULT_DESCRIPTION_LABEL": "Observations"

In the above example, you would translate “Observations”, not “ASSERTION_RESULT_DESCRIPTION_LABEL”.

Add WCAG translations

You will need to add translations for WCAG 2.0, WCAG 2.1 and WCAG 2.2.

If an Authorized WCAG Translation already exists for the new langage, please match the translation of any words and phrases that are in that WCAG translation.

Open your PR

If you have done all the changes, add the files to git (see git add), then commit them (see git commit) and push them (see git push). Make sure to push to your fork.

Then, open a pull request from your fork to this repository.