[gnome-devel-docs] Tidy up translation in the new platform overview
- From: Ekaterina Gerasimova <egerasimov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Tidy up translation in the new platform overview
- Date: Wed, 19 Jun 2013 00:38:35 +0000 (UTC)
commit 05fc392193b9520d4229e6da79fd1f77474371d4
Author: Ekaterina Gerasimova <kittykat3756 gmail com>
Date: Tue Jun 18 20:06:23 2013 -0400
Tidy up translation in the new platform overview
new-platform-overview/dev-translate-build.page | 62 ++++++++++++++++++++
new-platform-overview/dev-translate-setup.page | 44 ++++++++++++++
...ng-tools.page.stub => dev-translate-tools.page} | 12 +++-
new-platform-overview/dev-translate.page | 51 +++++++++--------
.../translating-messages.page.stub | 52 ----------------
new-platform-overview/translating.page.stub | 33 ----------
6 files changed, 142 insertions(+), 112 deletions(-)
---
diff --git a/new-platform-overview/dev-translate-build.page b/new-platform-overview/dev-translate-build.page
new file mode 100644
index 0000000..a08a01a
--- /dev/null
+++ b/new-platform-overview/dev-translate-build.page
@@ -0,0 +1,62 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:its="http://www.w3.org/2005/11/its"
+ type="topic" style="task"
+ id="dev-translate-build">
+
+ <info>
+ <link type="next" xref="dev-translate-tools"/>
+ <revision version="0.1" date="2013-06-17" status="stub"/>
+
+ <credit type="author">
+ <name>Ekaterina Gerasimova</name>
+ <email its:translate="no">kittykat3756 gmail com</email>
+ <years>2013</years>
+ </credit>
+
+ <include href="cc-by-sa-3-0.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+
+ <desc></desc>
+ </info>
+
+ <title>Set up your buildsystem for translation</title>
+
+ <links type="series" style="floatend">
+ <title>Set up translations</title>
+ </links>
+
+ <p>You will need to set up your project and build system to work with
+ tranlations.</p>
+
+ <p>Create a <file>po/</file> subdirectory in your project directory and list
+ the files which have translatable strings in <file>po/POTFILES.in</file>.
+ List files <em>without</em> translatable strings in
+ <file>po/POTFILES.skip</file>.</p>
+
+ <p>Add the following lines to your <file>configure.ac</file>:</p>
+ <code>
+ IT_PROG_INTLTOOL([0.50.0])
+ AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
+ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Package name for gettext])</code>
+
+ <p>Add the following lines to your <file>Makefile.am</file>:</p>
+ <code>
+SUBDIRS = po
+</code>
+ <code>
+localedir = $(datadir)/locale
+</code>
+ <code>
+ INTLTOOL_DESKTOP_RULE@
+desktopdir = $(datadir)/applications
+desktop_in_files = data/<input>applicationname</input>.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+</code>
+
+ <p>Run <cmd>intltoolize</cmd> to copy the intltool build infrastructure to
+ the build tree before running <cmd>autoreconf</cmd>.</p>
+
+ <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>
+
+</page>
diff --git a/new-platform-overview/dev-translate-setup.page b/new-platform-overview/dev-translate-setup.page
new file mode 100644
index 0000000..109f55a
--- /dev/null
+++ b/new-platform-overview/dev-translate-setup.page
@@ -0,0 +1,44 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:its="http://www.w3.org/2005/11/its"
+ type="topic" style="task"
+ id="dev-translate-setup">
+
+ <info>
+ <link type="next" xref="dev-translate-build"/>
+ <revision version="0.1" date="2013-06-17" status="stub"/>
+
+ <credit type="author copyright">
+ <name>Michael Hill</name>
+ <email its:translate="no">mdhillca gmail com</email>
+ <years>2013</years>
+ </credit>
+
+ <include href="cc-by-sa-3-0.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+
+ <desc></desc>
+ </info>
+
+ <title>Mark strings for translation</title>
+
+ <links type="series" style="floatend">
+ <title>Set up translations</title>
+ </links>
+
+ <p>Before the strings from your application can be translated, they need to
+ be extracted from the source code.</p>
+
+ <p>Wrap messages or <em>string literals</em> in your code with the '_()'
+ macro.</p>
+
+ <note>
+ <p>For C, 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>
+
+ <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>
+
+</page>
diff --git a/new-platform-overview/translating-tools.page.stub
b/new-platform-overview/dev-translate-tools.page
similarity index 70%
rename from new-platform-overview/translating-tools.page.stub
rename to new-platform-overview/dev-translate-tools.page
index 394f424..aac11a4 100644
--- a/new-platform-overview/translating-tools.page.stub
+++ b/new-platform-overview/dev-translate-tools.page
@@ -1,12 +1,14 @@
<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:its="http://www.w3.org/2005/11/its"
type="topic" style="task"
- id="translating-tools">
+ id="dev-translate-tools">
+
<info>
<revision version="0.1" date="2013-06-18" status="stub"/>
<credit type="author copyright">
<name>Michael Hill</name>
- <email>mdhillca gmail com</email>
+ <email its:translate="no">mdhillca gmail com</email>
<years>2013</years>
</credit>
@@ -15,10 +17,14 @@
<title>Translation tools</title>
+ <links type="series" style="floatend">
+ <title>Set up translations</title>
+ </links>
+
<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>
+ <app href="http://projects.gnome.org/gtranslator/">Gtranslator</app>
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>
diff --git a/new-platform-overview/dev-translate.page b/new-platform-overview/dev-translate.page
index 540ead6..53ae0c3 100644
--- a/new-platform-overview/dev-translate.page
+++ b/new-platform-overview/dev-translate.page
@@ -1,40 +1,43 @@
<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:its="http://www.w3.org/2005/11/its"
type="topic" style="task"
id="dev-translate">
+
<info>
- <link type="guide" xref="index#dev" />
-
- <revision version="0.1" date="2012-02-19" status="stub"/>
+ <link type="guide" xref="index#dev"/>
+ <link type="next" xref="dev-translate-setup"/>
+ <revision version="0.1" date="2013-06-17" status="stub"/>
<credit type="author copyright">
- <name>Phil Bull</name>
- <email>philbull gmail com</email>
- <years>2012</years>
+ <name>Michael Hill</name>
+ <email its:translate="no">mdhillca gmail com</email>
+ <years>2013</years>
</credit>
- <desc>Tools to help you internationalize your apps.</desc>
+ <include href="cc-by-sa-3-0.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+
+ <desc>Set up your application to be translatable into other languages.</desc>
</info>
- <title>Translation and Localization</title>
+ <title>Make your application translatable</title>
- <comment>
- <cite date="2012-02-19" href="mailto:philbull gmail com">Phil Bull</cite>
- <p>This assumes the reader knows how to.... By the end of this page,
- the reader will be able to....</p>
- </comment>
+ <links type="series" style="floatend">
+ <title>Set up translations</title>
+ </links>
- <comment>
- <cite date="2012-02-22" href="mailto:ak-47 gmx net">Andre Klapper</cite>
- <p>Also check
-https://live.gnome.org/TranslationProject#For_maintainers.2BAC8-developers_of_modules</p>
- </comment>
+ <p>You can make your application translatable into other languages using
+ <app href="http://freedesktop.org/wiki/Software/intltool/">intltool</app>
+ and
+ <app href="http://www.gnu.org/software/gettext/manual/gettext.html">gettext</app>.</p>
- <p>Short introductory text...</p>
+ <p><app>gettext</app> is the framework for extracting strings from a source
+ file. <app>intltool</app> extracts translatable strings from other files,
+ such as desktop files and UI files, then merges them back into the XML and
+ desktop files with the strings from the source code.</p>
- <steps>
- <item><p>First step...</p></item>
- <item><p>Second step...</p></item>
- <item><p>Third step...</p></item>
- </steps>
+ <p>You should use ngettext for plural translations.</p>
+ <p>For more information about translating GNOME projects, see the GNOME
+ <link href="https://live.gnome.org/TranslationProject/DevGuidelines">Translation
+ Project</link>.</p>
</page>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]