From a8e578f5b8beefd4149f8b92a7276113d1edcd6b Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sat, 21 Apr 2018 21:52:56 +1200 Subject: [PATCH] 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. --- docs/translating-dev.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/translating-dev.md b/docs/translating-dev.md index c2ad0986..3238bd73 100644 --- a/docs/translating-dev.md +++ b/docs/translating-dev.md @@ -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.