From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA30435 for caml-redistribution; Thu, 14 Oct 1999 14:55:55 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA00852 for ; Wed, 13 Oct 1999 14:11:35 +0200 (MET DST) Received: from nenuphar.saclay.cea.fr (nenuphar.saclay.cea.fr [132.166.192.7]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA22333 for ; Wed, 13 Oct 1999 14:11:34 +0200 (MET DST) Received: from muguet.saclay.cea.fr (muguet.saclay.cea.fr [132.166.192.6]) by nenuphar.saclay.cea.fr (8.9.1a/8.9.1/CEAnet-relay-5.0.D20) with ESMTP id OAA04882 for ; Wed, 13 Oct 1999 14:11:34 +0200 (MET DST) Received: from harpie.saclay.cea.fr (harpie.saclay.cea.fr [132.166.133.152]) by muguet.saclay.cea.fr (8.9.1a/8.9.1/CEAnet-relay-5.1.D20) with ESMTP id OAA14565; Wed, 13 Oct 1999 14:11:28 +0200 (MET DST) Received: by harpie.saclay.cea.fr (8.8.8+Sun/CEANET.2.0.1) id OAA26728; Wed, 13 Oct 1999 14:12:43 +0200 (MET DST) From: STARYNKEVITCH Basile MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Message-ID: <14340.30523.12139.286075@gargle.gargle.HOWL> Date: Wed, 13 Oct 1999 14:12:43 +0200 (MET DST) To: caml-list@inria.fr Subject: localization, internationalization and Caml X-Mailer: VM 6.75 under Emacs 20.4.1 Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit Sender: weis Hello All, Just a small remark about localization and internationalization (see your setlocale printf strtod man pages), which means adapting a software to culturally different users. Problems include date representation, number representation, error messages, and even character sets and left-right or right-left human reading. For example some french people want "Taux d'inflation = 3,14% - TROP" instead of "TOO MUCH inflation 3.14%" (message in english/french, numbers with decimal point/comma, argument 3.14 and string "TOO MUCH" or "TROP" (locale dependent) in different order. I am not at all a fan of localization. But I do have a wish if it ever occur in Ocaml: * do not depend on C localization (This means Printf.printf should not depend on LC_NUMERIC environment variable. Is this true now?) * make the locale an explicit argument, or at least a property bound to a channel. Several channels may need different locales (for instance an HTTP socket needs a C locale, while the user stderr could be in French locale) so lprintf Locale.French "%d %g" 2 3.14 is much better than set_locale LC_ALL "FR" printf "%d %g" 2 3.14 By the way, I more and more believe that the printf interface is (in C as in Ocaml) a big mistake (which could easily be avoided in Ocaml, thanks to it typing) We should code print [Int 2; String " < "; Float 3.14] instead of printf "%d < %g" 2 3.14 Again, I am *not* asking for localization in Ocaml, but if somebody needs it (I don't) I still hope it would be implemented better than in C. And I think that Unicode would be more useful than localization. I'm saying all this because I have now a headache regarding C localization, so hope that Ocaml will avoid that mistake. ################ Court Resumé: je pense que la localisation en Ocaml -dont je ne ressens pas le besoin- ne devrait pas être faite comme en C. N.B. Any opinions expressed here are only mine, and not of my organization. N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA. --------------------------------------------------------------------- Basile STARYNKEVITCH ---- Commissariat à l Energie Atomique DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France phone: 1,69.08.60.55; fax: 1.69.08.83.95 home: 1,46.65.45.53 email: Basile point Starynkevitch at cea point fr