Steve Frécinaux | 6 Dec 11:46 2006
Picon

Re: Localisation of python plugin

Magnus Therning wrote:
> It seems my localisation attempts on epilicious[1] fail miserably.  At
> the moment I have the following code in the plugin:
> How should I do it?

Here is how we do it in gedit-plugins [1] (following code is from the 
terminal plugin [2]):

> import gettext
> from gpdefs import *
> 
> gettext.bindtextdomain(GETTEXT_PACKAGE, GP_LOCALEDIR)
> _ = lambda s: gettext.dgettext(GETTEXT_PACKAGE, s);

gpdefs (which stands for gedit-plugins definitions) is a file generated 
by configure, which basically plays the same role as config.h but for 
python.

I don't know if this approach is likely to work with Epiphany anyway, 
but I guess it should...

[1] http://cvs.gnome.org/viewcvs/gedit-plugins/
[2] 
http://cvs.gnome.org/viewcvs/gedit-plugins/plugins/terminal/terminal.py?rev=1.8&view=markup
[3] 
http://cvs.gnome.org/viewcvs/gedit-plugins/plugins/gpdefs.py.in?rev=1.1&view=markup
Magnus Therning | 6 Dec 13:00 2006

Re: Localisation of python plugin

On Wed, Dec 06, 2006 at 11:46:17 +0100, Steve Frécinaux wrote:
>Magnus Therning wrote:
>> It seems my localisation attempts on epilicious[1] fail miserably.  At
>> the moment I have the following code in the plugin:
>> How should I do it?
>
>Here is how we do it in gedit-plugins [1] (following code is from the 
>terminal plugin [2]):
>
>> import gettext
>> from gpdefs import *
>> 
>> gettext.bindtextdomain(GETTEXT_PACKAGE, GP_LOCALEDIR)
>> _ = lambda s: gettext.dgettext(GETTEXT_PACKAGE, s);
>
>gpdefs (which stands for gedit-plugins definitions) is a file generated
>by configure, which basically plays the same role as config.h but for
>python.
>
>I don't know if this approach is likely to work with Epiphany anyway,
>but I guess it should...

Is there no need to tell glade about the localisation at all then?

/M

--

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus <at> therning.org             Jabber: magnus.therning <at> gmail.com
http://therning.org/magnus
(Continue reading)


Gmane