From 95b09cde60eb3c050add78d5e884db78660d74b0 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sun, 29 Apr 2018 14:08:57 +1200 Subject: [PATCH] Reorder sections in translating documentation Move "Editing existing strings" to after "Adding new strings". --- docs/translating-dev.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/translating-dev.md b/docs/translating-dev.md index 28cd6242d9..d058c7cdbd 100644 --- a/docs/translating-dev.md +++ b/docs/translating-dev.md @@ -28,12 +28,6 @@ function getColorName(hex) { } ``` -## Editing existing strings - -1. Edit every occurrence of the string inside `_t()` and `_td()` in the JSX files. -1. Run `npm run i18n` to update `src/i18n/strings/en_EN.json`. (Be sure to run this in the same project as the JSX files you just edited.) -1. Run `npm run prunei18n` to remove the old string from `src/i18n/strings/*.json`. - ## Adding new strings 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. @@ -41,6 +35,12 @@ function getColorName(hex) { 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). +## Editing existing strings + +1. Edit every occurrence of the string inside `_t()` and `_td()` in the JSX files. +1. Run `npm run i18n` to update `src/i18n/strings/en_EN.json`. (Be sure to run this in the same project as the JSX files you just edited.) +1. Run `npm run prunei18n` to remove the old string from `src/i18n/strings/*.json`. + ## Adding variables inside a string. 1. Extend your ``_t()`` call. Instead of ``_t(STRING)`` use ``_t(STRING, {})``