summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>2014-06-18 17:17:12 +0400
committerRichard Hughes <richard@hughsie.com>2014-06-18 16:38:44 +0100
commitb8164a6ccf559fe7cd22d5e9189060aa31389b5d (patch)
treeee833af00cae230e924208a9f3732a81d21c0d6b
parent11d0857dd458518fc92401f8a8824509ae6895e2 (diff)
downloadappstream-glib-b8164a6ccf559fe7cd22d5e9189060aa31389b5d.tar.gz
i18n: use transifex for translations
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Signed-off-by: Richard Hughes <richard@hughsie.com>
-rw-r--r--.tx/config9
-rw-r--r--Makefile.am10
-rwxr-xr-xautogen.sh1
-rw-r--r--client/as-builder.c31
-rw-r--r--client/as-util.c3
-rw-r--r--configure.ac9
-rw-r--r--contrib/libappstream-glib.spec.in6
-rw-r--r--po/LINGUAS1
-rw-r--r--po/Makevars42
-rw-r--r--po/POTFILES.in5
-rw-r--r--po/POTFILES.skip1
-rw-r--r--po/ru.po300
12 files changed, 403 insertions, 15 deletions
diff --git a/.tx/config b/.tx/config
new file mode 100644
index 0000000..bcd4501
--- /dev/null
+++ b/.tx/config
@@ -0,0 +1,9 @@
+[main]
+host = https://www.transifex.com
+
+[appstream-glib.master]
+file_filter = po/<lang>.po
+source_file = po/appstream-glib.pot
+source_lang = en
+type = PO
+
diff --git a/Makefile.am b/Makefile.am
index 314f001..6664264 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,18 +5,21 @@ SUBDIRS = \
libappstream-builder \
client \
data \
- docs
+ docs \
+ po
DISTCLEANFILES = \
appstream-glib-*.tar.xz
MAINTAINERCLEANFILES = \
*~ \
+ ABOUT-NLS \
aclocal.m4 \
ChangeLog \
compile \
config.guess \
config.h.* \
+ config.rpath \
config.sub \
configure \
depcomp \
@@ -27,6 +30,11 @@ MAINTAINERCLEANFILES = \
Makefile.in \
missing \
mkinstalldirs \
+ po/*.header \
+ po/Makevars.template \
+ po/Rules-quot \
+ po/*.sed \
+ po/*.sin \
test-driver
EXTRA_DIST = \
diff --git a/autogen.sh b/autogen.sh
index 5776c0a..2d0392d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -27,6 +27,7 @@ fi
(cd $srcdir && gtkdocize) || exit 1
(cd $srcdir && autoreconf --force --install) || exit 1
+(cd $srcdir && intltoolize --force --copy --automake) || exit 1
conf_flags="--enable-gtk-doc"
diff --git a/client/as-builder.c b/client/as-builder.c
index ce161e6..a028374 100644
--- a/client/as-builder.c
+++ b/client/as-builder.c
@@ -83,47 +83,52 @@ main (int argc, char **argv)
_("Add a cache ID to each component"), NULL },
{ "log-dir", '\0', 0, G_OPTION_ARG_FILENAME, &log_dir,
/* TRANSLATORS: command line option */
- _("Set the logging directory [default: ./logs]"), "DIR" },
+ _("Set the logging directory [default: ./logs]"), "DIR" },
{ "packages-dir", '\0', 0, G_OPTION_ARG_FILENAME, &packages_dir,
/* TRANSLATORS: command line option */
- _("Set the packages directory [default: ./packages]"), "DIR" },
+ _("Set the packages directory [default: ./packages]"), "DIR" },
{ "temp-dir", '\0', 0, G_OPTION_ARG_FILENAME, &temp_dir,
/* TRANSLATORS: command line option */
- _("Set the temporary directory [default: ./tmp]"), "DIR" },
+ _("Set the temporary directory [default: ./tmp]"), "DIR" },
{ "extra-appstream-dir", '\0', 0, G_OPTION_ARG_FILENAME, &extra_appstream,
/* TRANSLATORS: command line option */
- _("Use extra appstream data [default: ./appstream-extra]"), "DIR" },
+ _("Use extra appstream data [default: ./appstream-extra]"), "DIR" },
{ "extra-appdata-dir", '\0', 0, G_OPTION_ARG_FILENAME, &extra_appdata,
/* TRANSLATORS: command line option */
- _("Use extra appdata data [default: ./appdata-extra]"), "DIR" },
+ _("Use extra appdata data [default: ./appdata-extra]"), "DIR" },
{ "extra-screenshots-dir", '\0', 0, G_OPTION_ARG_FILENAME, &extra_screenshots,
/* TRANSLATORS: command line option */
- _("Use extra screenshots data [default: ./screenshots-extra]"), "DIR" },
+ _("Use extra screenshots data [default: ./screenshots-extra]"), "DIR" },
{ "output-dir", '\0', 0, G_OPTION_ARG_FILENAME, &output_dir,
/* TRANSLATORS: command line option */
- _("Set the output directory [default: .]"), "DIR" },
+ _("Set the output directory [default: .]"), "DIR" },
{ "cache-dir", '\0', 0, G_OPTION_ARG_FILENAME, &output_dir,
/* TRANSLATORS: command line option */
- _("Set the cache directory [default: ./cache]"), "DIR" },
+ _("Set the cache directory [default: ./cache]"), "DIR" },
{ "basename", '\0', 0, G_OPTION_ARG_STRING, &basename,
/* TRANSLATORS: command line option */
- _("Set the origin name [default: fedora-21]"), "NAME" },
+ _("Set the origin name [default: fedora-21]"), "NAME" },
{ "max-threads", '\0', 0, G_OPTION_ARG_INT, &max_threads,
/* TRANSLATORS: command line option */
- _("Set the number of threads [default: 4]"), "THREAD_COUNT" },
+ _("Set the number of threads [default: 4]"), "THREAD_COUNT" },
{ "api-version", '\0', 0, G_OPTION_ARG_DOUBLE, &api_version,
/* TRANSLATORS: command line option */
- _("Set the AppStream version [default: 0.4]"), "API_VERSION" },
+ _("Set the AppStream version [default: 0.4]"), "API_VERSION" },
{ "screenshot-uri", '\0', 0, G_OPTION_ARG_STRING, &screenshot_uri,
/* TRANSLATORS: command line option */
- _("Set the screenshot base URL [default: none]"), "URI" },
+ _("Set the screenshot base URL [default: none]"), "URI" },
{ "old-metadata", '\0', 0, G_OPTION_ARG_FILENAME, &old_metadata,
/* TRANSLATORS: command line option */
- _("Set the old metadata location [default: none]"), "DIR" },
+ _("Set the old metadata location [default: none]"), "DIR" },
{ NULL}
};
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
option_context = g_option_context_new (NULL);
+
g_option_context_add_main_entries (option_context, options, NULL);
ret = g_option_context_parse (option_context, &argc, &argv, &error);
if (!ret) {
diff --git a/client/as-util.c b/client/as-util.c
index a34d4ce..751fc8e 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -1375,6 +1375,9 @@ main (int argc, char *argv[])
};
setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
/* create helper object */
priv = g_new0 (AsUtilPrivate, 1);
diff --git a/configure.ac b/configure.ac
index ede687a..f85dd08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,14 @@ AC_HEADER_STDC
LT_INIT
AM_PROG_CC_C_O
+# internationalization
+GETTEXT_PACKAGE=appstream-glib
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.17])
+IT_PROG_INTLTOOL([0.40.0])
+
# set up gtk-doc
GTK_DOC_CHECK(1.9)
@@ -151,6 +159,7 @@ data/tests/Makefile
docs/Makefile
docs/api/Makefile
docs/api/version.xml
+po/Makefile.in
])
AC_OUTPUT
AC_MSG_RESULT([
diff --git a/contrib/libappstream-glib.spec.in b/contrib/libappstream-glib.spec.in
index 3bac8d0..dbd019a 100644
--- a/contrib/libappstream-glib.spec.in
+++ b/contrib/libappstream-glib.spec.in
@@ -17,6 +17,8 @@ BuildRequires: gperf
BuildRequires: libarchive-devel
BuildRequires: libsoup-devel
BuildRequires: gdk-pixbuf2-devel
+BuildRequires: gettext
+BuildRequires: intltool
# for the builder component
BuildRequires: fontconfig-devel
@@ -73,11 +75,13 @@ make install DESTDIR=$RPM_BUILD_ROOT
%__rm -f %{buildroot}%{_libdir}/libappstream-builder*.la
%__rm -f %{buildroot}%{_libdir}/asb-plugins/*.la
+%find_lang appstream-glib
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-%files
+%files -f appstream-glib.lang
%doc README.md AUTHORS NEWS COPYING
%{_libdir}/libappstream-glib.so.1*
%{_libdir}/girepository-1.0/*.typelib
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..562ba4c
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1 @@
+ru
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..fd21940
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,42 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --from-code=UTF-8
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Richard Hughes
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = richard@hughsie.com
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..86ec69b
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,5 @@
+# [encoding: UTF-8]
+# List of source files containing translatable strings.
+# Please keep this file sorted alphabetically.
+client/as-builder.c
+client/as-util.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 0000000..85fcc78
--- /dev/null
+++ b/po/POTFILES.skip
@@ -0,0 +1 @@
+data/tests/intltool.appdata.xml.in
diff --git a/po/ru.po b/po/ru.po
new file mode 100644
index 0000000..07577ac
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,300 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: appstream-glib\n"
+"Report-Msgid-Bugs-To: richard@hughsie.com\n"
+"POT-Creation-Date: 2014-06-18 19:20+0400\n"
+"PO-Revision-Date: 2014-06-18 15:21+0000\n"
+"Last-Translator: Igor Gnatenko <i.gnatenko.brain@gmail.com>\n"
+"Language-Team: Russian (http://www.transifex.com/projects/p/appstream-glib/language/ru/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ru\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:71 ../client/as-util.c:1370
+msgid "Show extra debugging information"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:74
+msgid "Do not use the network to download screenshots"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:77
+msgid "Do not delete the decompressed package cache"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:80
+msgid "Perform extra checks on the source metadata"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:83
+msgid "Add a cache ID to each component"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:86
+msgid "Set the logging directory [default: ./logs]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:89
+msgid "Set the packages directory [default: ./packages]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:92
+msgid "Set the temporary directory [default: ./tmp]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:95
+msgid "Use extra appstream data [default: ./appstream-extra]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:98
+msgid "Use extra appdata data [default: ./appdata-extra]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:101
+msgid "Use extra screenshots data [default: ./screenshots-extra]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:104
+msgid "Set the output directory [default: .]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:107
+msgid "Set the cache directory [default: ./cache]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:110
+msgid "Set the origin name [default: fedora-21]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:113
+msgid "Set the number of threads [default: 4]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:116
+msgid "Set the AppStream version [default: 0.4]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:119
+msgid "Set the screenshot base URL [default: none]"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-builder.c:122
+msgid "Set the old metadata location [default: none]"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:136
+#, c-format
+msgid "Failed to parse arguments: %s\n"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:182
+msgid "failed to create temp dir"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:189
+#, c-format
+msgid "failed to create temp dir: %s"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:199
+#, c-format
+msgid "%s has to exist to use old metadata"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:206
+#, c-format
+msgid "failed to create icons dir: %s"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:214 ../client/as-builder.c:220
+msgid "failed to create log dir"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:228 ../client/as-builder.c:236
+#: ../client/as-builder.c:244 ../client/as-builder.c:252
+msgid "failed to create screenshot cache dir"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:258
+msgid "failed to create cache dir"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:282
+#, c-format
+msgid "failed to set up context: %s"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:292
+#, c-format
+msgid "failed to open packages: %s"
+msgstr ""
+
+#. TRANSLATORS: information message
+#: ../client/as-builder.c:305
+#, c-format
+msgid "Scanning packages...\n"
+msgstr ""
+
+#. TRANSLATORS: debug message
+#: ../client/as-builder.c:313
+#, c-format
+msgid "Skipping %s as found in old md cache"
+msgstr ""
+
+#. TRANSLATORS: information message
+#: ../client/as-builder.c:326
+#, c-format
+msgid "Parsed %i/%i files...\n"
+msgstr ""
+
+#. TRANSLATORS: error message
+#: ../client/as-builder.c:339
+#, c-format
+msgid "failed to process context: %s"
+msgstr ""
+
+#. success
+#. TRANSLATORS: information message
+#: ../client/as-builder.c:345
+#, c-format
+msgid "Done!\n"
+msgstr ""
+
+#. TRANSLATORS: this is a command alias
+#: ../client/as-util.c:104
+#, c-format
+msgid "Alias to %s"
+msgstr ""
+
+#: ../client/as-util.c:192
+msgid "Command not found, valid commands are:"
+msgstr ""
+
+#. TRANSLATORS: information message
+#: ../client/as-util.c:305
+#, c-format
+msgid "New API version: %.2f\n"
+msgstr ""
+
+#: ../client/as-util.c:327
+msgid "Not enough arguments, expected old.xml new.xml version"
+msgstr ""
+
+#: ../client/as-util.c:1240 ../client/as-util.c:1267
+msgid "OK"
+msgstr ""
+
+#: ../client/as-util.c:1253
+msgid "FAILED"
+msgstr ""
+
+#: ../client/as-util.c:1264
+msgid "Validation failed"
+msgstr ""
+
+#: ../client/as-util.c:1312
+msgid "Validation of files failed"
+msgstr ""
+
+#. TRANSLATORS: command line option
+#: ../client/as-util.c:1373
+msgid "Show client and daemon versions"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1391
+msgid "Converts AppStream metadata from one version to another"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1397
+msgid "Creates an example Appdata file from a .desktop file"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1403
+msgid "Dumps the applications in the AppStream metadata"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1409
+msgid "Installs AppStream metadata"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1415
+msgid "Uninstalls AppStream metadata"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1421
+msgid "Create an HTML status page"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1427
+msgid "List applications not backed by packages"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1433
+msgid "Validate an AppData or AppStream file"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1439
+msgid "Validate an AppData or AppStream file (relaxed)"
+msgstr ""
+
+#. TRANSLATORS: command description
+#: ../client/as-util.c:1445
+msgid "Validate an AppData or AppStream file (strict)"
+msgstr ""
+
+#. TRANSLATORS: program name
+#: ../client/as-util.c:1458
+msgid "AppStream Utility"
+msgstr ""
+
+#: ../client/as-util.c:1464
+msgid "Failed to parse arguments"
+msgstr ""
+
+#: ../client/as-util.c:1480
+msgid "Version:"
+msgstr ""