develooper Front page | perl.i18n | Postings from October 2003

Re: xgettext and parameter reordering

Thread Previous | Thread Next
Guido Flohr
October 6, 2003 08:44
Re: xgettext and parameter reordering
Message ID:
Christophe Chisogne wrote:
> printf(_("I have %1$d houses and %2$d euros"), 2, 2500)

Just for the records: Using "_" as the function name for gettext() has 
two possibly negative effects:  The function will be globally visible 
which is a not so obvious side effect.  I can't remember where this is 
documented but I think the exact rule is that symbols the names of which 
consist of one single non-alphanumeric characters are always global.

Furthermore - as far as I remember - the underscore is the candidate for 
the concatenation operator (replaces the dot) in the future Perl 6.

For both reasons, I have decided to use a double underscore as a 
shorthand to gettext() in libintl-perl.


Imperia AG, Development
Leyboldstr. 10 - D-50354 Hürth -

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About