Re: Another case of gettext with Gtk2::GladeXML

I traced the script and found that it is only looking for

You need to either put the .mo file in one of those places, or find some
way to tell libglade to look in a different directory for the
translation (there may be an environment variable to help here)


On Thu, 2006-08-17 at 02:45 -0400, Pascal wrote:
Hi Chris,
  for a moment I thought it could have been it...
but nope, i tried:
  $xml_root = Gtk2::GladeXML->new( $glade_dir."/",
undef, 'joellisme' );

still the same results :-(
glade file is ignored...


On 8/17/06, Chris Debenham <chris adebenham com> wrote:
Ahh, I see your problem.
When you load the glade you use

  $xml_root = Gtk2::GladeXML->new( $glade_dir."/" );

To get gettext to handle the glade you need to add the DOMAIN option.
Change the line to

  $xml_root = Gtk2::GladeXML->new( $glade_dir."/", 'gui',

and give it another try.
I'm not sure if you need the 'gui' bit, you may be able to leave this as


On Thu, 2006-08-17 at 01:00 -0400, Pascal wrote:  $xml_root =
 i'd like to came back on the email:

I can get the translation working no problem for the code part
(, but not the glade file.
Including Chris' code (see EXPERIMENTAL section in, i
get an error at runtime:
 Subroutine main::gettext redefined at /usr/share/perl/5.8/ line 65.
 at ./ line 40

And the interface part doesn't get translated.
You can reproduce by running in fr_CA, type hoax, click search and
look if the button Ignore is Ignorer.

My translations are in po/ .
I update them with a small Makefile for the moment.
Use "make" to see the different possibilities.
"make all" will update the .pot, update the po file, convert to mo
file, install mo file in ../LocaleData .

thanks for any tips/help,

Homepage (
Debian GNU/Linux (

  ,-_|\  RSD Engineer                        E-mail : debenham sun com
 /     \ Sun Microsystems Australia Pty Ltd. Direct : +61 (2) 9844 5188
 \_,-\_* 828 Pacific Highway                 Phone  : +61 (2) 9844 5000
      v  Gordon, N.S.W. 2072                 Fax    : +61 (2) 9844 5189
                                             Mobile : +61 (40) 9844 514
Death Is Hereditary.

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