bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gettext


From: Bruno Haible
Subject: Re: gettext
Date: Mon, 29 Apr 2002 12:25:31 +0200 (CEST)

Vlada von Strasnic writes:

> The question was meant in this way:  I will check return value from
> setlocale() and realize , that it's some different language then default
> one. Then i will perform some t=gettext(s) ; if (s==t) or maybe strcmp
> and realize that it's untranslated...
>         ==> this is indirect proof that catalog for that language is
> missing , so my question should have been : 
> Is there some direct way of asking gettext "Have you catalog for language XXX 
> ?"

No, and this question does not have practical relevance because:
1. Even if the catalog for language XXX exists, some messages in it
might be untranslated.
2. Even if the catalog for language pt_BR does not exist, the catalog
for language pt might exist and be usable.
3. Even if the catalog for language XXX does not exist, the user might
have specified some other languages to try in his LANGUAGE environment
variable.

> There is no such function ... so better ask
> Do you feel, that some similar function should had been exported from libintl 
> ?

No. The "have you" question is best asked on the message level, and
there you have the answer through gettext(s)==s.

> > I see. You want some logging message that output some information to
> > stderr.
> >
> logging on stderr is worse you can do ( gtk2.0 prints so many warnings
> on the stderr, that very soon, no one will read it . It also scrolls
> fast )

I meant logging on stderr that is activated only if you set a certain,
documented environment variable.

We all agree that libraries should be mostly silent by default. gtk is
not silent because it contains many workarounds (to problems in X11
which has barely evolved from 1994 to 2000).

> Back to topic. For me it's not hard to imagine function with one more
> argument. Program's who don't care, will insert NULL, the one's who
> will bother will supply some struct.
>         string2 = gettext(string, &info_what_happened) ;
>         if ( info_what_happened.blablabla ... 

What other fallback mechanisms do you wish to have in this 'if'
branch? Isn't the LANGUAGE variable enough customzability for all
kinds of users?

> I didn't thank to all, who answered this question. The most valuable was
> to read info pages of gettext inside libc.
> 
> So i have to react on it. Why there are two documentation on gettext .

Because Ulrich, after writing the one for the gettext package,
couldn't stop and also wrote the gettext documentation for glibc :-)

> i would like gettext with some more talkative interface. ...
> I want to know : 
>    Is it possible ? Or is gettext written according to some special 
>               standard, that prohibit more universal interface. 

gettext was designed as a ready-to-use function, not a utility
function library, so that the users get the _same_ i18n related
behaviour from all applications. It wouldn't be good if some programs
use the LANGUAGE environment variable and some didn't, or when some
programs fall back to English error messages while others fall back to
error numbers.

>         I did little scan through the sources,
>         and was quite disapointed with all that __redirecting__ stuff.

That's a trick for writing portable libraries that provide
functionalities that some systems consider as system functions and
some don't.

>         So if there is someone who will explain me some topics about
>         shared libraries and gettext-way of solving them.

There are enough comments in intl-compat.c.

Bruno



reply via email to

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