From owner-freebsd-questions Wed Apr 29 19:18:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA07464 for freebsd-questions-outgoing; Wed, 29 Apr 1998 19:18:35 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from tera.com (tera.tera.com [207.108.223.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA07175 for ; Wed, 29 Apr 1998 19:16:51 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from uucp@localhost) by tera.com (8.8.7/8.7.3) with UUCP id TAA04201 for freebsd-questions@FreeBSD.ORG; Wed, 29 Apr 1998 19:16:07 -0700 (PDT) Received: (from kline@localhost) by tao.thought.org (8.8.5/8.7.3) id TAA01154 for freebsd-questions@FreeBSD.ORG; Wed, 29 Apr 1998 19:15:53 -0700 (PDT) From: Gary Kline Message-Id: <199804300215.TAA01154@tao.thought.org> Subject: locale (( did this make it out?)) To: freebsd-questions@FreeBSD.ORG (FreeBSD Mailing List) Date: Wed, 29 Apr 1998 19:15:53 -0700 (PDT) Organization: <> thought.org: public access uNix in service... <> X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG (( I send this mail mid-afternoon but never saw it on the the list; thus this re-send. Sorry if it *did* get out and I missed it.)) --gdk Hello, I'm interested in testing the locale library to see how to (for example) print an error messsage or a date in German, Danish, Norwegian. We've got the code in $lib/libc/locate, and I see the data in /usr/share/locale, but so far my few lines of code aren't doing very much. Anyone know how to implement this? I probably should add some pseudo-code so that folks understand what I'm trying...and fumbling with. In main I set the locale to de_DE: ... setlocale(LC_ALL, de_DE); // malloc struct lconv *lp lp = localeconv(); // then attempt to print the struct members: printf ("lp->decimal_point = [%s]\n", lp->decimal_point); printf ("lp->thousands_sep = [%s]\n", lp->thousands_sep); printf ("lp->currency_symbol = [%s]\n", lp->currency_symbol); I realize that several members are initialized to ``empty''; but figured that these would be filled. (??) Next, I try to set the TIME, and with fr_FR: setlocale (LC_TIME, "fr_FR"); puts("...Now using strftime()"); strftime(tbuf, sizeof(tbuf), "%c", localtime(&when)); printf("tbuf = [%s]\n", tbuf); tbuf contains a strictly US English string. PATH_LOCALE is set. ...I'm obviously missing some steps here; don't know what. Anybody?? thanks, gary -- Gary D. Kline kline@tao.thought.org Public service uNix To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message