From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: Before l10n, better practices for (message) ? Date: Tue, 23 May 2017 09:59:01 +0900 (JST) Message-ID: References: <2623E5C5-4D40-4C9F-BFF6-181D2E69F984@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-530030592-1495501144=:24939" X-Trace: blaine.gmane.org 1495501189 19351 195.159.176.226 (23 May 2017 00:59:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 May 2017 00:59:49 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: emacs-devel To: Jean-Christophe Helary Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 23 02:59:41 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 1dCyAm-0004pc-A3 for ged-emacs-devel@m.gmane.org; Tue, 23 May 2017 02:59:40 +0200 Original-Received: from localhost ([::1]:45526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCyAr-0005iL-KR for ged-emacs-devel@m.gmane.org; Mon, 22 May 2017 20:59:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCyAI-0005iG-Rb for emacs-devel@gnu.org; Mon, 22 May 2017 20:59:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCyAE-0002F8-U7 for emacs-devel@gnu.org; Mon, 22 May 2017 20:59:10 -0400 Original-Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]:36250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dCyAE-0002Ey-Mc for emacs-devel@gnu.org; Mon, 22 May 2017 20:59:06 -0400 Original-Received: by mail-pf0-x235.google.com with SMTP id m17so97662090pfg.3 for ; Mon, 22 May 2017 17:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=uS192SgFmKJd+N4/kWSvD3AUs0P1saQQI4ri2zsqtJ0=; b=msrqOvn49RX9sLIHjs1Q3v9f2BBRHxDB1uw+qqPix6Vb/KycDSQT3d1F5yTIwB+rN3 VDsc7MQn/m9LDAozj4vtnfH3wT5cckfDEJ+jhrvcf9mN3uHCaiVLiwIi2sJh1DGh/QZe sPRSxsoj2FeaX/BwxYyjBOmkH1svpwzyqAojs6DwOo4/YS/YxngwvI573kyQUGPmvBM8 LrdQ1uR/59MZZO5hXAsii+mubegQ3FyoUGr7uNzI76d1juQpuJ5xH7LhL2goxPbPm3v1 sbKfLhJW63U6kZC4rgwQwV1yKyGN+AmGfqfrhyVpsXOhuzuosLa8XJJcqBZQ2e53hAi7 rPKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=uS192SgFmKJd+N4/kWSvD3AUs0P1saQQI4ri2zsqtJ0=; b=kvob++RTa1ayYWcNxYEHMcBsbfiambGkIFr/hslYXaOD3C3PcQzUcdX+JkwE87zKYW hqrUwwPTl/pHWFDOVTKBQ2E4iAtPwOKfGcH5vQMwr924t3kGoPPgA406iRKR17ULeFSk 9jmSIAYBVmMWkMdxrhycnT8xGKWCp9rbmJdbR1su+gdI+0Bl8hKFxnLSqotHWvEz46ly c1UKefS4q0FzvjiaAgmv3q1s+kn7ietPkpu2b0Ob48/HDboZrLvY23mu1n65S3gd9itj 4wZtrB5vwEoyAK+TA2uBiXV5n/yVI4gSMZoSd86ciad8rtv+zpRi8B0DPY5DsjQUZwkG MaJA== X-Gm-Message-State: AODbwcCEDr06PLJS6BXIjDjqvM+IPTNpG/NUySFYwRktoOzVJpa2Nu8z hiVf4AJn22Cayg== X-Received: by 10.99.95.79 with SMTP id t76mr28522949pgb.82.1495501145141; Mon, 22 May 2017 17:59:05 -0700 (PDT) Original-Received: from calancha-pc (222.139.137.133.dy.bbexcite.jp. [133.137.139.222]) by smtp.gmail.com with ESMTPSA id x80sm33468393pff.105.2017.05.22.17.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 May 2017 17:59:04 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <2623E5C5-4D40-4C9F-BFF6-181D2E69F984@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::235 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:215113 Archived-At: --8323329-530030592-1495501144=:24939 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 23 May 2017, Jean-Christophe Helary wrote: > I just bumped into an English/code bug this morning. In package.el, when 1 package is not needed anymore, the message is: > > "Package menu: Operation finished. 1 packages are no longer needed, type ‘M-x package-autoremove’ to remove them" > > > The error comes from the following (message) on line 3273 > > (message "Package menu: Operation finished. %d packages %s" > (length removable) > (substitute-command-keys > "are no longer needed, type `\\[package-autoremove]' to remove them")) > > So I'm asking whether do we have "best practices" for using messages... This was discussed in https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00502.html I proposed to add a simple function `string-plural-s' to standarize those plurarizations. Using such `string-plural-s' in your package example: (let* ((options '("foo")) (num (length options))) (message "Package menu: Operation finished. %d %s %s no longer needed, \ type ‘M-x package-autoremove’ to remove %s" num (string-plural-s num "package" "packages") (string-plural-s options "is" "are") (string-plural-s num "it" "them"))) => "Package menu: Operation finished. 1 package is no longer needed, type ‘M-x package-autoremove’ to remove it" (let* ((options '("foo" "bar" "baz")) (num (length options))) (message "Package menu: Operation finished. %d %s %s no longer needed, \ type ‘M-x package-autoremove’ to remove %s" num (string-plural-s num "package" "packages") (string-plural-s num "is" "are") (string-plural-s options "it" "them"))) => "Package menu: Operation finished. 3 packages are no longer needed, type ‘M-x package-autoremove’ to remove them" Then, the thread somehow evolved with more sophisticated multilingual suggestions, which caused my head spin like the girl in 'The exorcist' movie. It would be good to have an standard way to handle these issues. --8323329-530030592-1495501144=:24939--