Skip to content

Add or Update a Language for Translation

Dr. Matthijs Berends edited this page Nov 12, 2022 · 2 revisions

For the most ideal workflow, please fork this repository and make the changes in your own forked repository. Afterwards, please create a Pull Request. If you are unfamiliar with these terms, no problem at all! Then please send us the edited files by email or any way you prefer.

The repository file data-raw/translations.tsv contains all translations. This file will be read by all functions where a translated output can be desired, like all mo_* functions (such as mo_name(), mo_gramstain(), mo_type(), etc.) and ``ab_*functions (such asab_name()`, `ab_group()`, etc.).

  1. Add or update a translation:

    • To add a translation, edit data-raw/translations.tsv (you can copy the contains to MS Excel for convenience and paste the contents back later), add a column where the new column name is a ISO 639-1 language code (such as en for English, de for German and es for Spanish) and put in the new column all translated text from the first column.

    • To update a translation, open data-raw/translations.tsv and save it with the language updates.

  2. Set the current working directory to the AMR package root folder (either by opening the AMR package as RStudio project, or by setting the working directory with setwd()).

  3. Run source("data-raw/_language_update.R)" to update the internal package data. If you have the roxygen2 package installed, this script automatically updates the package documentation as well.

Many thanks for your contribution!

Clone this wiki locally