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

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

Re: gettext


From: Vlada von Strasnic
Subject: Re: gettext
Date: Tue, 23 Apr 2002 03:41:07 +0200
User-agent: Mutt/1.3.21i

On Mon, Apr 15, 2002 at 02:20:57PM +0200, Bruno Haible wrote:
> 
> > Program just says
> > bindtextdomain(..)  and doesn't receive any information back : 
> >         - if the directory that was argument to bindtextdomain is usable
> 
> It is usable if "ls -l <directory>/*/LC_MESSAGES/<my_program_name>.mo"
> contains some files.
no , 1) i'm inside the program , not on the shell commandline
     2) i don't want to create some queer path in my code . Directory
        structure of catalogs is hidden inside libintl and so libintl
        should provide some interface to it. Creating and checking .mo
        files from some other programs is just duplicating the code !!

> >         - what catalogs are installed there
> ls will tell you.
 
ls will not tell me, because i'm inside the program ( read below )

> >         - if the language , that is requested by LC_ALL or some other
> >                 variable is really there ...
> 
> Use "locale | grep LC_MESSAGES" and the above ls command.

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 ?"
There is no such function ... so better ask
Do you feel, that some similar function should had been exported from libintl ?

 
> >         - if program tries to translate some message, it doesn't really 
> > know 
> >                 if it really get translated ...
> It can do so by comparing the result of gettext(msgid) with msgid
> using ==.
> >                 And if requested more than 
> >                 one language , you have no way to realize into what
> >                 language, it had been really translated !!!!!!!
> Yes. If you are a multilingual person and have declared multiple
> languages in your LANGUAGE environment variable, the gettext function
> will make a best-effort. The program around doesn't need to know into
> which language the message has been translated; only you as the user
> will bother about it.
>
> > This means that its kept magic.
> 
> 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 )

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 ... 
Yes dcigettext have to have 7 arguments . This is not tragedy .


> 
> 
> > How can i write several catalogs for one country.
> > 
> >         ../locale/cs_praha/LC_MESSAGES/my_program_name.mo
> 
> Nearly. More precisely, the @ sign is used as separator by convention:
> 
>          ../locale/cs/LC_MESSAGES/my_program_name.mo
>          ../locale/address@hidden/LC_MESSAGES/my_program_name.mo
>          ../locale/address@hidden/LC_MESSAGES/my_program_name.mo
> 
> This syntax is supported by gettext in the sense that the user who
> sets LANGUAGE="cs" will only get "cs" translations (no variants), but
> the user who sets LANGUAGE="address@hidden" will get messages from the
> address@hidden and cs catalogs, the first one taking priority over the
> second.
> 
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 .
I believed that, documentation in src packege of gettext is the one
which is most up to date and complete. 
Why you have one separate documentation in somewhere... I would
understand it, if the outside one was just subset of the one inside that
src-package. ( description of @modifiers is only in libc )

This was very strange thank you, wasn't ?


below:

Maybe you guess, that i would like gettext with some more talkative 
interface. This doesn't mean to write some big bunch of code. Most of
them is inside n some form. It just needs to wrap it into some function
and export them to world.

I want to know : 
   Is it possible ? Or is gettext written according to some special 
              standard, that prohibit more universal interface. 
   Is there someone , who wants to write it ??
   I will be glad to write it. I did little scan through the sources,
        and was quite disapointed with all that __redirecting__ stuff.
        So if there is someone who will explain me some topics about
        shared libraries and gettext-way of solving them. Let me know.
        I have some stuff already written. In worst case it will not
        be shared library, but just staticaly linked .o to my program.


Thank you for reading my long mails and thank you for answering them...

bye Suk


-- 
signed short            (mail)



reply via email to

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