Re: [evolution-patches] A i18n fix for importer file type -- (gettext is missed)



Oh, sorry, I thought GList could be used as GSList (though it could be so far).

I re-attached the patch, please help to review it.

Regards,

Not Zed wrote:

On Wed, 2005-04-06 at 14:20 +0800, Yong Sun wrote:

Hi, Not,

The translations are in mo files, because all these msgid and msgstr
are in po files. I already verified in local.

However your suggestion is right, I attached the new patch, please help to review it.

PS: We should not free the GList returned by gnome_i18n_get_language_list ()
No we shouldn't, but note that gnome_i18n_get_language_list() actually takes a GSList not a GList, so that is why the other code converts the list first. That is why the list is freed, but it is a different list :)


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1505
diff -u -p -r1.1505 ChangeLog
--- ChangeLog	21 Mar 2005 21:40:25 -0000	1.1505
+++ ChangeLog	6 Apr 2005 08:28:31 -0000
@@ -1,3 +1,8 @@
+2005-04-06  Yong Sun <Yong Sun Sun COM>
+
+	* e-shell-importer.c: (get_name_from_component_info):
+	Return the localized name of the supported file type.
+
 2005-03-21  JP Rosevear  <jpr novell com>
 
 	Fixes #73066
Index: e-shell-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-importer.c,v
retrieving revision 1.79
diff -u -p -r1.79 e-shell-importer.c
--- e-shell-importer.c	21 Jan 2005 06:18:54 -0000	1.79
+++ e-shell-importer.c	6 Apr 2005 08:28:50 -0000
@@ -318,16 +318,22 @@ free_iid_list (GList *list)
 static const char *
 get_name_from_component_info (const Bonobo_ServerInfo *info)
 {
-	Bonobo_ActivationProperty *property;
-	const char *name;
+        const char *name = NULL;
 
-	property = bonobo_server_info_prop_find ((Bonobo_ServerInfo *) info, "evolution:menu_name");
-	if (property == NULL || property->v._d != Bonobo_ACTIVATION_P_STRING)
-		return NULL;
+        GSList *language_list = NULL;
+        const GList *l = gnome_i18n_get_language_list("LC_MESSAGES");
 
-	name = property->v._u.value_string;
+        /* copy this piece of code from e-shell-settings-dialog.c:load_pages () */
+        for (language_list=NULL;l;l=l->next)
+                language_list = g_slist_append(language_list, l->data);
 
-	return name;
+        name = bonobo_server_info_prop_lookup ((Bonobo_ServerInfo *) info,
+                                               "evolution:menu_name",
+                                               language_list);
+
+        g_slist_free (language_list);
+
+        return name;
 }
 
 static char *


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