Charles A Edwards <[EMAIL PROTECTED]> writes:

> On Tue, 24 Jun 2003 17:45:16 +0200 (CEST)
> Thierry Vignaud <[EMAIL PROTECTED]> wrote:
> 
> > Name        : drakxtools                   Relocations: (not
> > relocateable) Version     : 9.2                               Vendor:
> > MandrakeSoft Release     : 0.7mdk                        Build Date:
> > Tue Jun 24 17:26:33 2003 Install date: (not installed)              
> > Build Host: ke.mandrakesoft.com Group       :
> > System/Configuration/Other    Source RPM: (none) Size        : 6237365
> >                          License: GPL
> > Packager    : Thierry Vignaud <[EMAIL PROTECTED]>
> 
>  
> Problems with printerdrake
> 
> [EMAIL PROTECTED] charles]# printerdrake
> N() was called from /usr/lib/libDrakX/printer/data.pm:11 BEFORE gtk2
> initialisation, replace it with a N_() AND a translate() later.

Till: the subroutine N() must not be called from gtk2
initialisation. Therefore, defining data structures at the
top-level of a perl module, containing some N(), will break some
translations, we need to avoid that. You have two solutions to
avoid that:

1. instead of calling N(), you call N_() [this subroutine doesn't
   return the translated string, it only informs our po-extractor
   that the string inside must be put in the po for translation],
   and when you will display this string in your GUI dialog, you
   call translate(): this subroutine will actually return the
   translated string.


2. instead of defining a data-structure at the toplevel, you put
   it in a subroutine, and you call this subroutine to get the
   data-structure instead of using it like a toplevel variable
   (this solution is usually worse than previous because we end
   up with more verbose code). Example:

our @manufacturers = (N("Canon"), N("Epson"), N("HP"));

..

$gtk->display(N("Here is a manufacturer: %s", $_)) foreach @manufacturers;


===> moved to ===>


sub manufacturers {
    return (N("Canon"), N("Epson"), N("HP"));
}

..

$gtk->display(N("Here is a manufacturer: %s", $_)) foreach manufacturers();



Please choose any solution to fix printerdrake. Thanks!


-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/

Reply via email to