[doc] add documentation for specializing translation of other cubes in an application cube
authorAlexandre Richardson <alexandre.richardson@logilab.fr>
Tue, 22 Dec 2015 11:26:49 +0100
changeset 11337 60369010c49e
parent 11336 96b1dc702e92
child 11338 dde85a5d47fc
[doc] add documentation for specializing translation of other cubes in an application cube
doc/book/devweb/internationalization.rst
--- a/doc/book/devweb/internationalization.rst	Fri Aug 21 11:25:50 2015 +0200
+++ b/doc/book/devweb/internationalization.rst	Tue Dec 22 11:26:49 2015 +0100
@@ -227,3 +227,29 @@
 
 It is also possible to explicitly use the with _cw.pgettext(context,
 msgid).
+
+
+Specialize translation for an application cube
+``````````````````````````````````````````````
+
+Every cube has its own translation files. For a specific application cube
+it can be useful to specialize translations of other cubes. You can either mark
+those strings for translation using `_` in the python code, or add a
+`static-messages.pot` file into the `i18n` directory. This file
+looks like: ::
+
+    msgid ""
+    msgstr ""
+    "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
+    "MIME-Version: 1.0\n"
+    "Content-Type: text/plain; charset=UTF-8\n"
+    "Content-Transfer-Encoding: 8bit\n"
+    "Generated-By: pygettext.py 1.5\n"
+    "Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+    msgig "expression to be translated"
+    msgstr ""
+
+Doing this, ``expression to be translated`` will be taken into account by
+the ``i18ncube`` command and additional messages will then appear in `.po` files
+of the cube.