[Top][All Lists]

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

Re: Coordination on standardizing gettext() in future POSIX

From: Joerg Schilling
Subject: Re: Coordination on standardizing gettext() in future POSIX
Date: Thu, 23 Jan 2020 12:05:40 +0100
User-agent: Heirloom mailx 12.5 7/5/10

Bruno Haible <address@hidden> wrote:

> >     eval echo $(gettext 'Hello World $$')
> No, this is not a reasonable way to use the 'gettext' program either. It fails
> miserably when the translation of 'Hello World $$' contains a semicolon. Try

OK, then use:

        printf "$(gettext 'Hello World %d')\\n" $$

If you use a modern printf(1) implementation (as available in "bosh"), you 
could even use:

        printf "$(gettext 'Hello World %2$d %1$d')\\n"  1 2

to be able to control the order of the output of arguments in a way that is 
specific to the target language. This is why I like to standardize this 
extension in POSIX.

BTW: this extension is also available in /bin/printf on OpenSolaris and FreeBSD.

I see no reason to introduce a completely new method instead of things that are 
already in POSIX or various UNIX implementations since a while.


 EMail:address@hidden                    (home) Jörg Schilling D-13353 Berlin
    address@hidden (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]