From: Jean-Christophe Helary <jean.christophe.helary@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: package.el strings
Date: Sun, 17 Jun 2018 23:02:08 +0900 [thread overview]
Message-ID: <CA7C80A9-AC70-4BB8-9BCA-612C6650D760@gmail.com> (raw)
In-Reply-To: <CAM-tV-9BxdOaWp3TrD6688J=O9Mt67q4_BSEyCK=BC4JFjjaZg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
Noam,
There is indeed another change I want to make but that can wait. It involves removing some of the text decorations to be able to straighten some strings.
If there is an agreement to proceed I can do that later. In the meanwhile it would be nice if you could first commit the biggest part of the modifications.
Here would be the log message:
===========================
* lisp/emacs-lisp/package.el: reformat message strings for future l10n
===========================
[-- Attachment #2: package.el_0617.diff --]
[-- Type: application/octet-stream, Size: 10845 bytes --]
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 94d98178c4..9e49b6964e 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -200,8 +200,10 @@ package-load-list
:version "24.1")
(defcustom package-archives `(("gnu" .
- ,(format "http%s://elpa.gnu.org/packages/"
- (if (gnutls-available-p) "s" ""))))
+ ,(let ((https "https://elpa.gnu.org/packages/")
+ (http "http://elpa.gnu.org/packages/"))
+ (if (gnutls-available-p) https http))))
+
"An alist of archives from which to fetch.
The default value points to the GNU Emacs package repository.
@@ -1015,6 +1017,7 @@ package-buffer-info
(let ((file-name (match-string-no-properties 1))
(desc (match-string-no-properties 2))
(start (line-beginning-position)))
+;; The terminating comment could be a generic string that is not in English
(unless (search-forward (concat ";;; " file-name ".el ends here"))
(error "Package lacks a terminating comment"))
;; Try to include a trailing newline.
@@ -1552,7 +1555,7 @@ package--download-one-archive
(let* ((location (cdr archive))
(name (car archive))
(content (buffer-string))
- (dir (expand-file-name (format "archives/%s" name) package-user-dir))
+ (dir (expand-file-name (concat "archives/" name) package-user-dir))
(local-file (expand-file-name file dir)))
(when (listp (read-from-string content))
(make-directory dir t)
@@ -2034,12 +2037,12 @@ package-install-selected-packages
(cond
(available
(when (y-or-n-p
- (format "%s packages will be installed:\n%s, proceed?"
+ (format "Packages to install: %d (%s), proceed? "
(length available)
- (mapconcat #'symbol-name available ", ")))
+ (mapconcat #'symbol-name available " ")))
(mapc (lambda (p) (package-install p 'dont-select)) available)))
((> difference 0)
- (message "%s packages are not available (the rest already installed), maybe you need to `M-x package-refresh-contents'"
+ (message "Packages that are not available: %d (the rest is already installed), maybe you need to `M-x package-refresh-contents'"
difference))
(t
(message "All your packages are already installed"))))))
@@ -2158,9 +2161,9 @@ package-autoremove
(let ((removable (package--removable-packages)))
(if removable
(when (y-or-n-p
- (format "%s packages will be deleted:\n%s, proceed? "
+ (format "Packages to delete: %d (%s), proceed? "
(length removable)
- (mapconcat #'symbol-name removable ", ")))
+ (mapconcat #'symbol-name removable " ")))
(mapc (lambda (p)
(package-delete (cadr (assq p package-alist)) t))
removable))
@@ -2247,12 +2250,9 @@ describe-package-1
(setq status "available obsolete"))
(when incompatible-reason
(setq status "incompatible"))
- (prin1 name)
- (princ " is ")
- (princ (if (memq (aref status 0) '(?a ?e ?i ?o ?u)) "an " "a "))
- (princ status)
- (princ " package.\n\n")
+ (princ (format "Package %S is %s.\n\n" name status))
+ ;; TODO: remove the string decorations and reformat the strings for future l10n
(package--print-help-section "Status")
(cond (built-in
(insert (propertize (capitalize status)
@@ -2634,9 +2634,9 @@ package-menu-toggle-hiding
(user-error "The current buffer is not a Package Menu"))
(setq package-menu--hide-packages
(not package-menu--hide-packages))
- (message "%s packages" (if package-menu--hide-packages
- "Hiding obsolete or unwanted"
- "Displaying all"))
+ (if package-menu--hide-packages
+ (message "Hiding obsolete or unwanted packages")
+ (message "Displaying all packages"))
(revert-buffer nil 'no-confirm))
(defun package--remove-hidden (pkg-list)
@@ -2960,11 +2960,11 @@ package-menu-hide-package
(let ((hidden
(cl-remove-if-not (lambda (e) (string-match re (symbol-name (car e))))
package-archive-contents)))
- (message (substitute-command-keys
- (concat "Hiding %s packages, type `\\[package-menu-toggle-hiding]'"
- " to toggle or `\\[customize-variable] RET package-hidden-regexps'"
- " to customize it"))
- (length hidden)))))
+ (message "Packages to hide: %d. Type `%s' to toggle or `%s' to customize"
+ (length hidden)
+ (substitute-command-keys "\\[package-menu-toggle-hidding]")
+ (substitute-command-keys "\\[customize-variable] RET package-hidden-regexps")))))
+
(defun package-menu-describe-package (&optional button)
"Describe the current package.
@@ -3099,7 +3099,7 @@ package-menu--mark-upgrades-1
(setq package-menu--mark-upgrades-pending nil)
(let ((upgrades (package-menu--find-upgrades)))
(if (null upgrades)
- (message "No packages to upgrade.")
+ (message "No packages to upgrade")
(widen)
(save-excursion
(goto-char (point-min))
@@ -3112,9 +3112,9 @@ package-menu--mark-upgrades-1
(package-menu-mark-install))
(t
(package-menu-mark-delete))))))
- (message "%d package%s marked for upgrading."
- (length upgrades)
- (if (= (length upgrades) 1) "" "s")))))
+ (message "Packages marked for upgrading: %d"
+ (length upgrades)))))
+
(defun package-menu-mark-upgrades ()
"Mark all upgradable packages in the Package Menu.
@@ -3137,17 +3137,12 @@ package-menu--list-to-prompt
PACKAGES is a list of `package-desc' objects.
Formats the returned string to be usable in a minibuffer
prompt (see `package-menu--prompt-transaction-p')."
- (cond
- ;; None
- ((not packages) "")
- ;; More than 1
- ((cdr packages)
- (format "these %d packages (%s)"
- (length packages)
- (mapconcat #'package-desc-full-name packages ", ")))
- ;; Exactly 1
- (t (format-message "package `%s'"
- (package-desc-full-name (car packages))))))
+ ;; The case where `package' is empty is handled in
+ ;; package-menu--prompt-transaction-p below
+ (format "%d (%s)"
+ (length packages)
+ (mapconcat #'package-desc-full-name packages " ")))
+
(defun package-menu--prompt-transaction-p (delete install upgrade)
"Prompt the user about DELETE, INSTALL, and UPGRADE.
@@ -3155,16 +3150,14 @@ package-menu--prompt-transaction-p
Either may be nil, but not all."
(y-or-n-p
(concat
- (when delete "Delete ")
- (package-menu--list-to-prompt delete)
- (when (and delete install)
- (if upgrade "; " "; and "))
- (when install "Install ")
- (package-menu--list-to-prompt install)
- (when (and upgrade (or install delete)) "; and ")
- (when upgrade "Upgrade ")
- (package-menu--list-to-prompt upgrade)
- "? ")))
+ (when delete
+ (format "Packages to delete: %s. " (package-menu--list-to-prompt delete)))
+ (when install
+ (format "Packages to install: %s. " (package-menu--list-to-prompt install)))
+ (when upgrade
+ (format "Packages to upgrade: %s. " (package-menu--list-to-prompt upgrade)))
+ "Proceed? ")))
+
(defun package-menu--partition-transaction (install delete)
"Return an alist describing an INSTALL DELETE transaction.
@@ -3248,25 +3241,24 @@ package-menu-execute
(when (or noquery
(package-menu--prompt-transaction-p .delete .install .upgrade))
(let ((message-template
- (concat "Package menu: Operation %s ["
- (when .delete (format "Delet__ %s" (length .delete)))
- (when (and .delete .install) "; ")
- (when .install (format "Install__ %s" (length .install)))
- (when (and .upgrade (or .install .delete)) "; ")
- (when .upgrade (format "Upgrad__ %s" (length .upgrade)))
+ (concat "[ "
+ (when .delete
+ (format "Delete %d " (length .delete)))
+ (when .install
+ (format "Install %d " (length .install)))
+ (when .upgrade
+ (format "Upgrade %d " (length .upgrade)))
"]")))
- (message (replace-regexp-in-string "__" "ing" message-template) "started")
+ (message "Operation %s started" message-template)
;; Packages being upgraded are not marked as selected.
(package--update-selected-packages .install .delete)
(package-menu--perform-transaction install-list delete-list)
(when package-selected-packages
(if-let* ((removable (package--removable-packages)))
- (message "Package menu: Operation finished. %d packages %s"
- (length removable)
- (substitute-command-keys
- "are no longer needed, type `\\[package-autoremove]' to remove them"))
- (message (replace-regexp-in-string "__" "ed" message-template)
- "finished"))))))))
+ (message "Operation finished. Packages that are no longer needed: %d. Type `%s' to remove them"
+ (length removable)
+ (substitute-command-keys "\\[package-autoremove]"))
+ (message "Operation %s finished" message-template))))))))
(defun package-menu--version-predicate (A B)
(let ((vA (or (aref (cadr A) 1) '(0)))
@@ -3333,11 +3325,11 @@ package-menu--populate-new-package-list
(defun package-menu--find-and-notify-upgrades ()
"Notify the user of upgradable packages."
(when-let* ((upgrades (package-menu--find-upgrades)))
- (message "%d package%s can be upgraded; type `%s' to mark %s for upgrading."
- (length upgrades)
- (if (= (length upgrades) 1) "" "s")
- (substitute-command-keys "\\[package-menu-mark-upgrades]")
- (if (= (length upgrades) 1) "it" "them"))))
+ (message "Packages that can be upgraded: %d; type `%s' to mark for upgrading."
+ (length upgrades)
+ (substitute-command-keys "\\[package-menu-mark-upgrades]"))
+ ))
+
(defun package-menu--post-refresh ()
"If there's a *Packages* buffer, revert it and check for new packages and upgrades.
[-- Attachment #3: Type: text/plain, Size: 554 bytes --]
Jean-Christophe
> On May 30, 2018, at 7:38, Noam Postavsky <npostavs@gmail.com> wrote:
>
> On 28 April 2018 at 19:46, Jean-Christophe Helary
> <jean.christophe.helary@gmail.com> wrote:
>
>> Thank you. I see what you mean and that makes perfect sense. Give me a few
>> days.
>
> Ping? Did you intend to make any other changes? If it's just about
> that one concat vs format thing I can just do it on my end before
> pushing.
Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune
next prev parent reply other threads:[~2018-06-17 14:02 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 5:08 package.el strings Jean-Christophe Helary
2017-05-24 11:00 ` Jean-Christophe Helary
2017-05-24 12:04 ` Dmitry Gutov
2017-05-24 12:07 ` Jean-Christophe Helary
2017-05-24 12:36 ` Yuri Khan
2017-05-24 14:16 ` Richard Stallman
2017-07-14 2:53 ` Jean-Christophe Helary
2017-07-15 12:52 ` Eli Zaretskii
2017-07-15 14:48 ` Jean-Christophe Helary
2017-07-16 13:55 ` Jean-Christophe Helary
2017-07-16 14:16 ` Eli Zaretskii
2017-07-16 14:35 ` Eli Zaretskii
2017-07-16 14:37 ` Jean-Christophe Helary
2017-07-17 15:28 ` Jean-Christophe Helary
2017-07-22 9:23 ` Eli Zaretskii
2018-04-18 6:38 ` Jean-Christophe Helary
2018-04-26 1:10 ` Noam Postavsky
2018-04-26 6:31 ` Jean-Christophe Helary
2018-04-26 11:28 ` Noam Postavsky
2018-04-26 13:32 ` Jean-Christophe Helary
2018-04-28 22:11 ` Noam Postavsky
2018-04-28 23:46 ` Jean-Christophe Helary
2018-05-29 22:38 ` Noam Postavsky
2018-05-29 22:46 ` Jean-Christophe Helary
2018-06-17 14:02 ` Jean-Christophe Helary [this message]
2018-06-17 14:33 ` Eli Zaretskii
2018-06-17 14:45 ` Jean-Christophe Helary
2018-06-17 14:50 ` Eli Zaretskii
2018-06-17 14:58 ` Jean-Christophe Helary
2018-06-20 13:53 ` Jean-Christophe Helary
2018-06-20 15:54 ` Eli Zaretskii
2018-06-20 16:19 ` Jean-Christophe Helary
2018-06-24 15:37 ` Noam Postavsky
2018-06-24 21:57 ` Jean-Christophe Helary
2018-06-24 23:09 ` Noam Postavsky
2018-06-25 1:39 ` Jean-Christophe Helary
2018-06-25 23:22 ` Noam Postavsky
2018-06-27 4:21 ` Jean-Christophe Helary
2018-06-27 18:32 ` Noam Postavsky
2018-04-29 19:43 ` Stefan Monnier
2018-04-26 13:40 ` Jean-Christophe Helary
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=CA7C80A9-AC70-4BB8-9BCA-612C6650D760@gmail.com \
--to=jean.christophe.helary@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=npostavs@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.