[gnome-characters/wip/properties] build: Translate strings coming from libunistring
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters/wip/properties] build: Translate strings coming from libunistring
- Date: Tue, 10 Feb 2015 03:32:56 +0000 (UTC)
commit ee30c49af4e5cec0dd2ee0e68c91ba7db81a4849
Author: Daiki Ueno <dueno src gnome org>
Date: Tue Feb 10 12:29:13 2015 +0900
build: Translate strings coming from libunistring
configure.ac | 2 +
lib/Makefile.am | 8 +++++
lib/gen-libunistring-pot.c | 63 ++++++++++++++++++++++++++++++++++++++++++++
po/POTFILES.in | 1 +
src/character.js | 7 +++--
5 files changed, 78 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c15819d..b1eeba8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,8 @@ PKG_CHECK_MODULES([DEPS], [gdk-3.0
AC_PATH_PROG([GJS],[gjs])
+AC_PATH_PROG([MSGUNIQ],[msguniq],[AC_MSG_ERROR([msguniq is required])])
+
AC_ARG_ENABLE(dogtail,
[AS_HELP_STRING([--enable-dogtail],
[test using dogtail [default=yes]])],,
diff --git a/lib/Makefile.am b/lib/Makefile.am
index be84212..ff35c18 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,6 +15,14 @@ libgc_la_LDFLAGS = -avoid-version
libgc_la_sources = gc.h gc.c
libgc_la_SOURCES = $(libgc_la_sources) confusables.h
+noinst_PROGRAMS = gen-libunistring-pot
+gen_libunistring_pot_SOURCES = gen-libunistring-pot.c
+gen_libunistring_pot_LDADD = $(LIBGC_LIBS) $(LTLIBICONV) $(LTLIBUNISTRING) $(builddir)/../gllib/libgnu.la
+
+BUILT_SOURCES = libunistring.pot
+libunistring.pot: gen-libunistring-pot
+ $(AM_V_GEN) $(builddir)/gen-libunistring-pot | $(MSGUNIQ) > $@
+
include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS = Gc-1.0.gir
diff --git a/lib/gen-libunistring-pot.c b/lib/gen-libunistring-pot.c
new file mode 100644
index 0000000..107fe9d
--- /dev/null
+++ b/lib/gen-libunistring-pot.c
@@ -0,0 +1,63 @@
+#include <config.h>
+
+#include <stdio.h>
+#include <unictype.h>
+
+int
+main (int argc, char **argv)
+{
+ const uc_script_t *scripts;
+ const uc_block_t *blocks;
+ size_t count, i;
+
+#define PAIR(str) printf ("msgid \"%s\"\nmsgstr \"\"\n\n", str)
+ PAIR (uc_general_category_long_name (UC_CATEGORY_L));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_LC));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Lu));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Ll));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Lt));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Lm));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Lo));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_M));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Mn));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Mc));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Me));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_N));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Nd));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Nl));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_No));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_P));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Pc));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Pd));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Ps));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Pe));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Pi));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Pf));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Po));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_S));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Sm));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Sc));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Sk));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_So));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Z));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Zs));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Zl));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Zp));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_C));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Cc));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Cf));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Cs));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Co));
+ PAIR (uc_general_category_long_name (UC_CATEGORY_Cn));
+
+ uc_all_scripts (&scripts, &count);
+ for (i = 0; i < count; i++)
+ PAIR (scripts[i].name);
+
+ uc_all_blocks (&blocks, &count);
+ for (i = 0; i < count; i++)
+ PAIR (blocks[i].name);
+#undef PAIR
+
+ return 0;
+}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ec703ac..b7b4941 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -12,3 +12,4 @@ src/main.js
src/params.js
src/util.js
src/window.js
+lib/libunistring.pot
diff --git a/src/character.js b/src/character.js
index a834e87..65e8584 100644
--- a/src/character.js
+++ b/src/character.js
@@ -24,6 +24,7 @@ const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Pango = imports.gi.Pango;
const Gc = imports.gi.Gc;
+const Gettext = imports.gettext;
const Main = imports.main;
const Util = imports.util;
@@ -147,9 +148,9 @@ const CharacterDialog = new Lang.Class({
this._codepoint_label.label =
_("U+%04s").format(Util.hexCodepoint(uc));
- this._category_label.label = Gc.character_category(uc);
- this._script_label.label = Gc.character_script(uc);
- this._block_label.label = Gc.character_block(uc);
+ this._category_label.label = Gettext.gettext(Gc.character_category(uc));
+ this._script_label.label = Gettext.gettext(Gc.character_script(uc));
+ this._block_label.label = Gettext.gettext(Gc.character_block(uc));
this._detail_grid.remove_row(4);
let result = Gc.character_decomposition(uc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]