Following my email on desktop-devel list, here is the updated patch to
add support for translation in tracker.

As Jamie said on desktop-devel list, there are 2 requests to match: 
      * the only component that need l10n is the search tool 
      * the tracker daemon is fd.o project and should not depend on
        GNOME stuff.

But 'cause tracker yet depends on glib (and glib needs intltool), there
no issues to use intltool. Note that intltool is yet used by other fd.o
project as hal and shared mime info.

So we can move the auto* macros in configure.in outside of the
HAVE_GNOME conditional with no fear. BTW we have to do it, unless the
configure script itself will fail trying to generate stuff in po/
directory when HAVE_GNOME is false. We can't disable configure stuff in
po/ directory at configure time, we have only one AC_OUTPUT...

We can minimize the intltool version request (0.22.0) using the
ALL_LINGUAS macro inside the configure script instead the LINGUAS file
in po/ directory. This is the same configuration of shared-mime-info and
hal.

We can also skip to run `make` and `make install` in po/ directory when
HAVE_GNOME is false. Simply we can remove this directory from
SUBDIRECTORY variable in Makefile.am and add it conditionally when
HAVE_GNOME is true (see the attached patch). Note that I've no idea if
this is bad for distro packages, but it's the same behavior currently
used for tracker.

I'm not an auto* tools guru, so I don't know if the patch works fine on
older system. It works on my jhbuild gnome-2-18 sandbox and it should
work on other systems matching the minimum requests.

So, if someone here is playing with tracker and old GTK/GNOME, please
test this patch before I'll commit on cvs, thanks. You have to run
autogen.sh and make, checking for failures. You should also try to
configure it with and without GNOME libs (you could temporary remote the
gnome-desktop.pc file from $prefix/lib/pkgconfig/). Without GNOME libs,
`make` should ignore po/ and src/tracker-search-tool directories.

Cheers, Luca.

PS there are also some cosmetic changes to other checking statements in
configure, now it's more readable, IMHO.

PPS it seems that intltool will put in PO files all messages in source,
even messages inside comments :-( I'll test if the C style comments (/*
*/)are needed.


Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/tracker/Makefile.am,v
retrieving revision 1.4
diff -n -u -r1.4 Makefile.am
--- Makefile.am	22 Oct 2006 17:53:02 -0000	1.4
+++ Makefile.am	25 Oct 2006 12:16:33 -0000
@@ -1,4 +1,11 @@
-SUBDIRS = data src filters thumbnailers
+if HAVE_GNOME
+tracker_po_dir = po
+else
+tracker_po_dir =
+endif
+
+
+SUBDIRS = data src filters thumbnailers $(tracker_po_dir)
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = tracker.pc
Index: configure.in
===================================================================
RCS file: /cvs/gnome/tracker/configure.in,v
retrieving revision 1.28
diff -n -u -r1.28 configure.in
--- configure.in	19 Oct 2006 01:30:17 -0000	1.28
+++ configure.in	25 Oct 2006 12:16:33 -0000
@@ -79,6 +79,21 @@
 
 fi
 
+####################################################################
+# gettext/intltool support 
+####################################################################
+
+ALL_LINGUAS="it"
+AC_SUBST(ALL_LINGUAS)
+
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
+                   [The gettext translation domain])
+
+AM_GLIB_GNU_GETTEXT
+AC_PROG_INTLTOOL([0.22])
+
 
 ####################################################################
 # Optional database/indexer component checks
@@ -278,13 +293,10 @@
 AC_SUBST(FAM_LIBS)
 
 
-
-
 ##################################################################
-# check for GNOME/GTK dependencies to build tracker search tool (Gnome client)
+# check for GNOME/GTK dependencies to build tracker search tool 
 ##################################################################
 
-
 GTK_REQUIRED=2.8.0
 LIBGNOME_DESKTOP_REQUIRED=2.9.91
 LIBGNOME_REQUIRED=2.13.2
@@ -292,71 +304,32 @@
 LIBGLADE_REQUIRED=2.5.0
 GNOMEVFS_REQUIRED=2.8.4
 
-have_gnome=yes
-
-PKG_CHECK_MODULES(GNOME_UTILS, [gtk+-2.0 >= $GTK_REQUIRED libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED], [] , [have_gnome=no])
-
-PKG_CHECK_MODULES(GNOMEVFS, [gnome-vfs-2.0 >= $GNOMEVFS_REQUIRED gnome-vfs-module-2.0 >= $GNOMEVFS_REQUIRED], [] , [have_gnome=no])
-
-PKG_CHECK_MODULES(GNOMEDESKTOP, [gnome-desktop-2.0 >= $LIBGNOME_DESKTOP_REQUIRED], [] , [have_gnome=no])
-
+PKG_CHECK_MODULES(GNOME_UTILS, [
+        gtk+-2.0 >= $GTK_REQUIRED
+        libgnome-2.0 >= $LIBGNOME_REQUIRED
+        libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED],
+        [have_gnome=yes] , [have_gnome=no])
+
+PKG_CHECK_MODULES(GNOMEVFS, [
+        gnome-vfs-2.0 >= $GNOMEVFS_REQUIRED
+        gnome-vfs-module-2.0 >= $GNOMEVFS_REQUIRED],
+        [have_gnome=yes] , [have_gnome=no])
+
+PKG_CHECK_MODULES(GNOMEDESKTOP, [
+        gnome-desktop-2.0 >= $LIBGNOME_DESKTOP_REQUIRED],
+        [have_gnome=yes] , [have_gnome=no])
 
 AM_CONDITIONAL(HAVE_GNOME, test "$have_gnome" = "yes")
 AC_SUBST(GNOME_UTILS_CFLAGS)
 AC_SUBST(GNOME_UTILS_LIBS)
-AC_SUBST(GNOMEDESKTOP_CFLAGS)
-AC_SUBST(GNOMEDESKTOP_LIBS)
 AC_SUBST(GNOMEVFS_CFLAGS)
 AC_SUBST(GNOMEVFS_LIBS)
+AC_SUBST(GNOMEDESKTOP_CFLAGS)
+AC_SUBST(GNOMEDESKTOP_LIBS)
+test "$have_gnome" = "yes" && AC_DEFINE(HAVE_GNOME, [], [Define if we have gnome])
 
-if test "$have_gnome" = "yes"; 
-then
-
-GNOME_COMMON_INIT
-
-#  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
-#    GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
-#  else
-#    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
-#  fi
-
-# AC_ARG_WITH(gconf-source, 
-#  [  --with-gconf-source=sourceaddress      Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
-
-#  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
-#  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
-
-#  if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
-#    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
-#  fi
-
-# AC_ARG_WITH(gconf-schema-file-dir, 
-# [  --with-gconf-schema-file-dir=dir        Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
-
-#  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
-#  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
-
-#  AC_ARG_ENABLE(schemas-install,
-#     [  --disable-schemas-install	Disable the schemas installation],
-#     [case ${enableval} in
-#       yes|no) ;;
-#       *) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
-#      esac])
-#  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
-
-
-GETTEXT_PACKAGE=gnome-utils-2.0
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Define the gettext
-package to use])
-AC_SUBST(GETTEXT_PACKAGE)
-AM_GLIB_GNU_GETTEXT
-
-# AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
-# this is the directory where the *.{mo,gmo} files are installed
-gnomeutilslocaledir='${prefix}/${DATADIRNAME}/locale'
-AC_SUBST(gnomeutilslocaledir)
-
-
+if test "$have_gnome" = "yes"; then
+   GNOME_COMMON_INIT
 fi
 
 
@@ -370,7 +343,11 @@
 CAIRO_REQUIRED=1.0
 GDK_REQUIRED=1.0
 
-PKG_CHECK_MODULES(POPPLER_GLIB, [poppler-glib >= $POPPLER_GLIB_REQUIRED cairo >= $CAIRO_REQUIRED gdk-2.0 >= $GDK_REQUIRED], [have_poppler=yes] , [have_poppler=no])
+PKG_CHECK_MODULES(POPPLER_GLIB, [
+        poppler-glib >= $POPPLER_GLIB_REQUIRED
+        cairo >= $CAIRO_REQUIRED
+        gdk-2.0 >= $GDK_REQUIRED],
+        [have_poppler=yes] , [have_poppler=no])
 
 AM_CONDITIONAL(HAVE_POPPLER_GLIB, test "$have_poppler" = "yes")
 AC_SUBST(POPPLER_GLIB_CFLAGS)
@@ -383,7 +360,9 @@
 
 VORBIS_REQUIRED=1.1
 
-PKG_CHECK_MODULES(VORBIS, [vorbisfile >= $VORBIS_REQUIRED], [have_vorbis=yes] , [have_vorbis=no])
+PKG_CHECK_MODULES(VORBIS, [
+        vorbisfile >= $VORBIS_REQUIRED],
+        [have_vorbis=yes] , [have_vorbis=no])
 
 AM_CONDITIONAL(HAVE_VORBIS, test "$have_vorbis" = "yes")
 AC_SUBST(VORBIS_CFLAGS)
@@ -396,7 +375,9 @@
 
 LIBPNG_REQUIRED=1.2
 
-PKG_CHECK_MODULES(LIBPNG, [libpng >= $LIBPNG_REQUIRED], [have_libpng=yes] , [have_png=no])
+PKG_CHECK_MODULES(LIBPNG, [
+        libpng >= $LIBPNG_REQUIRED],
+        [have_libpng=yes] , [have_png=no])
 
 AM_CONDITIONAL(HAVE_LIBPNG, test "$have_libpng" = "yes")
 AC_SUBST(LIBPNG_CFLAGS)
@@ -410,7 +391,9 @@
 
 LIBEXIF_REQUIRED=0.6
 
-PKG_CHECK_MODULES(LIBEXIF, [libexif >= $LIBEXIF_REQUIRED], [have_libexif=yes] , [have_libexif=no])
+PKG_CHECK_MODULES(LIBEXIF, [
+        libexif >= $LIBEXIF_REQUIRED],
+        [have_libexif=yes] , [have_libexif=no])
 
 AM_CONDITIONAL(HAVE_LIBEXIF, test "$have_libexif" = "yes")
 AC_SUBST(LIBEXIF_CFLAGS)
@@ -423,7 +406,9 @@
 
 LIBGSF_REQUIRED=1.13
 
-PKG_CHECK_MODULES(LIBGSF, [libgsf-1 >= $LIBGSF_REQUIRED], [have_libgsf=yes] , [have_libgsf=no])
+PKG_CHECK_MODULES(LIBGSF, [
+        libgsf-1 >= $LIBGSF_REQUIRED],
+        [have_libgsf=yes] , [have_libgsf=no])
 
 AM_CONDITIONAL(HAVE_LIBGSF, test "$have_libgsf" = "yes")
 AC_SUBST(LIBGSF_CFLAGS)
@@ -474,8 +459,8 @@
 	src/trackerd/Makefile
 	src/libtracker/Makefile
 	src/tracker-search-tool/Makefile
+	po/Makefile.in
 ])
-
 
 AC_OUTPUT
 
Index: src/tracker-search-tool/tracker-search-tool.c
===================================================================
RCS file: /cvs/gnome/tracker/src/tracker-search-tool/tracker-search-tool.c,v
retrieving revision 1.4
diff -n -u -r1.4 tracker-search-tool.c
--- src/tracker-search-tool/tracker-search-tool.c	23 Oct 2006 00:15:36 -0000	1.4
+++ src/tracker-search-tool/tracker-search-tool.c	25 Oct 2006 12:16:33 -0000
@@ -89,13 +89,13 @@
 };
 
 static service_info_t services[8] = {
-   { "Files",             "system-file-manager",      SERVICE_FILES         },
-   { "Development Files", "applications-development", SERVICE_DEVELOPMENT_FILES },
-   { "Documents",         "x-office-document",        SERVICE_DOCUMENTS     },
-   { "Images",            "image",         	      SERVICE_IMAGES        },
-   { "Music",             "audio-x-generic",          SERVICE_MUSIC         },
-   { "Text Files",        "text-x-generic",           SERVICE_TEXT_FILES    },
-   { "Videos",            "video-x-generic",          SERVICE_VIDEOS        },
+   { N_("Files"),             "system-file-manager",      SERVICE_FILES         },
+   { N_("Development Files"), "applications-development", SERVICE_DEVELOPMENT_FILES },
+   { N_("Documents"),         "x-office-document",        SERVICE_DOCUMENTS     },
+   { N_("Images"),            "image",         	      SERVICE_IMAGES        },
+   { N_("Music"),             "audio-x-generic",          SERVICE_MUSIC         },
+   { N_("Text Files"),        "text-x-generic",           SERVICE_TEXT_FILES    },
+   { N_("Videos"),            "video-x-generic",          SERVICE_VIDEOS        },
    { NULL,                NULL,                       -1                    }
 };
 
@@ -245,7 +245,7 @@
                                          GTK_ICON_LOOKUP_USE_BUILTIN,
                                          &error);
 	   	gtk_list_store_append (store, &iter);
-	   	gtk_list_store_set (store, &iter, 0, pixbuf, 1, service->service, 2, service->service_type, -1);
+	   	gtk_list_store_set (store, &iter, 0, pixbuf, 1, _(service->service), 2, service->service_type, -1);
    	}
 
    	gtk_combo_box_set_active (combo, 0);
@@ -2142,7 +2142,7 @@
 	vbox = gtk_hbox_new (FALSE, 2);
 	gtk_box_pack_start (GTK_BOX (container), vbox, FALSE, FALSE, 0);
 
-	widget = gtk_button_new_with_mnemonic ("_Next");
+	widget = gtk_button_new_with_mnemonic (_("_Next"));
 	image = gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON);
 	gtk_button_set_image (GTK_BUTTON (widget), image);
 	gsearch->forward_button = widget;
@@ -2150,7 +2150,7 @@
 	                  G_CALLBACK (click_find_cb), (gpointer) gsearch);
 	gtk_box_pack_end (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
 
-	widget = gtk_button_new_with_mnemonic ("_Previous");
+	widget = gtk_button_new_with_mnemonic (_("_Previous"));
 	image = gtk_image_new_from_stock (GTK_STOCK_GO_BACK, GTK_ICON_SIZE_BUTTON);
 	gtk_button_set_image (GTK_BUTTON (widget), image);
 	gsearch->back_button = widget;
_______________________________________________
tracker-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to