Bug 526831: downloads done yesterday have a date of 'Yesterday' regardless of locale, r=mfinkle
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 05 Nov 2009 16:58:43 -0500
changeset 65761 d69de160bd77270378ab1ed27c79d4e82a57be6e
parent 65760 efbc26f7c2d906cade9d24347e8743a30d57fa63
child 65762 e1515b733a83a7f603d9708d75e2cdfaee1ac5d9
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs526831
Bug 526831: downloads done yesterday have a date of 'Yesterday' regardless of locale, r=mfinkle
mobile/chrome/content/downloads.js
--- a/mobile/chrome/content/downloads.js
+++ b/mobile/chrome/content/downloads.js
@@ -304,37 +304,38 @@ var DownloadsView = {
 
     // Figure out when today begins
     let now = new Date();
     let today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
 
     // Get the end time to display
     let end = new Date(parseInt(aItem.getAttribute("endTime")));
 
+    let strings = document.getElementById("bundle_browser");
+
     // Figure out if the end time is from today, yesterday, this week, etc.
     let dateTime;
     if (end >= today) {
       // Download finished after today started, show the time
       dateTime = dts.FormatTime("", dts.timeFormatNoSeconds, end.getHours(), end.getMinutes(), 0);
     }
     else if (today - end < (24 * 60 * 60 * 1000)) {
       // Download finished after yesterday started, show yesterday
-      dateTime = "Yesterday";//gStr.yesterday;
+      dateTime = strings.getString("donwloadsYesterday");
     }
     else if (today - end < (6 * 24 * 60 * 60 * 1000)) {
       // Download finished after last week started, show day of week
       dateTime = end.toLocaleFormat("%A");
     }
     else {
       // Download must have been from some time ago.. show month/day
       let month = end.toLocaleFormat("%B");
       // Remove leading 0 by converting the date string to a number
       let date = Number(end.toLocaleFormat("%d"));
-      //dateTime = this._replaceInsert(gStr.monthDate, 1, month);
-      dateTime = this._replaceInsert("#1 #2", 1, month);
+      dateTime = this._replaceInsert(strings.getString("downloadsMonthDate"), 1, month);
       dateTime = this._replaceInsert(dateTime, 2, date);
     }
 
     aItem.setAttribute("datetime", dateTime);
   },
 
   _replaceInsert: function dv__replaceInsert(aText, aIndex, aValue) {
     return aText.replace("#" + aIndex, aValue);