From 4c9541b47d3d565e95a44998ef5cf392c8cd89d7 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Fri, 18 Jan 2019 12:33:24 -0500 Subject: [PATCH 1/2] added pull request template, and note on where to find react-intl info --- .github/PULL_REQUEST_TEMPLATE.md | 52 ++++++++++++++++++++++++++++++++ src/index.js | 3 ++ 2 files changed, 55 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..f38525c9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,52 @@ +### Resolves + +- Resolves # + +### Proposed Changes + +_Describe what this Pull Request does_ + +## Checklist for updating translations + +There are two situations in which we create manual PRs to update translations: + +1. We don't want to wait for Travis's automatic weekly update; or, +2. We need to add a language that has become ready + +### 1. Updating translations manually + +* [ ] Pull translations from Transifex with `> npm run pull:editor` +* [ ] Test the result with `> npm run test` +* [ ] Confirm that you see changes to files like `editor//.json` + +### Adding a language + +* [ ] Edit `src/supported-locales.js`: + * [ ] Add entry for the language in the `locales` const + * [ ] Check if language is right-to-left. If so: + * Add entry in `rtlLocales` + +* [ ] Check if language needs a new locale (such as Brasilian Portuguese). If so: + * [ ] Edit `.tx/config`: + * Add to the `lang_map` list. Format is `:` + * [ ] Edit `src/supported-locales.js`: + * Add new entry to `localeMap`. Format is `'': ''` + +* [ ] Edit `src/index.js`: + * [ ] Add 'import' line and export line + * [ ] Add entry in `localeData` array + +* [ ] check if locale is in `react-intl` + * Look in [https://unpkg.com/react-intl/locale-data/](https://unpkg.com/react-intl/locale-data/) + * If not in `react-intl`: + * [ ] Edit `src/supported-locales.js`: + * In `customLocales`, add entry with parent set to a `react-intl` locale + * [ ] Edit `src/index.js`: + * In `localeData`, add entry for parent locale + +* [ ] update translations per the "Updating translations" section above +* [ ] Confirm that we see changes to: + * [ ] `src/supported-locales.js` + * [ ] `src/index.js` + * [ ] `.tx/config` (if language needed a new locale) + * [ ] Multiple files like `editor//.json` diff --git a/src/index.js b/src/index.js index 9a9c2114..790b370e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,6 @@ +// to find locale data in react-intl, go to: +// https://unpkg.com/react-intl/locale-data/ + import en from 'react-intl/locale-data/en'; import am from 'react-intl/locale-data/am'; import ar from 'react-intl/locale-data/ar'; From bb7b458a852e878c6ef98bb26f2a34361668b565 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Tue, 22 Jan 2019 09:51:45 -0500 Subject: [PATCH 2/2] added notes about .tx/config deprecation --- .github/PULL_REQUEST_TEMPLATE.md | 5 +++-- README.md | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f38525c9..d6ef1fb1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -27,10 +27,11 @@ There are two situations in which we create manual PRs to update translations: * Add entry in `rtlLocales` * [ ] Check if language needs a new locale (such as Brasilian Portuguese). If so: - * [ ] Edit `.tx/config`: - * Add to the `lang_map` list. Format is `:` * [ ] Edit `src/supported-locales.js`: * Add new entry to `localeMap`. Format is `'': ''` + * [ ] Edit `.tx/config`: + * Add to the `lang_map` list. Format is `:` + * NOTE: we are moving away from using the `tx` cli; `.tx/config` will eventually be deprecated * [ ] Edit `src/index.js`: * [ ] Add 'import' line and export line diff --git a/README.md b/README.md index 646f5181..bbbb93a9 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,7 @@ scratch-l10n provides: scratch-l10n uses semantic versioning - breaking changes will increment the major version number, and new features (e.g. a new language) will increment the minor version number. However, the patch number is actually a datetime string. That way it's easy to see how recently the translations were updated. In general, changes that require a PR (new functionality, new language) should increment the minor version. Pulling new translations from Transifex is automated and will commit to master directly. + +#### Deprecations + +We are moving away from using the `tx` cli, so the `.tx/config` file will eventually be deprecated.