aboutsummaryrefslogtreecommitdiff
path: root/doc/developers/translation.rst
diff options
context:
space:
mode:
authorMark Pemberton <mpemberton5@gmail.com>2011-06-04 00:38:07 -0400
committerMark Pemberton <mpemberton5@gmail.com>2011-06-04 00:38:07 -0400
commitb628e63e015bc3b2eadc712feaa6c4d05cf75bbd (patch)
treeebdcec5c8133a3b6f86d06dc3f6fb3de46609f04 /doc/developers/translation.rst
parent84e603aa91a303a1419962ff3ff6086710a7b1a9 (diff)
parent4c8a53c5bc632302aaf8978e711eb53a03166db5 (diff)
downloadsemanticscuttle-b628e63e015bc3b2eadc712feaa6c4d05cf75bbd.tar.gz
semanticscuttle-b628e63e015bc3b2eadc712feaa6c4d05cf75bbd.tar.bz2
Merge branch 'master' into privatekey2
Conflicts: data/templates/default/bookmarks.tpl.php
Diffstat (limited to 'doc/developers/translation.rst')
-rw-r--r--doc/developers/translation.rst47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/developers/translation.rst b/doc/developers/translation.rst
new file mode 100644
index 0000000..008f66e
--- /dev/null
+++ b/doc/developers/translation.rst
@@ -0,0 +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_.
+
+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");
+
+.. _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
+
+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.
+
+