mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Рысь <lynx@sibserver.ru>
To: musl@lists.openwall.com
Subject: Re: libintl: stubs or working functions?
Date: Sun, 15 Mar 2015 19:33:39 +0700	[thread overview]
Message-ID: <20150315193339.3b36e135@r2lynx> (raw)
In-Reply-To: <20150309005636.GY23507@brightrain.aerifal.cx>

On Sun, 8 Mar 2015 20:56:36 -0400
Rich Felker <dalias@libc.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.


  reply	other threads:[~2015-03-15 12:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05  9:36 Рысь
2015-03-06 22:24 ` Rich Felker
2015-03-08  9:22   ` Рысь
2015-03-09  0:56     ` Rich Felker
2015-03-15 12:33       ` Рысь [this message]
2015-03-15 23:54         ` Rich Felker
2015-03-16  4:18           ` Рысь
2015-03-16 13:04             ` Szabolcs Nagy
2015-03-16 13:35               ` Szabolcs Nagy
2015-03-16 13:41             ` Szabolcs Nagy
2015-03-17  1:40               ` Рысь
2015-03-17  2:01                 ` Rich Felker
2015-03-17  6:59                   ` Рысь
2015-03-17 15:02                     ` Szabolcs Nagy
2015-03-17 15:38                       ` Rich Felker
2015-03-17 18:51                         ` Wermut
2015-03-18 14:10                         ` u-wsnj
2015-03-18 14:26                           ` Jens Gustedt
2015-03-19  8:29                           ` Justin Cormack
2015-03-19  8:55                             ` Jens Gustedt
2015-03-19 12:41                             ` u-wsnj
2015-03-19 17:25                               ` stephen Turner
2015-03-20  1:58                                 ` Weldon Goree
2015-03-20  3:11                                   ` Rich Felker
2015-03-19 17:54                               ` Rich Felker
2015-03-20  9:20                                 ` u-wsnj
2015-03-20 20:27                                   ` Rich Felker
2015-03-18  7:15                       ` Рысь
2015-03-24  3:59                     ` Рысь
2015-03-16  9:27           ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150315193339.3b36e135@r2lynx \
    --to=lynx@sibserver.ru \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).