From ae6c985d39465be9f4cf861d4a5b184df568b4d9 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Wed, 15 Nov 2017 19:58:29 +0100 Subject: [PATCH] Add missing backtick Signed-off-by: Stefan Parviainen --- docs/translating-dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/translating-dev.md b/docs/translating-dev.md index 37ea00e258..a39fe82c30 100644 --- a/docs/translating-dev.md +++ b/docs/translating-dev.md @@ -41,7 +41,7 @@ function getColorName(hex) { 1. Add the variable inside the string. The syntax for variables is ``%(variable)s``. Please note the _s_ at the end. The name of the variable has to match the previous used name. - You can use the special ``count`` variable to choose between multiple versions of the same string, in order to get the correct pluralization. E.g. ``_t('You have %(count)s new messages', { count: 2 })`` would show 'You have 2 new messages', while ``_t('You have %(count)s new messages', { count: 1 })`` would show 'You have one new message' (assuming a singular version of the string has been added to the translation file. See above). Passing in ``count`` is much prefered over having and if-statement choose the correct string to use, because some languages have much more complicated plural rules than english (e.g. they might need a completely different form if there are three things rather than two). -- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. `_t('Click here!', {}, { 'a': (sub) => {sub} })``. If you don't do the tag substitution you will end up showing literally '' rather than making a hyperlink. +- If you want to translate text that includes e.g. hyperlinks or other HTML you have to also use tag substitution, e.g. ``_t('Click here!', {}, { 'a': (sub) => {sub} })``. If you don't do the tag substitution you will end up showing literally '' rather than making a hyperlink. - You can also use React components with normal variable substitution if you want to insert HTML markup, e.g. ``_t('Your email address is %(emailAddress)s', { emailAddress: {userEmailAddress} })``. ## Things to know/Style Guides