From 295739b0798d1a6501d442e6fe4401a3009524fc Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Fri, 1 Jun 2018 17:36:32 -0400 Subject: [PATCH] Adding docs for updating translatoins --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0bd7545..39e2d03 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ To start a development server, run: $ yarn start +### Translating + +A helper tool is available to support maintaining translations. Running `yarn i18n:scrub` will update locale data files under `src/locales` by normalizing YAML syntax across all the files, maintaining a `missing.yml` file under each locale, and indicating any existing translations that appear to be no longer used. For this, the `src/locales/en/translation.yml` file is used as a source of truth. + +To add a new locale, first create a directory for the locale under `src/locales` (no files need to be added at this point), then run `yarn i18n:scrub`. This will create a `src/locales//missing.yml` file that contains required translations. Add a `src/locales//translation.yml` file and at a minimum add a translation for the `/displayName` value. This should be the translated name of the locale your are adding. + +If you are looking to translation missing text for a locale that is already present in the project, start by running `yarn i18n:scrub`. Check the `src/locales//missing.yml` file for translations that are needed. Add any updated translations to `src/locales//translation.yml`. + +Before committing any updated translations, run `yarn i18n:scrub` again to maintain syntax in the YAML files and remove any translated entries from `missing.yml`. Commit any changes to the `translation.yml` and `missing.yml` files. + ### Available scripts * `yarn start` - Start a development server on port 8080