From: Tiago Melo Date: Mon, 19 Nov 2018 16:28:24 +0000 (+0000) Subject: mgr/dashboard: Update I18N documentation X-Git-Tag: v14.1.0~835^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25159%2Fhead;p=ceph.git mgr/dashboard: Update I18N documentation Add a Suggestions section. Signed-off-by: Tiago Melo --- 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 -------------------