From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7195 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: Mon, 16 Mar 2015 11:18:46 +0700 Message-ID: <20150316111846.5ce6a90e@r2lynx> References: <20150305163649.05a14b30@sibserver.ru> <20150306222415.GR23507@brightrain.aerifal.cx> <20150308162249.163d5212@r2lynx> <20150309005636.GY23507@brightrain.aerifal.cx> <20150315193339.3b36e135@r2lynx> <20150315235418.GU23507@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_//RjI.I4wwruNKWB5v5YSc0" X-Trace: ger.gmane.org 1426479169 19473 80.91.229.3 (16 Mar 2015 04:12:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Mar 2015 04:12:49 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7208-gllmg-musl=m.gmane.org@lists.openwall.com Mon Mar 16 05:12:48 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 1YXMOV-0000le-Sh for gllmg-musl@m.gmane.org; Mon, 16 Mar 2015 05:12:47 +0100 Original-Received: (qmail 5993 invoked by uid 550); 16 Mar 2015 04:12:46 -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 5972 invoked from network); 16 Mar 2015 04:12:45 -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: <20150315235418.GU23507@brightrain.aerifal.cx> X-Mailer: claws_mail Xref: news.gmane.org gmane.linux.lib.musl.general:7195 Archived-At: --MP_//RjI.I4wwruNKWB5v5YSc0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sun, 15 Mar 2015 19:54:18 -0400 Rich Felker wrote: > On Sun, Mar 15, 2015 at 07:33:39PM +0700, =D0=A0=D1=8B=D1=81=D1=8C wrote: > > 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 =3D "*/ru/*") are mmaped. > >=20 > > 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? >=20 > I'm not aware one way or the other whether it would break existing > applications for strftime to format %x in a non-conforming way for the > C locale. It's certainly possible that this could break apps, since > the C standard specifies an exact date/time format for the C locale, > but it's probably not extremely likely. >=20 > To achieve this with a locale (which should not break anything), you > would just need to make a po file that maps the string "%m/%d/%y" to > "%d.%m.%Y" or similar, build this into a .mo file named "ru_RU" (with > no extension), and drop it into a directory in $MUSL_LOCPATH (which > you should set). Then LC_DATE=3Dru_RU would give your desired > formatting. >=20 > This ru_RU locale file could also be extended with translations for > error messages, mappings for other date/time formats, etc. >=20 > Rich Hm, I tried this now but without success :-( I searched for po file layout and I assume this is something like this: % cat ru_RU.po = =20 # strftime %x msgid "%m/%d/%y" msgstr "%d.%m.%Y" then, I do translate it into .mo file without extension: % mkdir ru % msgfmt ru_RU.po -o ru/ru_RU % file ru/ru_RU ru/ru_RU: GNU-format message catalog data % strings -a ru/ru_RU %m/%d/%y %d.%m.%Y I have this test program: % cat dt.c = =20 #include #include int main(void) { char x[32]; struct tm *tm; time_t t; t =3D time(NULL); tm =3D localtime(&t); strftime(x, sizeof(x), "%x", tm); printf("%s\n", x); return 0; } (compile it as usual) and not, with MUSL_LOCPATH=3D$(pwd)/ru LC_DATE=3Dru_RU ./dt, I still see 03/16/15. Not even with LC_TIME and LC_ALL/LANG pair. I attach strace log, but it probably useless, it only shows no files are included. Same with musl from git (I currently on musl 1.1.4). Am I completely messed something? --MP_//RjI.I4wwruNKWB5v5YSc0 Content-Type: application/octet-stream; name=dt.log Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=dt.log ZXhlY3ZlKCIuL2R0IiwgWyIuL2R0Il0sIFsvKiAyMiB2YXJzICovXSkgPSAwCnNldF90aHJlYWRf YXJlYSh7ZW50cnlfbnVtYmVyOi0xIC0+IDEyLCBiYXNlX2FkZHI6MHhmNzc4ZmFhNCwgbGltaXQ6 MTA0ODU3NSwgc2VnXzMyYml0OjEsIGNvbnRlbnRzOjAsIHJlYWRfZXhlY19vbmx5OjAsIGxpbWl0 X2luX3BhZ2VzOjEsIHNlZ19ub3RfcHJlc2VudDowLCB1c2VhYmxlOjF9KSA9IDAKc2V0X3RpZF9h ZGRyZXNzKDB4Zjc3OGZhYmMpICAgICAgICAgICAgID0gMzE1MTkKY2xvY2tfZ2V0dGltZShDTE9D S19SRUFMVElNRSwgezE0MjY0NzkzNjgsIDI2MzM4NjM3Mn0pID0gMApvcGVuKCIvZXRjL2xvY2Fs dGltZSIsIE9fUkRPTkxZfE9fTk9OQkxPQ0t8T19MQVJHRUZJTEV8T19DTE9FWEVDKSA9IDMKZnN0 YXQ2NCgzLCB7c3RfbW9kZT0wMTcxMDQ0LCBzdF9zaXplPTEsIC4uLn0pID0gMAptbWFwMigpICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAweGY3NmU0MDAwCmNsb3NlKDMpICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9IDAKaW9jdGwoMSwgU05EQ1RMX1RNUl9USU1FQkFT RSBvciBTTkRSVl9USU1FUl9JT0NUTF9ORVhUX0RFVklDRSBvciBUQ0dFVFMsIDB4ZmY5MTk4ZTQp ID0gLTEgRU5PVFRZIChOb3QgYSB0dHkpCndyaXRldigxLCBbeyIwMy8xNi8xNSIsIDh9LCB7Ilxu IiwgMX1dLCAyMDMvMTYvMTUKKSA9IDkKZXhpdF9ncm91cCgwKSAgICAgICAgICAgICAgICAgICAg ICAgICAgID0gPwo= --MP_//RjI.I4wwruNKWB5v5YSc0--