src/source/dev_guide/adv-features.rst
branchdoc-dc
changeset 144 4275975a87c8
parent 126 e0584f3de3fd
--- a/src/source/dev_guide/adv-features.rst	Thu Dec 27 17:13:08 2018 +0100
+++ b/src/source/dev_guide/adv-features.rst	Thu Dec 27 17:46:12 2018 +0100
@@ -79,14 +79,41 @@
 Using GIS features
 ------------------
 
-Internationalization
---------------------
 .. _howto-i18n:
 
-pot-create -o ref.pot scr/
-msgmerge -U def.po ref.pot
-msgfmt def.po
+Internationalization
+--------------------
+
+Internationalization is the process of developing your plugin so it can easily be translated into other languages
+It's called also i18n (because there are 18 letters between the i and the n)
+
+Introduction to Gettext
+^^^^^^^^^^^^^^^^^^^^^^^
+
+For i18n **gettext** libraries and tools is widely used in the open-source world.
+
+Here is how it works in a few sentences:
+
+    Developers wrap translatable strings in special gettext functions
+    Special tools parse the source code files and extract the translatable strings into POT (Portable Objects Template) files.
+    Translators translate the strings and the result is a PO file (POT file, but with translations inside)
+    PO files are compiled to binary MO files, which give faster access to the strings at run-time
 
-#bin/pot-create -o src/onf_website/locales/onf_website.pot src/
-#msgmerge -U --previous --sort-by-file  src/onf_website/locales/fr/LC_MESSAGES/onf_website.po src/onf_website/locales/onf_website.pot
-#msgfmt  src/onf_website/locales/fr/LC_MESSAGES/onf_website.po -o src/onf_website/locales/fr/LC_MESSAGES/onf_website.mo
+
+In source code the _() function which refers to the native gettext-compliant translation function.
+
+PyAMS help us to generated this translation file with the tool *pot-create*:
+
+
+.. code-block:: shell
+
+	pot-create -o ref.pot <path/to/sources>
+
+
+Example to update PyAMS package:
+
+.. code-block:: shell
+
+	#bin/pot-create -o src/<package>/locales/.pot src/
+	#msgmerge -U --previous --sort-by-file  src/<package>/locales/fr/LC_MESSAGES/ref.po src/<package>/locales/ref.pot
+	#msgfmt  src/<package>/locales/fr/LC_MESSAGES/ref.po -o src/<package>/locales/fr/LC_MESSAGES/ref.mo