]> git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/commitdiff
fix notification message when deleting old history v1.5.2
authorMike Frysinger <vapier@gentoo.org>
Tue, 21 Jan 2014 05:52:40 +0000 (00:52 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 21 Jan 2014 05:54:19 +0000 (00:54 -0500)
_locales/en/messages.json
javascript/clearhistory.js

index 7ea4116e1a47a1dc23258e861e1a21a83c540a5b..13074bfa82fd44f3c95557a5e9328134a0983f76 100644 (file)
   "optionsAutoclear": {"message": "Automatically purge old entries"},
   "confirmPrompt": {"message": "Are you sure you want to delete the history?"},
   "notificationTitle": {"message": "History deleted successfully!"},
-  "notificationTime": {
+  "notificationTimeNewer": {
     "message": "for the last $num$ $units$",
     "placeholders": {
       "num": {"content": "$1"},
       "units": {"content": "$2"}
     }
   },
+  "notificationTimeOlder": {
+    "message": "older than $num$ $units$",
+    "placeholders": {
+      "num": {"content": "$1"},
+      "units": {"content": "$2"}
+    }
+  },
   "notificationTimeAll": {"message": "from the beginning of time"},
   "notificationBody": {
     "message": "History deleted $when$.",
index f614fff5e9844130d6ba4d74e0f3c9323f3dc4c6..28eb2b060676ec161b554e177389f5316b24885a 100644 (file)
@@ -67,10 +67,10 @@ function clearDownloads(s) {
 function didClearHistory(s) {
   var time = ~~(s.time) || CONSTANTS.DEFAULT_TIME;
   time = getUnitsForTime(time);
-  var timeString = (time.time === -1) ?
-                   chrome.i18n.getMessage('notificationTimeAll') :
-                   chrome.i18n.getMessage('notificationTime',
-                                          [time.time, time.units]);
+  var timeMsg = (time.time === -1) ? 'notificationTimeAll' :
+                (s.timeStart === CONSTANTS.YES) ? 'notificationTimeNewer' :
+                'notificationTimeOlder';
+  var timeString = chrome.i18n.getMessage(timeMsg, [time.time, time.units]);
   var message = chrome.i18n.getMessage('notificationBody', timeString);
   var notification = webkitNotifications.createNotification(
       chrome.extension.getURL('/images/icon48.png'),