[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Before l10n, better practices for (message) ?
From: |
Tino Calancha |
Subject: |
Re: Before l10n, better practices for (message) ? |
Date: |
Tue, 23 May 2017 09:59:01 +0900 (JST) |
User-agent: |
Alpine 2.20 (DEB 67 2015-01-07) |
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.
- Before l10n, better practices for (message) ?, Jean-Christophe Helary, 2017/05/22
- Re: Before l10n, better practices for (message) ?,
Tino Calancha <=
- Re: Before l10n, better practices for (message) ?, Jean-Christophe Helary, 2017/05/22
- Re: Before l10n, better practices for (message) ?, Eli Zaretskii, 2017/05/22
- Re: Before l10n, better practices for (message) ?, Jean-Christophe Helary, 2017/05/22
- Re: Before l10n, better practices for (message) ?, Eli Zaretskii, 2017/05/23
- Re: Before l10n, better practices for (message) ?, Jean-Christophe Helary, 2017/05/23
- Re: Before l10n, better practices for (message) ?, Eli Zaretskii, 2017/05/23
- Re: Before l10n, better practices for (message) ?, Jean-Christophe Helary, 2017/05/23
- Re: Before l10n, better practices for (message) ?, Paul Eggert, 2017/05/24
- Re: Before l10n, better practices for (message) ?, Jean-Christophe Helary, 2017/05/24
- Re: Before l10n, better practices for (message) ?, Eli Zaretskii, 2017/05/24