Move and reword note about out-of-date dev setup

Replace an inline, parenthetical note about possible failures of the `npm run`
scripts with additional items in the Requirements section.
pull/6528/head
Aidan Gauland 2018-04-21 21:52:56 +12:00
parent 6d74d5f8b7
commit a8e578f5b8
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,8 @@
## Requirements
- A working [Development Setup](../../#setting-up-a-dev-environment)
- Including up-to-date versions of matrix-react-sdk and matrix-js-sdk
- Node 8 or later
- Be able to understand English
- Be able to understand the language you want to translate riot-web into
@ -36,7 +38,7 @@ function getColorName(hex) {
1. Check if the import ``import { _t } from 'matrix-react-sdk/lib/languageHandler';`` is present. If not add it to the other import statements. Also import `_td` if needed.
1. Add ``_t()`` to your string. (Don't forget curly braces when you assign an expression to JSX attributes in the render method). If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
1. Run `npm run i18n` to update ``src/i18n/strings/en_EN.json`` (if it fails because it can't find the script, your dev environment predates the script, so reinstall/link react-sdk with `npm link ../matrix-react-sdk`). If it segfaults, you may be on Node 6, so try a newer version of node.
1. Run `npm run i18n` to update ``src/i18n/strings/en_EN.json``
1. If you added a string with a plural, you can add other English plural variants to ``src/i18n/strings/en_EN.json`` (remeber to edit the one in the same project as the source file containing your new translation).
## Adding variables inside a string.