From a418558b73bce78099347cb17ca55738a83c09c1 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 24 Jul 2009 18:11:14 -0400 Subject: [PATCH] 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 | 28 +++++++++++++++++++++------- configure.ac | 4 ++++ po/LINGUAS | 0 po/POTFILES.in | 5 +++++ src/Makefile.am | 3 ++- src/gnome-shell-plugin.c | 3 +++ 7 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 po/LINGUAS create mode 100644 po/POTFILES.in diff --git a/Makefile.am b/Makefile.am index 8105df567..baf7dcb5a 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 9fd4a8d7f..54b24b66d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,8 +1,22 @@ -#!/bin/sh +#!/bin/bash +# Run this to generate all the initial makefiles, etc. -(cd `dirname $0`; - touch ChangeLog NEWS && - autoreconf --install --symlink && - autoreconf && - ./configure --enable-maintainer-mode $@ -) +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 a93de6497..78d17a731 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 000000000..e69de29bb diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 000000000..7754f62c9 --- /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 ca87573d5..a050e9cd0 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 a9e5d69da..f816dadd7 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