From 18989f97f1c4299f447b011c28961ca5c8310c13 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 08:20:04 +0200 Subject: documentation index --- doc/developers/translation.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 doc/developers/translation.rst (limited to 'doc/developers/translation.rst') diff --git a/doc/developers/translation.rst b/doc/developers/translation.rst new file mode 100644 index 0000000..776b5d7 --- /dev/null +++ b/doc/developers/translation.rst @@ -0,0 +1,40 @@ +Translating SemanticScuttle +=========================== + +SemanticScuttle uses gnu gettext for translation. It does not +rely on the php extension but ships with a pure php implementation, +php-gettext[1]. + +Using gettext from within the code is really easy: +Enclose the string you want to translate in a "T_" function call. + +For example, to translate +> echo "Vote for"; +just write +> echo T_("Vote for"); + + +Translation basics +------------------ + +We keep one base translation file, data/locales/messages.po. +This file is auto-generated via xgettext from all our php source files. +In case you added a new string to the code that needs translation, +update the base translation file by running +> php scripts/update-translation-base.php + +After that has been done, the changes to the base messages.po file +need to be merged into the single language translation files, +for example data/locales/de_DE/LC_MESSAGES/messages.po. + +Updating them from the master file is as easy as running +> php scripts/update-translation.php de_DE + +When the translation is ready, the .po file needs to be compiled +in a machine-readable .mo file. Use +> php scripts/compile-translation.php de_DE +to achieve that. + + + +[1] https://launchpad.net/php-gettext/ \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 47005bb1c62960d33ba2061d6842529403331ff2 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:21:37 +0200 Subject: make INSTALL.txt file valid rST --- doc/developers/translation.rst | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'doc/developers/translation.rst') diff --git a/doc/developers/translation.rst b/doc/developers/translation.rst index 776b5d7..f014be2 100644 --- a/doc/developers/translation.rst +++ b/doc/developers/translation.rst @@ -1,40 +1,47 @@ +=========================== Translating SemanticScuttle =========================== SemanticScuttle uses gnu gettext for translation. It does not rely on the php extension but ships with a pure php implementation, -php-gettext[1]. +php-gettext_. Using gettext from within the code is really easy: -Enclose the string you want to translate in a "T_" function call. +Enclose the string you want to translate in a "``T_``" function call. + +For example, to translate:: + + echo "Vote for"; -For example, to translate -> echo "Vote for"; just write -> echo T_("Vote for"); + echo T_("Vote for"); + +.. _php-gettext: https://launchpad.net/php-gettext/ Translation basics ------------------- +================== We keep one base translation file, data/locales/messages.po. This file is auto-generated via xgettext from all our php source files. In case you added a new string to the code that needs translation, -update the base translation file by running -> php scripts/update-translation-base.php +update the base translation file by running :: + + $ php scripts/update-translation-base.php -After that has been done, the changes to the base messages.po file +After that has been done, the changes to the base ``messages.po`` file need to be merged into the single language translation files, -for example data/locales/de_DE/LC_MESSAGES/messages.po. +for example ``data/locales/de_DE/LC_MESSAGES/messages.po``. -Updating them from the master file is as easy as running -> php scripts/update-translation.php de_DE +Updating them from the master file is as easy as running:: -When the translation is ready, the .po file needs to be compiled -in a machine-readable .mo file. Use -> php scripts/compile-translation.php de_DE -to achieve that. + $ php scripts/update-translation.php de_DE + +When the translation is ready, the ``.po`` file needs to be compiled +in a machine-readable ``.mo`` file. Use :: + $ php scripts/compile-translation.php de_DE + +to achieve that. -[1] https://launchpad.net/php-gettext/ \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 324225f10b505d8c5a21614b7c88666e1c3c7e85 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 26 May 2011 21:22:43 +0200 Subject: make translation docs valid rST --- doc/developers/translation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/developers/translation.rst') diff --git a/doc/developers/translation.rst b/doc/developers/translation.rst index f014be2..008f66e 100644 --- a/doc/developers/translation.rst +++ b/doc/developers/translation.rst @@ -13,7 +13,7 @@ For example, to translate:: echo "Vote for"; -just write +just write :: echo T_("Vote for"); @@ -22,8 +22,8 @@ just write Translation basics ================== -We keep one base translation file, data/locales/messages.po. -This file is auto-generated via xgettext from all our php source files. +We keep one base translation file, ``data/locales/messages.po``. +This file is auto-generated via ``xgettext`` from all our php source files. In case you added a new string to the code that needs translation, update the base translation file by running :: -- cgit v1.2.3-54-g00ecf