From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7164 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?0KDRi9GB0Yw=?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: libintl: stubs or working functions? Date: Sun, 8 Mar 2015 16:22:49 +0700 Message-ID: <20150308162249.163d5212@r2lynx> References: <20150305163649.05a14b30@sibserver.ru> <20150306222415.GR23507@brightrain.aerifal.cx> 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: quoted-printable X-Trace: ger.gmane.org 1425806252 16746 80.91.229.3 (8 Mar 2015 09:17:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Mar 2015 09:17:32 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7177-gllmg-musl=m.gmane.org@lists.openwall.com Sun Mar 08 10:17:31 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 1YUXL0-0006Kq-F4 for gllmg-musl@m.gmane.org; Sun, 08 Mar 2015 10:17:30 +0100 Original-Received: (qmail 10151 invoked by uid 550); 8 Mar 2015 09:17:26 -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 10087 invoked from network); 8 Mar 2015 09:17:19 -0000 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS autolearn=ham autolearn_force=no version=3.4.0 In-Reply-To: <20150306222415.GR23507@brightrain.aerifal.cx> X-Mailer: claws_mail Xref: news.gmane.org gmane.linux.lib.musl.general:7164 Archived-At: On Fri, 6 Mar 2015 17:24:15 -0500 Rich Felker wrote: > On Thu, Mar 05, 2015 at 04:36:49PM +0700, =D0=A0=D1=8B=D1=81=D1=8C wrote: > > I noticed that musl had got some gettext functions as a lightweight > > and more saner interface. However, I now have a couple questions > > about them as ordinary user. > >=20 > > A bit of history. > > I had successfully built and used custom x86 musl based X11 root > > which uses both Xfbdev and Xorg servers on different machines. It > > is based on my previous musl on servers experience, just added X11 > > and major gui libraries on top of it. > >=20 > > My root attracted a user because of it's small size to fit into > > budget netbook with very small disk size (about 4GB I think). The > > problem is that user does not speak (and understand) English at > > all, but he accepts my preferred program set which I preinstalled > > into root. > >=20 > > So I faced a problem: I had built this root for myself and > > everywhere I did seen "--disable-nls" in configure scripts I used > > it. Now, I tried to rebuild untranslated programs, noticed that > > translation files (.po -> *.gmo) were created and installed > > in /local/share/locale/. > >=20 > > However, trying to define LC_ALL and LANG environment variables as > > in most of glibc systems does not change anything. The programs > > still English translated. > >=20 > > And a couple questions here: > >=20 > > * Did I understand that right that I do not need GNU gettext > > anymore and I can use musl's interface for that? >=20 > Yes, modulo some GNU software (coreutils for example) that probes for > glibc/gnu-libintl internals at configure time and depends on > poorly-designed and undocumented features (SYSDEP strings). These > programs will not work without either GNU libintl or patching out the > bad parts of configure and using a version of msgfmt that works around > the need for SYSDEP strings. I believe the one from sabotage > gettext-tiny does. >=20 > > * Do I still need original GNU gettext to translate *.po's to > > *.gmo's? (I used gettext-tiny) >=20 > gettext-tiny is preferable as long as it works. As mentioned above it > even works around the SYSDEP strings issue. >=20 > > * If musl can handle that, how I should configure it? Are > > environment variables work? >=20 > 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?) Probably application thinks it have found libintl, but for some reason does not enable it's code. >=20 > > Whole story and questions may be stupid if I misunderstand the > > purpose of those functions, so sorry. >=20 > 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? And what symbols should I see in nm output for any application to verify it actually uses NLS? >=20 > 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. >=20 > Rich 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.