[gnome-devel-docs] Review translation guide in new platform overview
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Review translation guide in new platform overview
- Date: Wed, 19 Jun 2013 14:50:07 +0000 (UTC)
commit eace11bf3929ec174d6677b895d9c7a38d51b253
Author: David King <amigadave amigadave com>
Date: Wed Jun 19 15:49:02 2013 +0100
Review translation guide in new platform overview
new-platform-overview/dev-translate-build.page | 49 +++++++++++++++++++----
new-platform-overview/dev-translate-setup.page | 6 +-
new-platform-overview/dev-translate-tools.page | 2 +-
new-platform-overview/dev-translate.page | 11 +++--
4 files changed, 50 insertions(+), 18 deletions(-)
---
diff --git a/new-platform-overview/dev-translate-build.page b/new-platform-overview/dev-translate-build.page
index a08a01a..27f9d73 100644
--- a/new-platform-overview/dev-translate-build.page
+++ b/new-platform-overview/dev-translate-build.page
@@ -5,7 +5,7 @@
<info>
<link type="next" xref="dev-translate-tools"/>
- <revision version="0.1" date="2013-06-17" status="stub"/>
+ <revision version="0.1" date="2013-06-19" status="review"/>
<credit type="author">
<name>Ekaterina Gerasimova</name>
@@ -18,7 +18,7 @@
<desc></desc>
</info>
- <title>Set up your buildsystem for translation</title>
+ <title>Set up your build system for translation</title>
<links type="series" style="floatend">
<title>Set up translations</title>
@@ -34,16 +34,16 @@
<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>
+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
+AM_CPPFLAGS = -DPACKAGE_LOCALEDIR=\""$(datadir)/locale"\"
</code>
<code>
@INTLTOOL_DESKTOP_RULE@
@@ -55,8 +55,39 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
<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>
+ <p>Now that your build system and your source strings are ready for
+ translation, you need to tell <app>gettext</app> three things:</p>
+
+ <list>
+ <item><p>the <em>translation domain</em>, generally the same as the
+ application name</p></item>
+ <item><p>the location where the built translations are installed</p></item>
+ <item><p>the character encoding of the translations, generally
+ UTF-8</p></item>
+ </list>
+
+ <example>
+ <note>
+ <p>This example assumes that your application is written in C. It will be
+ slightly different for other programming languages.</p>
+ </note>
+
+ <p>Add the following line to the source file which contains your
+ <code>main()</code> function:</p>
+
+ <code>#include "config.h"</code>
+
+ <p>Then, add the following lines to your <code>main()</code> function:</p>
+
+ <code>
+bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALEDIR);
+bind_textdomain_codeset (PACKAGE_TARNAME, "UTF-8");
+textdomain (GETTEXT_PACKAGE);
+</code>
+ </example>
+
+ <p>Run <cmd>make <input>projectname</input>.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
index 109f55a..8b6bcf4 100644
--- a/new-platform-overview/dev-translate-setup.page
+++ b/new-platform-overview/dev-translate-setup.page
@@ -5,7 +5,7 @@
<info>
<link type="next" xref="dev-translate-build"/>
- <revision version="0.1" date="2013-06-17" status="stub"/>
+ <revision version="0.1" date="2013-06-19" status="review"/>
<credit type="author copyright">
<name>Michael Hill</name>
@@ -27,8 +27,8 @@
<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>
+ <p>Wrap messages or <em>string literals</em> in your code with the
+ '<code>_()</code>' macro.</p>
<note>
<p>For C, this macro is defined in the <file>glib/gi18n.h</file> header
diff --git a/new-platform-overview/dev-translate-tools.page b/new-platform-overview/dev-translate-tools.page
index aac11a4..e64ce61 100644
--- a/new-platform-overview/dev-translate-tools.page
+++ b/new-platform-overview/dev-translate-tools.page
@@ -4,7 +4,7 @@
id="dev-translate-tools">
<info>
- <revision version="0.1" date="2013-06-18" status="stub"/>
+ <revision version="0.1" date="2013-06-19" status="review"/>
<credit type="author copyright">
<name>Michael Hill</name>
diff --git a/new-platform-overview/dev-translate.page b/new-platform-overview/dev-translate.page
index 53ae0c3..22057b9 100644
--- a/new-platform-overview/dev-translate.page
+++ b/new-platform-overview/dev-translate.page
@@ -4,9 +4,9 @@
id="dev-translate">
<info>
- <link type="guide" xref="index#dev"/>
+ <link type="guide" xref="index#overview"/>
<link type="next" xref="dev-translate-setup"/>
- <revision version="0.1" date="2013-06-17" status="stub"/>
+ <revision version="0.1" date="2013-06-19" status="review"/>
<credit type="author copyright">
<name>Michael Hill</name>
@@ -16,10 +16,10 @@
<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>
+ <desc>Localization for user-visible application content.</desc>
</info>
- <title>Make your application translatable</title>
+ <title>Translations</title>
<links type="series" style="floatend">
<title>Set up translations</title>
@@ -35,7 +35,8 @@
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>
- <p>You should use ngettext for plural translations.</p>
+ <p>You should use <code>ngettext</code> for translation of strings with
+ plurals.</p>
<p>For more information about translating GNOME projects, see the GNOME
<link href="https://live.gnome.org/TranslationProject/DevGuidelines">Translation
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]