From 8be42a4e57928f82830be71fa6c9bc17ac63aa8a Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Fri, 6 Aug 2021 07:52:22 -0700 Subject: Refactor translation plumbing (#168) - Centralize user-defined translations into a single file - Automatically sort the language dropdown - Update the translation contribution guide --- README.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 70efe1b..c3da32d 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,20 @@ This project uses [Prettier](https://prettier.io/) formatting. All pull requests We would love for you to contribute to different languages and help make it even better than it is today! As a language contributor, here are some steps we would like you to follow: -1. Add a translation to [`./src/i18n.js`](./src/i18n.js) -2. Add the language option in alphabetical order to [`./src/components/Settings.js`](./src/components/Settings.js) in the format `latinName - nativeName`, e.g. `French - Français` -3. If the languages added require RTL direction, add the language keys to RTL_LANGUAGES constant in [`./src/App.js`](./src/App.js) -4. Append an entry to the [Supported Languages](#supported-languages) table in below. +1. Add a translation to [`./src/translations.js`](./src/translations.js), e.g.: + + ``` + { + id: 'de-DE', // locale code + name: 'German - Deutsch', // Display name in the format 'latinName - nativeName' + rtl: true, // Optional, true if this is a right-to-left language + translation: { + ... + } + } + ``` + +2. Append an entry to the [Supported Languages](#supported-languages) table in below. ## Supported Languages -- cgit v1.2.3