[gnome-devel-docs/wip/reorganization] Draft translating pages, summary and tutorial.
- From: Michael Hill <mdhill src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs/wip/reorganization] Draft translating pages, summary and tutorial.
- Date: Mon, 17 Jun 2013 21:59:52 +0000 (UTC)
commit 218760ec9adc2a4260a30cc503d39be6ac31107a
Author: Michael Hill <mdhillca gmail com>
Date: Mon Jun 17 17:57:15 2013 -0400
Draft translating pages, summary and tutorial.
tutorials/C/translating-messages.page | 61 +++++++++++++++++++++++++++++++++
tutorials/C/translating.page | 21 +++++++++++
2 files changed, 82 insertions(+), 0 deletions(-)
---
diff --git a/tutorials/C/translating-messages.page b/tutorials/C/translating-messages.page
new file mode 100644
index 0000000..d685540
--- /dev/null
+++ b/tutorials/C/translating-messages.page
@@ -0,0 +1,61 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ type="topic" style="task"
+ id="translating-messages">
+ <info>
+
+ <revision version="0.1" date="2013-06-17" status="stub"/>
+
+ <credit type="author copyright">
+ <name>Michael Hill</name>
+ <email>mdhillca gmail com</email>
+ <years>2013</years>
+ </credit>
+
+ <desc></desc>
+ <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+ </info>
+
+ <title>Preparing messages for translation</title>
+
+ <p>The messages in your application can be translated into other languages if
+ they are set up properly. This is done with
+ <link href="http://freedesktop.org/wiki/Software/intltool/"><app>intltool</app></link>,
+ using the
+ <link href="http://www.gnu.org/software/gettext/manual/gettext.html"><app>GNU
+ gettext</app></link> conventions.</p>
+
+ <steps>
+ <item><p>Wrap messages or <em>string literals</em> in your code with the
+ '_()' macro. This macro is defined in the <file>glib/gi18n.h</file> header
+ file, which must be included at the top of your application source.</p>
+ <note style="advanced">
+ <p>This is the syntax for the macro using C. Check with the
+ documentation for your language for the syntax you need to use.</p>
+ </note>
+ <p>Your wrapped strings should look like this:</p>
+ <code>_("Press a key to continue")</code>
+ <p>This marks the strings as translatable, and at runtime calls
+ <app>gettext</app> to substitute the translated strings.</p>
+ </item>
+ <item><p>(other syntax to indicate plural).</p></item>
+ <item><p>(set up in the make system to run automatically).</p></item>
+ <item><p>Create a <file>po/</file> subdirectory in your project
+ directory.</p></item>
+ <item><p>Tell <app>gettext</app> which files have translatable strings by
+ listing those files in <file>po/POTFILES.in</file>. List files
+ <em>without</em> translatable strings in
+ <file>po/POTFILES.skip</file>.</p></item>
+ <item><p>Run <cmd>make projectname.pot</cmd> in the
+ <file>po</file> directory. This runs <cmd>intltool-extract</cmd> to extract
+ the translatable strings and put them in a po template (POT) file.</p></item>
+ </steps>
+
+ <p>At this point the strings are ready for translation, or
+ <em>localization</em>. For projects hosted in the GNOME Git repositories,
+ this task is handled by the GNOME Translation Project.
+ <link href="http://projects.gnome.org/gtranslator/"><app>Gtranslator</app></link>
+ is a GNOME tool for editing <file>.po</file> files. Other online and offline
+ localization tools include <app>Transifex</app>, <app>Virtaal</app>,
+ <app>KBabel</app> or <app>Pootle</app></p>
+
+</page>
diff --git a/tutorials/C/translating.page b/tutorials/C/translating.page
new file mode 100644
index 0000000..3bee075
--- /dev/null
+++ b/tutorials/C/translating.page
@@ -0,0 +1,21 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ type="topic" style="task"
+ id="translating">
+ <info>
+ <revision version="0.1" date="2013-06-17" status="stub"/>
+
+ <credit type="author copyright">
+ <name>Michael Hill</name>
+ <email>mdhillca gmail com</email>
+ <years>2013</years>
+ </credit>
+
+ <desc>
+ </desc>
+
+ <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+ </info>
+
+ <title>Making your application translatable</title>
+
+</page>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]