diff options
author | Yan Li <yanli@infradead.org> | 2009-12-21 14:43:16 +0800 |
---|---|---|
committer | Yan Li <yanli@infradead.org> | 2009-12-21 14:43:16 +0800 |
commit | 3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c (patch) | |
tree | e30ab02ef3a207bea15e0c34b82115e90ececbfa | |
parent | d1654207be2de598f3a572c99831a19f70443499 (diff) | |
download | gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.tar gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.tar.gz gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.tar.bz2 gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.tar.lz gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.tar.xz gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.tar.zst gsoc2013-evolution-3d84a9bb7ded8e5a412d90df616a9d7bc61cd41c.zip |
Bug #599615 - i18n support for emae and filter-bar when used as lib
This bug is first reported at Moblin Bugzilla:
http://bugzilla.moblin.org/show_bug.cgi?id=4895
Evolution shares some functions to be used by client programs like
Anjal, so we have to use gi18n-lib.h instead of gi18n.lib to get i18n
support.
-rw-r--r-- | e-util/e-config.c | 8 | ||||
-rw-r--r-- | mail/em-account-editor.c | 30 | ||||
-rw-r--r-- | mail/em-popup.c | 4 | ||||
-rw-r--r-- | widgets/misc/Makefile.am | 1 | ||||
-rw-r--r-- | widgets/misc/e-filter-bar.c | 7 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.c | 4 |
6 files changed, 35 insertions, 19 deletions
diff --git a/e-util/e-config.c b/e-util/e-config.c index b9a284b941..31662d0624 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -22,13 +22,15 @@ #ifdef HAVE_CONFIG_H #include <config.h> +#include <glib/gi18n-lib.h> +#else +#include <glib/gi18n.h> #endif #include <string.h> #include <stdlib.h> #include <gtk/gtk.h> -#include <glib/gi18n.h> #include <libgnomeui/gnome-druid.h> #include <libgnomeui/gnome-druid-page-standard.h> @@ -36,8 +38,6 @@ #include "e-config.h" -#include <glib/gi18n.h> - #define d(x) struct _EConfigFactory { @@ -429,7 +429,7 @@ ec_rebuild(EConfig *emp) d(printf(" '%s'\n", item->path)); if (item->label != NULL) - translated_label = gettext (item->label); + translated_label = _(item->label); /* If the last section doesn't contain anything, hide it */ if (sectionnode != NULL diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 195f36e76c..f7418dd8fa 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,9 +37,11 @@ #ifdef HAVE_CONFIG_H #include <config.h> +#include <glib/gi18n-lib.h> +#else +#include <glib/gi18n.h> #endif -#include <glib/gi18n.h> #include <glib/gstdio.h> #include <string.h> @@ -234,6 +237,9 @@ emae_finalise (GObject *o) static void emae_class_init (GObjectClass *klass) { + bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + klass->finalize = emae_finalise; } @@ -400,7 +406,7 @@ emae_display_license (EMAccountEditor *emae, CamelProvider *prov) gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-dialogs.glade", NULL); - xml = glade_xml_new (gladefile, "license_dialog", NULL); + xml = glade_xml_new (gladefile, "license_dialog", GETTEXT_PACKAGE); g_free (gladefile); dialog = glade_xml_get_widget (xml, "license_dialog"); @@ -1828,7 +1834,7 @@ emae_identity_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - xml = glade_xml_new (gladefile, item->label, NULL); + xml = glade_xml_new (gladefile, item->label, GETTEXT_PACKAGE); g_free (gladefile); /* Management & Identity fields, in the druid the management frame is relocated to the last page later on */ @@ -1864,7 +1870,7 @@ emae_identity_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - druidxml = glade_xml_new (gladefile, "identity_page", NULL); + druidxml = glade_xml_new (gladefile, "identity_page", GETTEXT_PACKAGE); g_free (gladefile); page = glade_xml_get_widget (druidxml, "identity_page"); @@ -1899,7 +1905,7 @@ emae_receive_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - xml = glade_xml_new (gladefile, item->label, NULL); + xml = glade_xml_new (gladefile, item->label, GETTEXT_PACKAGE); g_free (gladefile); gui->source.type = CAMEL_PROVIDER_STORE; @@ -1915,7 +1921,7 @@ emae_receive_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - druidxml = glade_xml_new (gladefile, "source_page", NULL); + druidxml = glade_xml_new (gladefile, "source_page", GETTEXT_PACKAGE); g_free (gladefile); page = glade_xml_get_widget (druidxml, "source_page"); @@ -2390,7 +2396,7 @@ emae_send_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *ol gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - xml = glade_xml_new (gladefile, item->label, NULL); + xml = glade_xml_new (gladefile, item->label, GETTEXT_PACKAGE); g_free (gladefile); /* Transport */ @@ -2407,7 +2413,7 @@ emae_send_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *ol gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - druidxml = glade_xml_new (gladefile, "transport_page", NULL); + druidxml = glade_xml_new (gladefile, "transport_page", GETTEXT_PACKAGE); g_free (gladefile); page = glade_xml_get_widget (druidxml, "transport_page"); @@ -2442,7 +2448,7 @@ emae_defaults_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - xml = glade_xml_new (gladefile, item->label, NULL); + xml = glade_xml_new (gladefile, item->label, GETTEXT_PACKAGE); g_free (gladefile); /* Special folders */ @@ -2502,7 +2508,7 @@ emae_security_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - xml = glade_xml_new (gladefile, item->label, NULL); + xml = glade_xml_new (gladefile, item->label, GETTEXT_PACKAGE); g_free (gladefile); /* Security */ @@ -2616,7 +2622,7 @@ emae_management_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidg gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - druidxml = glade_xml_new (gladefile, "management_page", NULL); + druidxml = glade_xml_new (gladefile, "management_page", GETTEXT_PACKAGE); g_free (gladefile); page = glade_xml_get_widget (druidxml, "management_page"); @@ -2644,7 +2650,7 @@ emae_widget_druid_glade (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkW gladefile = g_build_filename (EVOLUTION_GLADEDIR, "mail-config.glade", NULL); - druidxml = glade_xml_new (gladefile, item->label, NULL); + druidxml = glade_xml_new (gladefile, item->label, GETTEXT_PACKAGE); g_free (gladefile); w = glade_xml_get_widget (druidxml, item->label); diff --git a/mail/em-popup.c b/mail/em-popup.c index 4fc912ba07..674cb406f5 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -22,6 +22,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> +#include <glib/gi18n-lib.h> +#else +#include <glib/gi18n.h> #endif #include <string.h> @@ -29,7 +32,6 @@ #include <gio/gio.h> #include <gtk/gtk.h> -#include <glib/gi18n.h> #include "em-popup.h" #include "libedataserver/e-msgport.h" diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am index d6689ef73f..56d0591c7c 100644 --- a/widgets/misc/Makefile.am +++ b/widgets/misc/Makefile.am @@ -7,6 +7,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/a11y/widgets \ -I$(top_srcdir)/widgets \ -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \ + -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DG_LOG_DOMAIN=__FILE__ \ $(EVOLUTION_MAIL_CFLAGS) \ diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c index 5a86f6f3da..a145592e37 100644 --- a/widgets/misc/e-filter-bar.c +++ b/widgets/misc/e-filter-bar.c @@ -23,6 +23,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> +#include <glib/gi18n-lib.h> +#else +#include <glib/gi18n.h> #endif #include <string.h> @@ -30,7 +33,6 @@ #include <libxml/tree.h> #include <libxml/parser.h> -#include <glib/gi18n.h> #include "e-dropdown-button.h" #include "e-filter-bar.h" @@ -911,6 +913,9 @@ class_init (EFilterBarClass *klass) /*gtk_object_add_arg_type ("EFilterBar::query", G_TYPE_STRING, GTK_ARG_READABLE, ARG_QUERY);*/ + bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + #if 0 esb_signals [QUERY_CHANGED] = g_signal_new ("query_changed", diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 0a778531b7..a65517bde0 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> +#include <glib/gi18n-lib.h> +#else +#include <glib/gi18n.h> #endif #include <gdk/gdkkeysyms.h> @@ -31,7 +34,6 @@ #include <misc/e-unicode.h> #include <misc/e-gui-utils.h> -#include <glib/gi18n.h> #include <bonobo/bonobo-ui-util.h> |