Translations
It is possible to amend all text copy in OpenCRVS and introduce as as many content translations as you like.
Introduction
The multi-lingual text content approach for OpenCRVS is developed using FormatJS . It is worthwhile reading their documentation to understand how this technically works, particularly this page.
In the OpenCRVS country config, all text content is defined in CSV files inside the src/translations directory.
You can edit copy at any time, even after OpenCRVS goes live. The code to serve this CSV to the application is provided in the country configuration repo and requires no configuration in order to serve.
The content CSV looks like this:
buttons.apply
Apply button label
Apply
Appliquer
buttons.approve
Approve button text
Approve
Approuver
buttons.archive
Archive button text
Archive
Archiver
You can add a new language column for every language you want to support. In our Farajaland example you can see that we have added a new column for French.
The language column header is a 2-character ISO 639-1 language code
Be sure to add the code of the new language to the comma separated language lists (
LANGUAGES="en,fr") found in docker-compose files and*-config.jsfiles found in your country config package.Some keys like below use the "select" syntax, explained in the FormatJS Message Syntax documentation.
src/translations/client.csv
system.user.settings.language
Language name
{language, select, en {English} fr {Français} other {{language}}}
{language, select, en {English} fr {Français} other {{language}}}
system.user.settings.language
Language name
{language, select, en {English} fr {Français} other {{language}}}
{language, select, en {English} fr {Français} other {{language}}}
src/translations/login.csv
login.language
Language name
{language, select, en {English} fr {Français} other {{language}}}
{language, select, en {English} fr {Français} other {{language}}}
Only update the text content in the language columns. Do not modify the "id" field. You must not remove any keys unless you know that they are not used. Any removed keys will default to English in the application.
Making edits
Edit text for the client application in CSV in this file: client.csv.
Edit text for the login application in CSV in this file: login.csv .
If you are using SMS as a communications gateway, you can edit text in this file: notification.csv. The descriptions for the use-case of each of these SMS notifications content keys is described in the CSV. Explained futher in Informant and staff notifications
Edit Email subject lines in this file. Edit all HTML templates for emails in the appropriate files in this directory. Explained futher in Informant and staff notifications
After editing the content, if the CSV is not valid, it will not load properly in the client.
Last updated