From 9d617bbeb513a09529663349e53c8bdb4f2141fc Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Mon, 19 Nov 2018 16:28:24 +0000 Subject: [PATCH] mgr/dashboard: Update I18N documentation Add a Suggestions section. Signed-off-by: Tiago Melo --- src/pybind/mgr/dashboard/HACKING.rst | 68 +++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index 09c2bd0799d..1fbebb6e9e3 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -235,7 +235,7 @@ How to extract messages from source code? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To extract the I18N messages from the templates and the TypeScript files just -run the following command in ``src/pybind/mgr/dashboard/frontend``: +run the following command in ``src/pybind/mgr/dashboard/frontend``:: $ npm run i18n @@ -284,6 +284,72 @@ For example, the path for german would be ``src/locale/messages.de-DE.xlf``. ```` should match the id previouisly inserted in ``supported-languages.enum.ts``. +Suggestions +~~~~~~~~~~~ + +Strings need to start and end in the same line as the element: + +.. code-block:: xml + + + + Foo + + + + Foo + + + + + Foo bar baz. + Foo bar baz. + + + + Foo bar baz. + Foo bar baz. + +Isolated interpolations should not be translated: + +.. code-block:: xml + + + {{ foo }} + + + {{ foo }} + +Interpolations used in a sentence should be kept in the translation: + +.. code-block:: xml + + + There are {{ x }} OSDs. + +Remove elements that are outside the context of the translation: + +.. code-block:: xml + + + + + + + +Keep elements that affect the sentence: + +.. code-block:: xml + + + Profile foo will be removed. + Backend Development ------------------- -- 2.47.3