From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7165 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: libintl: stubs or working functions? Date: Sun, 8 Mar 2015 20:56:36 -0400 Message-ID: <20150309005636.GY23507@brightrain.aerifal.cx> References: <20150305163649.05a14b30@sibserver.ru> <20150306222415.GR23507@brightrain.aerifal.cx> <20150308162249.163d5212@r2lynx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1425862670 27582 80.91.229.3 (9 Mar 2015 00:57:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Mar 2015 00:57:50 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7178-gllmg-musl=m.gmane.org@lists.openwall.com Mon Mar 09 01:57:46 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YUm0w-0003g8-1k for gllmg-musl@m.gmane.org; Mon, 09 Mar 2015 01:57:46 +0100 Original-Received: (qmail 32395 invoked by uid 550); 9 Mar 2015 00:57:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32198 invoked from network); 9 Mar 2015 00:56:49 -0000 Content-Disposition: inline In-Reply-To: <20150308162249.163d5212@r2lynx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7165 Archived-At: 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