Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 15 Mar 2015 19:33:39 +0700
From: Рысь <lynx@...server.ru>
To: musl@...ts.openwall.com
Subject: Re: libintl: stubs or working functions?

On Sun, 8 Mar 2015 20:56:36 -0400
Rich Felker <dalias@...c.org> wrote:

> On Sun, Mar 08, 2015 at 04:22:49PM +0700, Рысь wrote:
> > > > * If musl can handle that, how I should configure it? Are
> > > > environment variables work?
> > > 
> > > For translations of musl itself (which don't exist yet) the
> > > MUSL_LOCPATH environment variable needs to be set. But most
> > > programs that use gettext hard-code their own pathnames for
> > > passing to bindtextdomain, and this is the documented correct way
> > > to use the API. So there is no default gettext path in musl.
> > 
> > Interesting. Well, than I need to investigate more. strace does not
> > show any tryings to find or even to poke at locale data installed by
> > application. nm output from binary does not show any "textd"
> > pattern. config.log then says NLS is supported via external
> > libintl.a (did I do a right thing by creating an empty libintl.a
> > file to redirect libintl functions to libc at link time?)
> 
> I don't think this should be needed; programs I've seen that use
> gettext first see if it's available in libc without any additional -l.
> 
> > Probably application thinks it have found libintl, but for some
> > reason does not enable it's code.
> 
> Perhaps.
> 
> > > > Whole story and questions may be stupid if I misunderstand the
> > > > purpose of those functions, so sorry.
> > > 
> > > Not stupid at all. Hope the above helps. Let me know if you have
> > > any more questions.
> > 
> > Okay. Sorry, as for now I did not read locale libc code fully and
> > quite do not understand it (I am in process of rebuilding my
> > primary desktop to move it to my mentioned musl root, that's quite
> > of time consuming).
> > 
> > Example application of question is email client claws-mail (I even
> > use it now to send an email to you, so I can test it). On my system
> > it's locale data is stored
> > into /local/share/locale/ru/LC_MESSAGES/claws-mail.mo. On typical
> > glibc system I needed to set LC_ALL and LANG environment variables
> > to something like "ru_RU.UTF-8". What I should do with musl for _not
> > translating musl_, but for (probably) NLS-enabled external
> > application?
> 
> Have at least LC_MESSAGES set to "ru". Or if you want to be able to
> use "ru_RU", make sure the latter exists in /local/share/locale and
> that it's a symlink to "ru".
> 
> > And what symbols should I see in nm output for any application to
> > verify it actually uses NLS?
> 
> bindtextdomain and something containing gettext (probably dgettext or
> dcgettext).
> 
> > > If you find that lack of translations for the messages from musl
> > > itself (errno strings, etc.) is a problem, I can try to help you
> > > with producing a locale file for musl. I want to get a
> > > musl-locales project started and it would be nice to have a trial
> > > run-through.
> > 
> > Thanks I will happy to at least try! You only should prepare exact
> > instructions and needed software so I can start work quickly :)
> > 
> > If I will catch time right I will try to reach you on IRC at least
> > within next week.
> 
> OK.
> 
> Rich

Ok, for now I am probably stuck with this one, it needs much of reading
from endless strace logs for various gtkware. I got it to include
*gettext syms and now gtk stack calls them, but that's a dead end: even
if I set all LC_/LANG properly I still get English and my debugging
musl which have locale functions with inserted printfs at beginning
show only setlocale(0, "") and that's all. Only few called with proper
arguments. I see .mo's from proper path (containing name of desired
locale, thus = "*/ru/*") are mmaped.

As for now I have no much time to test it (likely I will continue on
this one in next month or so), so I only want to resolve one issue which
still stays: is it permitted to change strftime in a way that "%x" will
return NOT American date with month in beginning, but preferred date
like "%d.%m.%Y" or similar? Will not it break any existing apps?

Thanks.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.