[evolution-patches] Enable gnome-spell to use their own mo files.



Hi, guys,

Please help to review this little patch.

Gnome-spell is a shlib bonobo component, when it's loaded, it will use
message domain of evolution. So some messages show untranslated.

To resolve this problem:
1. redefine macro _(string) to dgettext(GETTEXT_PACKAGE, string), so
that all the message will be retrieved from correct mo file.

2. Add domain parameter when invoking glade_xml_new(), so that the
libglade will use correct mo file.

Regards,

-- 
Yong.Sun <Yong Sun Sun com>
SUN (China) ERI
Index: ChangeLog
===================================================================
RCS file: /export/src/cvs/gnome-spell/gnome-spell/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 ChangeLog
--- ChangeLog	2003/09/26 06:41:09	1.1.1.1
+++ ChangeLog	2003/12/17 10:37:10
@@ -1,3 +1,11 @@
+2003-12-17  Sun Yong <Yong Sun sun com>
+
+	* control.c: add domain parameter when invoke glade_xml_new(), 
+	and bind the domain codeset as UTF-8. Redefine macro _() to use 
+	dgettext() instead of gettext().
+	* dictionary.c: bind the domain codeset as UTF-8. Redefine macro
+	_().
+
 2003-05-16  Radek Doulik  <rodo ximian com>
 
 	* dictionary.c (impl_gnome_spell_dictionary_set_language): NULL
Index: control.c
===================================================================
RCS file: /export/src/cvs/gnome-spell/gnome-spell/control.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 control.c
--- control.c	2003/09/26 06:41:09	1.1.1.1
+++ control.c	2003/12/17 10:37:10
@@ -45,6 +45,11 @@
 #include "Spell.h"
 #include "control.h"
 
+#ifdef _
+    #undef _
+    #define _(string) dgettext(GETTEXT_PACKAGE, string)
+#endif
+
 typedef struct {
 	BonoboControl *control;
 	GNOME_Spell_Dictionary dict;
@@ -408,7 +413,8 @@ gnome_spell_control_new ()
 	GtkWidget *table;
 	GladeXML *xml;
 
-	xml = glade_xml_new (GLADE_DATADIR "/spell-checker.glade", "simple_control", NULL);
+	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+	xml = glade_xml_new (GLADE_DATADIR "/spell-checker.glade", "simple_control", GETTEXT_PACKAGE);
 	if (!xml)
 		g_error (_("Could not load glade file."));
 	table = glade_xml_get_widget (xml, "simple_control");
Index: dictionary.c
===================================================================
RCS file: /export/src/cvs/gnome-spell/gnome-spell/dictionary.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 dictionary.c
--- dictionary.c	2003/09/26 06:41:09	1.1.1.1
+++ dictionary.c	2003/12/17 10:37:10
@@ -36,6 +36,11 @@
 #include "Spell.h"
 #include "dictionary.h"
 
+#ifdef _
+    #undef _
+    #define _(string) dgettext(GETTEXT_PACKAGE, string)
+#endif
+
 static BonoboObjectClass                  *dictionary_parent_class;
 
 #define DICT_DEBUG(x)
@@ -578,5 +583,6 @@ BONOBO_TYPE_FUNC_FULL (
 BonoboObject *
 gnome_spell_dictionary_new (void)
 {
+	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
 	return g_object_new (GNOME_SPELL_DICTIONARY_TYPE, NULL);
 }


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