[gnome-shell] Add localization



commit a418558b73bce78099347cb17ca55738a83c09c1
Author: Colin Walters <walters verbum org>
Date:   Fri Jul 24 18:11:14 2009 -0400

    Add localization
    
    Infrastructure for localization; hook up intltool, create po/
    and po/POTFILES.in.  We need to call bindtextdomain/bind_textdomain_codeset.
    
    Switch to gnome-autogen.sh to call intltool.

 Makefile.am              |    2 +-
 autogen.sh               |   30 ++++++++++++++++++++++--------
 configure.ac             |    4 ++++
 po/POTFILES.in           |    5 +++++
 src/Makefile.am          |    3 ++-
 src/gnome-shell-plugin.c |    3 +++
 6 files changed, 37 insertions(+), 10 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 8105df5..baf7dcb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = data js src
+SUBDIRS = data js src po
 
 EXTRA_DIST =		\
 	.project	\
diff --git a/autogen.sh b/autogen.sh
index 9fd4a8d..54b24b6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,8 +1,22 @@
-#!/bin/sh
-
-(cd `dirname $0`;
-    touch ChangeLog NEWS &&
-    autoreconf --install --symlink &&
-    autoreconf &&
-    ./configure --enable-maintainer-mode $@
-)
+#!/bin/bash
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="gnome-shell"
+REQUIRED_AUTOMAKE_VERSION=1.10
+
+(test -f $srcdir/configure.ac \
+  && test -d $srcdir/src) || {
+    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+    echo " top-level gnome-shell directory"
+    exit 1
+}
+
+which gnome-autogen.sh || {
+    echo "You need to install gnome-common from GNOME Subversion (or from"
+    echo "your OS vendor's package manager)."
+    exit 1
+}
+USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index a93de64..78d17a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,9 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
 
 PKG_PROG_PKG_CONFIG(0.16)
 
+IT_PROG_INTLTOOL(0.26)
+AM_GLIB_GNU_GETTEXT
+
 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
 AM_GCONF_SOURCE_2
 
@@ -120,4 +123,5 @@ AC_OUTPUT([
   js/misc/Makefile
   js/ui/Makefile
   src/Makefile
+  po/Makefile.in
 ])
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..e69de29
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..7754f62
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,5 @@
+js/ui/panel.js
+js/ui/overlay.js
+src/gdmuser/gdm-user.c
+src/shell-global.c
+src/shell-status-menu.c
diff --git a/src/Makefile.am b/src/Makefile.am
index ca87573..a050e9c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,8 @@ gnome_shell_cflags =				\
 	$(MUTTER_PLUGIN_CFLAGS)			\
         $(LIBGNOMEUI_CFLAGS)                    \
 	-I$(srcdir)/tray			\
-	-DGETTEXT_PACKAGE=gnome-shell		\
+	-DGETTEXT_PACKAGE=\"gnome-shell\"		\
+	-DLOCALEDIR=\"$(datadir)/locale\" \
 	-DGNOME_SHELL_DATADIR=\"$(pkgdatadir)\"	\
 	-DGNOME_SHELL_PKGLIBDIR=\"$(pkglibdir)\" \
 	-DJSDIR=\"$(pkgdatadir)/js\"
diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c
index a9e5d69..f816dad 100644
--- a/src/gnome-shell-plugin.c
+++ b/src/gnome-shell-plugin.c
@@ -153,6 +153,9 @@ gnome_shell_plugin_constructed (GObject *object)
   ClutterBackend *backend;
   cairo_font_options_t *font_options;
 
+  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
   /* Disable text mipmapping; it causes problems on pre-GEM Intel
    * drivers and we should just be rendering text at the right
    * size rather than scaling it. If we do effects where we dynamically



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]