From 81bf44174b7a66d587ec24dc2261c27918d1a134 Mon Sep 17 00:00:00 2001 From: cweiske Date: Wed, 4 Nov 2009 21:43:00 +0000 Subject: [PATCH] translation documentation git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@522 b3834d28-1941-0410-a4f8-b48e95affb8f --- doc/developers/translation | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 doc/developers/translation diff --git a/doc/developers/translation b/doc/developers/translation new file mode 100644 index 0000000..401089a --- /dev/null +++ b/doc/developers/translation @@ -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