diff options
| author | Juri Linkov | 2019-05-05 22:43:27 +0300 |
|---|---|---|
| committer | Juri Linkov | 2019-05-05 22:43:27 +0300 |
| commit | 7bba702e1ad1ed343618e44cf5bbc2a1f079be0c (patch) | |
| tree | e896736b9438abd7b514b76b82a98f25e3aa7281 | |
| parent | c64cb02cca320811032bb300ea6d12cf59acf65d (diff) | |
| download | emacs-7bba702e1ad1ed343618e44cf5bbc2a1f079be0c.tar.gz emacs-7bba702e1ad1ed343618e44cf5bbc2a1f079be0c.zip | |
Use ngettext instead of dired-plural-s in Dired (bug#35287)
* lisp/dired-aux.el (dired-map-over-marks-check): Use ngettext
instead of dired-plural-s.
(dired-create-files): Also add colon after operation name.
(dired-compare-directories): Use ngettext and format-message.
(dired-do-compress-to): Use ngettext.
* lisp/dired.el (dired-internal-do-deletions)
(dired-clean-up-after-deletion): Use ngettext instead of dired-plural-s.
| -rw-r--r-- | lisp/dired-aux.el | 52 | ||||
| -rw-r--r-- | lisp/dired.el | 12 |
2 files changed, 38 insertions, 26 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index b81c0d1a4f5..0cf9e6e2e91 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -246,9 +246,11 @@ Examples of PREDICATE: | |||
| 246 | (lambda () | 246 | (lambda () |
| 247 | (dired-mark-if | 247 | (dired-mark-if |
| 248 | (member (dired-get-filename nil t) file-list2) nil))) | 248 | (member (dired-get-filename nil t) file-list2) nil))) |
| 249 | (message "Marked in dir1: %s files, in dir2: %s files" | 249 | (message "Marked in dir1: %s, in dir2: %s" |
| 250 | (length file-list1) | 250 | (format-message (ngettext "%d file" "%d files" (length file-list1)) |
| 251 | (length file-list2)))) | 251 | (length file-list1)) |
| 252 | (format-message (ngettext "%d file" "%d files" (length file-list2)) | ||
| 253 | (length file-list2))))) | ||
| 252 | 254 | ||
| 253 | (defun dired-file-set-difference (list1 list2 predicate) | 255 | (defun dired-file-set-difference (list1 list2 predicate) |
| 254 | "Combine LIST1 and LIST2 using a set-difference operation. | 256 | "Combine LIST1 and LIST2 using a set-difference operation. |
| @@ -1065,7 +1067,9 @@ and `dired-compress-files-alist'." | |||
| 1065 | (shell-quote-argument (file-name-nondirectory | 1067 | (shell-quote-argument (file-name-nondirectory |
| 1066 | file-desc))) | 1068 | file-desc))) |
| 1067 | in-files " ")))))) | 1069 | in-files " ")))))) |
| 1068 | (message "Compressed %d file(s) to %s" | 1070 | (message (ngettext "Compressed %d file to %s" |
| 1071 | "Compressed %d files to %s" | ||
| 1072 | (length in-files)) | ||
| 1069 | (length in-files) | 1073 | (length in-files) |
| 1070 | (file-name-nondirectory out-file))))))) | 1074 | (file-name-nondirectory out-file))))))) |
| 1071 | 1075 | ||
| @@ -1193,12 +1197,14 @@ Return nil if no change in files." | |||
| 1193 | (string (if (eq op-symbol 'compress) "Compress or uncompress" | 1197 | (string (if (eq op-symbol 'compress) "Compress or uncompress" |
| 1194 | (capitalize (symbol-name op-symbol))))) | 1198 | (capitalize (symbol-name op-symbol))))) |
| 1195 | (if (not failures) | 1199 | (if (not failures) |
| 1196 | (message "%s: %d file%s." | 1200 | (message (ngettext "%s: %d file." "%s: %d files." total) |
| 1197 | string total (dired-plural-s total)) | 1201 | string total) |
| 1198 | ;; end this bunch of errors: | 1202 | ;; end this bunch of errors: |
| 1199 | (dired-log-summary | 1203 | (dired-log-summary |
| 1200 | (format "Failed to %s %d of %d file%s" | 1204 | (format (ngettext "Failed to %s %d of %d file" |
| 1201 | (downcase string) count total (dired-plural-s total)) | 1205 | "Failed to %s %d of %d files" |
| 1206 | total) | ||
| 1207 | (downcase string) count total) | ||
| 1202 | failures))))) | 1208 | failures))))) |
| 1203 | 1209 | ||
| 1204 | ;;;###autoload | 1210 | ;;;###autoload |
| @@ -1798,32 +1804,36 @@ ESC or `q' to not overwrite any of the remaining files, | |||
| 1798 | (progn | 1804 | (progn |
| 1799 | (push (dired-make-relative from) | 1805 | (push (dired-make-relative from) |
| 1800 | failures) | 1806 | failures) |
| 1801 | (dired-log "%s `%s' to `%s' failed:\n%s\n" | 1807 | (dired-log "%s: `%s' to `%s' failed:\n%s\n" |
| 1802 | operation from to err)))))))) | 1808 | operation from to err)))))))) |
| 1803 | (cond | 1809 | (cond |
| 1804 | (dired-create-files-failures | 1810 | (dired-create-files-failures |
| 1805 | (setq failures (nconc failures dired-create-files-failures)) | 1811 | (setq failures (nconc failures dired-create-files-failures)) |
| 1806 | (dired-log-summary | 1812 | (dired-log-summary |
| 1807 | (format "%s failed for %d file%s in %d requests" | 1813 | (format (ngettext "%s failed for %d file in %d requests" |
| 1808 | operation (length failures) | 1814 | "%s failed for %d files in %d requests" |
| 1809 | (dired-plural-s (length failures)) | 1815 | (length failures)) |
| 1810 | total) | 1816 | operation (length failures) total) |
| 1811 | failures)) | 1817 | failures)) |
| 1812 | (failures | 1818 | (failures |
| 1813 | (dired-log-summary | 1819 | (dired-log-summary |
| 1814 | (format "%s failed for %d of %d file%s" | 1820 | (format (ngettext "%s: %d of %d file failed" |
| 1815 | operation (length failures) | 1821 | "%s: %d of %d files failed" |
| 1816 | total (dired-plural-s total)) | 1822 | total) |
| 1823 | operation (length failures) total) | ||
| 1817 | failures)) | 1824 | failures)) |
| 1818 | (skipped | 1825 | (skipped |
| 1819 | (dired-log-summary | 1826 | (dired-log-summary |
| 1820 | (format "%s: %d of %d file%s skipped" | 1827 | (format (ngettext "%s: %d of %d file skipped" |
| 1821 | operation (length skipped) total | 1828 | "%s: %d of %d files skipped" |
| 1822 | (dired-plural-s total)) | 1829 | total) |
| 1830 | operation (length skipped) total) | ||
| 1823 | skipped)) | 1831 | skipped)) |
| 1824 | (t | 1832 | (t |
| 1825 | (message "%s: %s file%s" | 1833 | (message (ngettext "%s: %d file done" |
| 1826 | operation success-count (dired-plural-s success-count))))) | 1834 | "%s: %d files done" |
| 1835 | success-count) | ||
| 1836 | operation success-count)))) | ||
| 1827 | (dired-move-to-filename)) | 1837 | (dired-move-to-filename)) |
| 1828 | 1838 | ||
| 1829 | (defun dired-do-create-files (op-symbol file-creator operation arg | 1839 | (defun dired-do-create-files (op-symbol file-creator operation arg |
diff --git a/lisp/dired.el b/lisp/dired.el index 63082fe3927..385126514b3 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3212,9 +3212,10 @@ non-empty directories is allowed." | |||
| 3212 | (if (not failures) | 3212 | (if (not failures) |
| 3213 | (progress-reporter-done progress-reporter) | 3213 | (progress-reporter-done progress-reporter) |
| 3214 | (dired-log-summary | 3214 | (dired-log-summary |
| 3215 | (format "%d of %d deletion%s failed" | 3215 | (format (ngettext "%d of %d deletion failed" |
| 3216 | (length failures) count | 3216 | "%d of %d deletions failed" |
| 3217 | (dired-plural-s count)) | 3217 | count) |
| 3218 | (length failures) count) | ||
| 3218 | failures))))) | 3219 | failures))))) |
| 3219 | (message "(No deletions performed)"))) | 3220 | (message "(No deletions performed)"))) |
| 3220 | (dired-move-to-filename)) | 3221 | (dired-move-to-filename)) |
| @@ -3267,8 +3268,9 @@ confirmation. To disable the confirmation, see | |||
| 3267 | (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))) | 3268 | (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))) |
| 3268 | (and buf-list | 3269 | (and buf-list |
| 3269 | (and dired-clean-confirm-killing-deleted-buffers | 3270 | (and dired-clean-confirm-killing-deleted-buffers |
| 3270 | (y-or-n-p (format "Kill Dired buffer%s of %s, too? " | 3271 | (y-or-n-p (format (ngettext "Kill Dired buffer of %s, too? " |
| 3271 | (dired-plural-s (length buf-list)) | 3272 | "Kill Dired buffers of %s, too? " |
| 3273 | (length buf-list)) | ||
| 3272 | (file-name-nondirectory fn)))) | 3274 | (file-name-nondirectory fn)))) |
| 3273 | (dolist (buf buf-list) | 3275 | (dolist (buf buf-list) |
| 3274 | (kill-buffer buf)))))) | 3276 | (kill-buffer buf)))))) |