emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cf1d703: Fix messages with plural forms in todo-mode.el


From: Eli Zaretskii
Subject: master cf1d703: Fix messages with plural forms in todo-mode.el
Date: Sat, 26 Dec 2020 03:24:47 -0500 (EST)

branch: master
commit cf1d7034445e7896c34f88256e5d7f2674a4f7ee
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix messages with plural forms in todo-mode.el
    
    * lisp/calendar/todo-mode.el (todo-move-item, todo-item-undone)
    (todo-category-completions): Use 'ngettext' instead of hard-coding
    plural forms by hand.
---
 lisp/calendar/todo-mode.el | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 3975a9b..637df85 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2745,9 +2745,10 @@ section in the category moved to."
                (setq ov (make-overlay (save-excursion (todo-item-start))
                                       (save-excursion (todo-item-end))))
                (overlay-put ov 'face 'todo-search))
-             (let* ((pl (if (and marked (> (cdr marked) 1)) "s" ""))
-                    (cat+file (todo-read-category (concat "Move item" pl
-                                                           " to category: ")
+             (let* ((num (if (not marked) 1 (cdr marked)))
+                    (cat+file (todo-read-category
+                                (ngettext "Move item to category: "
+                                          "Move items to category: " num)
                                                    nil file)))
                (while (and (equal (car cat+file) cat1)
                            (equal (cdr cat+file) file1))
@@ -2974,7 +2975,7 @@ comments without asking."
   (interactive)
   (let* ((cat (todo-current-category))
         (marked (assoc cat todo-categories-with-marks))
-        (pl (if (and marked (> (cdr marked) 1)) "s" "")))
+        (num (if (not marked) 1 (cdr marked))))
     (when (or marked (todo-done-item-p))
       (let ((buffer-read-only)
            (opoint (point))
@@ -2982,6 +2983,9 @@ comments without asking."
            (first 'first)
            (item-count 0)
            (diary-count 0)
+            (omit-prompt (ngettext "Omit comment from restored item? "
+                                   "Omit comments from restored items? "
+                           num))
            start end item ov npoint undone)
        (and marked (goto-char (point-min)))
        (catch 'done
@@ -3013,10 +3017,7 @@ comments without asking."
                      (if (eq first 'first)
                          (setq first
                                (if (eq todo-undo-item-omit-comment 'ask)
-                                   (when (todo-y-or-n-p
-                                          (concat "Omit comment" pl
-                                                  " from restored item"
-                                                  pl "? "))
+                                   (when (todo-y-or-n-p omit-prompt)
                                      'omit)
                                  (when todo-undo-item-omit-comment 'omit)))
                        t)
@@ -5782,11 +5783,13 @@ have been removed."
              (delete f todo-category-completions-files))
        (push f deleted)))
     (when deleted
-      (let ((pl (> (length deleted) 1))
+      (let ((ndeleted (length deleted))
            (names (mapconcat (lambda (f) (concat "\"" f "\"")) deleted ", ")))
-       (message (concat "File" (if pl "s" "") " %s ha" (if pl "ve" "s")
-                        " been deleted and removed from\n"
-                        "the list of category completion files")
+       (message (concat
+                  (ngettext "File %s has been deleted and removed from\n"
+                            "Files %s have been deleted and removed from\n"
+                            ndeleted)
+                 "the list of category completion files")
                 names))
       (put 'todo-category-completions-files 'custom-type
            `(set ,@(todo--files-type-list)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]