I18n in plugin

Hi all,

There are many applications use plugin based architecture to expand it's
function, such as Evolution (EPlugin), Anjuta 2.x, Gedit, Gaim,
Xchat-gnome, etc. The problem is that if the plugins was released
outside of the main app, the user interface of the plugin is NOT I18n
able. even I added bindtextdomain(...) and bind_textdomain_codeset (...)
in the initialize code of the plugin.

In my anjuta-foobar-plugin [1]:

static void
anjuta_plugin_foobar_instance_init (GObject *obj)
	AnjutaFoobarPlugin *plugin = (AnjutaFoobarPlugin*)obj;

	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
	/* textdomain (GETTEXT_PACKAGE); */
	plugin->uiid = 0;
	plugin->widget = NULL;


You cann't use textdomain (...) in a plugin, or you'll get all NEW
interface in english (un i18ned).

Yestoday, I got a remove-duplicates plugin for evolution 2.4 from
#342378 [2], after some hack it for evolution 2.6, added LINGUAS suport,
added zh_CN translate [3], intalled it and got a untranslate menu item
"Remove duplicates". and then I found that there is even not point to
add the bindtextdomain for it, there's only one entrance for this
plugin's functional. how can it could be i18ned?

org_gnome_duplicates_remove (EPlugin *ep, EMPopupTargetSelect *target)
  handle_messages (target->folder, target->uids);

[2] http://bugzilla.gnome.org/show_bug.cgi?id=342378

any comments?

Yang Hong

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