all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Jean-Christophe Helary <jean.christophe.helary@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Before l10n, better practices for (message) ?
Date: Tue, 23 May 2017 09:59:01 +0900 (JST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1705230958420.24939@calancha-pc> (raw)
In-Reply-To: <2623E5C5-4D40-4C9F-BFF6-181D2E69F984@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]



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.

  reply	other threads:[~2017-05-23  0:59 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 23:30 Before l10n, better practices for (message) ? Jean-Christophe Helary
2017-05-23  0:59 ` Tino Calancha [this message]
2017-05-23  1:18   ` Jean-Christophe Helary
2017-05-23  2:55     ` Eli Zaretskii
2017-05-23  3:38       ` Jean-Christophe Helary
2017-05-23 18:36         ` Eli Zaretskii
2017-05-23 22:00           ` Jean-Christophe Helary
2017-05-24  2:32             ` Eli Zaretskii
2017-05-24  2:40               ` Jean-Christophe Helary
2017-05-24  4:22                 ` Paul Eggert
2017-05-24  8:08                   ` Jean-Christophe Helary
2017-05-24 19:12                     ` Eli Zaretskii
2017-05-24 21:29                       ` Jean-Christophe Helary
2017-05-26  3:50                         ` Richard Stallman
2017-05-24 22:09                       ` Paul Eggert
2017-05-24 22:35                         ` Jean-Christophe Helary
2017-05-26  8:07                           ` Eli Zaretskii
2017-05-24 23:51                         ` Jean-Christophe Helary
2017-05-23  7:52       ` Jean-Christophe Helary
2017-05-23 18:42         ` Eli Zaretskii
2017-05-23 22:03           ` Jean-Christophe Helary
2017-05-26  8:14             ` Eli Zaretskii
2017-05-26 14:21               ` Jean-Christophe Helary
2017-05-26 14:44                 ` Eli Zaretskii
2017-05-26 18:08                   ` Yuri Khan
2017-05-26 19:00                     ` Eli Zaretskii
2017-05-27  1:52                       ` Jean-Christophe Helary
2017-05-26 18:54               ` Etienne Prud’homme
2017-05-26 19:06                 ` Eli Zaretskii
2017-05-26 19:15                   ` Etienne Prud’homme
2017-05-26 19:27                     ` Eli Zaretskii
2017-05-26 21:57                       ` Etienne Prud’homme
2017-05-27  7:22                         ` Eli Zaretskii
2017-05-27  1:16                 ` Jean-Christophe Helary
2017-05-27  7:43                   ` Eli Zaretskii
2017-05-27  4:08       ` Marcin Borkowski
2017-05-27  7:49         ` Eli Zaretskii
2017-05-28  4:00           ` Marcin Borkowski
2017-05-27 23:27         ` Göktuğ Kayaalp
2017-05-28  0:44           ` Jean-Christophe Helary
2017-05-28 14:44             ` Göktuğ Kayaalp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1705230958420.24939@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=jean.christophe.helary@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.