From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Before l10n, better practices for (message) ? Date: Sat, 27 May 2017 10:22:35 +0300 Message-ID: <83shjqix1g.fsf@gnu.org> References: <2623E5C5-4D40-4C9F-BFF6-181D2E69F984@gmail.com> <831srgnuyc.fsf@gnu.org> <83vaormn2x.fsf@gnu.org> <1B4DE39C-E293-4370-9E76-82E1B7385C00@gmail.com> <83o9ugjaqd.fsf@gnu.org> <8737br8n4o.fsf@x230.lts> <83y3tjigk7.fsf@gnu.org> <87vaon77lo.fsf@x230.lts> <83wp93ifkz.fsf@gnu.org> <87o9uf703x.fsf@x230.lts> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1495869768 29728 195.159.176.226 (27 May 2017 07:22:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 May 2017 07:22:48 +0000 (UTC) Cc: jean.christophe.helary@gmail.com, emacs-devel@gnu.org To: Etienne =?utf-8?Q?Prud=E2=80=99homme?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 27 09:22:44 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEW3d-0007as-DJ for ged-emacs-devel@m.gmane.org; Sat, 27 May 2017 09:22:41 +0200 Original-Received: from localhost ([::1]:39698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEW3i-0005DC-Qj for ged-emacs-devel@m.gmane.org; Sat, 27 May 2017 03:22:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEW3c-0005CR-K4 for emacs-devel@gnu.org; Sat, 27 May 2017 03:22:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEW3X-0008Nt-LV for emacs-devel@gnu.org; Sat, 27 May 2017 03:22:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEW3X-0008Np-Hl; Sat, 27 May 2017 03:22:35 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2031 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dEW3W-00062p-Oh; Sat, 27 May 2017 03:22:35 -0400 In-reply-to: <87o9uf703x.fsf@x230.lts> (message from Etienne =?utf-8?Q?Pru?= =?utf-8?Q?d=E2=80=99homme?= on Fri, 26 May 2017 17:57:06 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215254 Archived-At: > From: Etienne Prud’homme > Cc: jean.christophe.helary@gmail.com, emacs-devel@gnu.org > Date: Fri, 26 May 2017 17:57:06 -0400 > > Eli Zaretskii writes: > > > Why not do this for every string that 'message' needs to display? > > I’m not sure to understand what you refer to every string? I mean that 'message' should try to look up in the translation registry every string it gets as its first argument, regardless of whether it has text properties or not. > > (let ((str "Hello %s World!") > > (arg "you")) > > (put-text-property 0 (length str) 'l10n 'hello-world str) > > (message str arg)) > > Where message would try to fetch the ‘hello-world’ entry from the > translations registry if the configured language is not English. I'm asking why do we need to put the text properties at all. Text properties on strings are a nuisance for long-living strings, as some APIs remove them.