From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 2FC368011C for ; Sat, 8 Apr 2017 18:38:05 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=xavier.leroy@gmail.com; spf=Pass smtp.mailfrom=xavier.leroy@gmail.com; spf=None smtp.helo=postmaster@mail-wr0-f180.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of xavier.leroy@gmail.com) identity=pra; client-ip=209.85.128.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="xavier.leroy@gmail.com"; x-sender="xavier.leroy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of xavier.leroy@gmail.com designates 209.85.128.180 as permitted sender) identity=mailfrom; client-ip=209.85.128.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="xavier.leroy@gmail.com"; x-sender="xavier.leroy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wr0-f180.google.com) identity=helo; client-ip=209.85.128.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="xavier.leroy@gmail.com"; x-sender="postmaster@mail-wr0-f180.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ArQfbchPDWxdbgXf7WzUl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0IvzzrarrMEGX3/hxlliBBdydsKMYzbKO+4nbGkU4qa6bt34DdJEeHzQksu?= =?us-ascii?q?4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1?= =?us-ascii?q?Ov71GonPhMiryuy+4ZPebgFHiT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YVi97ZnCoXq?= =?us-ascii?q?t66CttW9HuNpvKWo342O/J5yy8BJADOzhL?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DYBgCKEelYhrSAVdFcGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBg3kQA3YSg2abNx+YFIV2g2BDFAEBAQEBAQE?= =?us-ascii?q?BAQEBEgEBAQgLCwgoL4IzCgyCTQEEASMdARInAwELAQUFGgImAgI0AQUBHBMIA?= =?us-ascii?q?QGJcwMNCAQKnVQ/jASCJoMJBYNxJw2DVwIBBQkBCHmFRYIFCYIyMIF+eIF5M4I?= =?us-ascii?q?6gl8FnHtrhhWLWYpUEIZdkjgzgRU2gSYlFiRSgwKBSoIQc4ktAQEB?= X-IPAS-Result: =?us-ascii?q?A0DYBgCKEelYhrSAVdFcGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBg3kQA3YSg2abNx+YFIV2g2BDFAEBAQEBAQEBAQEBEgEBAQgLC?= =?us-ascii?q?wgoL4IzCgyCTQEEASMdARInAwELAQUFGgImAgI0AQUBHBMIAQGJcwMNCAQKnVQ?= =?us-ascii?q?/jASCJoMJBYNxJw2DVwIBBQkBCHmFRYIFCYIyMIF+eIF5M4I6gl8FnHtrhhWLW?= =?us-ascii?q?YpUEIZdkjgzgRU2gSYlFiRSgwKBSoIQc4ktAQEB?= X-IronPort-AV: E=Sophos;i="5.37,173,1488841200"; d="scan'208";a="268315940" Received: from mail-wr0-f180.google.com ([209.85.128.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 08 Apr 2017 18:38:04 +0200 Received: by mail-wr0-f180.google.com with SMTP id t20so125621680wra.1 for ; Sat, 08 Apr 2017 09:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=bfxv527siZCIIMdoTfJ7nyiSZbZ4C9WGyLzTxV8YBzY=; b=lNSKb3ocK6XEHwjPmU54Quhgx2AgLmBlIO3eHtEJRO16hf0M5dozdQD/yE9fYmCBkw CrFc5WYMGA9VbniZ3NFXdTlQIsx1Q7W2F8Wz64htBVZxM57pYjOD+5hn7UibGfIhEdik lcj9cMthlQ2H1PvLvjeqPRIjMfRSR3aVsGQKnt29/RFKG1L7J4TzuilhwIJ6n1s1d0l0 a5wrc7mPk1Uy2oXwUGrC6VwRrgimjgG5O+tz5piLldeD8JXcA8smuX4CrXY6O6tTJAlL Uc9vr6q4S97+2KheAlA2b7dld4y9+/YAATakK/rQXxVke72gtpFRU/7Thle/1JjQYm7n YrjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=bfxv527siZCIIMdoTfJ7nyiSZbZ4C9WGyLzTxV8YBzY=; b=IgNhQmKvTgQUEAf350J6VDOFPey9sQjWczN5H2GLbrn0OoBailN8SKRfO4x7l4cbcw JAcQJdlMbkO2qvnMxRmE5N3qvbO4YSiQmTsUWEAQ0nPT++h0xzXgymaM7Mn0dSVhQwah M0wRKmJtL/oIGPkSP50/Crw7VrKwpxAZOTKbZTqgvYhHhfzXixzf7m9ZE9H3Vp0yfGFH aYiBlAkMPDav4ZiQImPtEggB1xlUVisTUOeId84pmkHzN6SASuRiXm/+axH4TLOYyfTu xK8meYlMeI/bx6TsnYuhT/jq9Qvd8Qb2B6SGAQk/fvJJoe6NerQSz2Rcw32IJAVmJref wRrw== X-Gm-Message-State: AFeK/H2nEbQ+0mcMSRBy3tTLXVUPqfxTl865aW8tCKCvlHscfLzQhmzNc+/CK/BeVyxH8w== X-Received: by 10.223.131.3 with SMTP id 3mr40970703wrd.31.1491669484103; Sat, 08 Apr 2017 09:38:04 -0700 (PDT) Received: from [192.168.1.2] (che78-2-82-237-71-191.fbx.proxad.net. [82.237.71.191]) by smtp.gmail.com with ESMTPSA id y190sm3282388wmy.15.2017.04.08.09.38.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 09:38:03 -0700 (PDT) Sender: Xavier Leroy To: caml-list@inria.fr References: From: Xavier Leroy Message-ID: <1715c9d9-04d7-3368-bfbd-3af8aae4698b@inria.fr> Date: Sat, 8 Apr 2017 18:38:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] error messages in multiple languages ? On 04/08/2017 04:22 PM, Tao Stein wrote: > I've been teaching OCaml to university students in Beijing. I believe they'd > feel more comfortable if the error messages were in Chinese. Has anyone > thought of implementing multi-language strings in the compiler? So, say with > the setting of an environment variable, the compiler user could receive > errors and warnings in their preferred language. Caml Light, the ancestor of OCaml, was internationalized in this manner. It had messages in English, French, German, Spanish and Italian. Curious or nostalgic minds can have a look at the text file containing the translations: https://github.com/camllight/camllight/blob/master/sources/src/camlmsgs.txt and at the i18n engine itself, which was just a wrapper around "printf" that used the english format message as an index into the translations: https://github.com/camllight/camllight/blob/master/sources/src/compiler/interntl.ml This implementation was pretty short and sweet, if I may say so myself, and possibly easier to use than gettext because by construction the english message was always available, even if translations were missing by mistake. Yet it was a lot of work, and quite painful, to keep the message file and the translations up to date. Keep in mind that Caml Light had perhaps 1/10th as many messages as OCaml does. So, the chances of getting i18n to work for OCaml look thin. One advantage for me, though, is that it would make it harder to add new warnings :-) Your Caml historian, - Xavier Leroy