|
From: Igor M. <e-...@da...> - 2012-11-21 21:26:57
|
Here is a patch that makes Everything's plugin and action names
translatable.
I think i should explain why this patch actually works :)
Some macros used this way:
p = EVRY_PLUGIN_BASE("Settings", "configure", E_SETTINGS, _begin,
_finish, _fetch);
and the macro is defined like this:
/* creates a Evry_Plugin to be registered with evry */
#define EVRY_PLUGIN_BASE(_name, _icon, _item_type, _begin, _finish, _fetch) \
evry->plugin_new(EVRY_PLUGIN(E_NEW(Evry_Plugin, 1)), _name, _(_name),
_icon, $ _begin, _finish, _fetch)
so the _name argument (string "Settings" in this case) is used two times in
evry->plugin_new() call and one of these times it is used inside _(), so
the _name is actually translated by gettext.
The same happens with EVRY_ACTION_NEW which is defined in the
similar manner:
#define EVRY_ACTION_NEW(_name, _in1, _in2, _icon, _action, _check) \
evry->action_new(N_(_name), _(_name), _in1, _in2, _icon, _action, _check)
But i'm not sure if this a best solution of the problem,
so comments are welcome :)
If the patch is ok, then similar changes should be made to
E-MODULES-EXTRA/everything-* modules as well.
-- Igor
|