2011-01-13 Mikhail Naganov <mnaganov@chromium.org>
authormnaganov@chromium.org <mnaganov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 15:49:37 +0000 (15:49 +0000)
committermnaganov@chromium.org <mnaganov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 15:49:37 +0000 (15:49 +0000)
        Reviewed by Timothy Hatcher.

        Web Inspector: Cleanup after r75613 -- make all UI-facing strings
        to be passed directly to WebInspector.UIString

        https://bugs.webkit.org/show_bug.cgi?id=52365

        * English.lproj/localizedStrings.js:
        * inspector/front-end/ApplicationCacheItemsView.js:
        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
        (WebInspector.ApplicationCacheItemsView.prototype._populateDataGrid):
        * inspector/front-end/AuditRules.js:
        (WebInspector.AuditRules.GzipRule.prototype.doRun):
        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
        (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies):
        * inspector/front-end/BreakpointsSidebarPane.js:
        (WebInspector.EventListenerBreakpointsSidebarPane):
        (WebInspector.EventListenerBreakpointsSidebarPane.prototype._createCategory):
        * inspector/front-end/CookieItemsView.js:
        (WebInspector.CookieItemsView.prototype._updateWithCookies):
        * inspector/front-end/ImageView.js:
        (WebInspector.ImageView.prototype._createContentIfNeeded.onImageLoad):
        (WebInspector.ImageView.prototype._createContentIfNeeded):
        * inspector/front-end/NetworkPanel.js:
        (WebInspector.NetworkTimeCalculator.prototype.formatValue):
        (WebInspector.NetworkTransferTimeCalculator.prototype.formatValue):
        (WebInspector.NetworkTransferDurationCalculator.prototype.formatValue):
        * inspector/front-end/ProfileDataGridTree.js:
        (WebInspector.ProfileDataGridNode.prototype.get data.formatMilliseconds):
        (WebInspector.ProfileDataGridNode.prototype.get data):
        * inspector/front-end/Resource.js:
        (WebInspector.Resource.Type.toUIString):
        (WebInspector.Resource.Type.toString):
        * inspector/front-end/TimelineOverviewPane.js:
        (WebInspector.TimelineOverviewCalculator.prototype.formatValue):
        * inspector/front-end/TimelinePanel.js:
        (WebInspector.TimelinePanel):
        (WebInspector.TimelineCalculator.prototype.formatValue):
        (WebInspector.TimelinePanel.FormattedRecord.prototype._generateAggregatedInfo):
        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
        * inspector/front-end/utilities.js:
        ():
        * Scripts/check-inspector-strings:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75714 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js
Source/WebCore/inspector/front-end/AuditRules.js
Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
Source/WebCore/inspector/front-end/CookieItemsView.js
Source/WebCore/inspector/front-end/ImageView.js
Source/WebCore/inspector/front-end/NetworkPanel.js
Source/WebCore/inspector/front-end/ProfileDataGridTree.js
Source/WebCore/inspector/front-end/Resource.js
Source/WebCore/inspector/front-end/TimelineOverviewPane.js
Source/WebCore/inspector/front-end/TimelinePanel.js
Source/WebCore/inspector/front-end/utilities.js
Tools/ChangeLog
Tools/Scripts/check-inspector-strings

index f52b214..98f5979 100644 (file)
@@ -1,3 +1,49 @@
+2011-01-13  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Cleanup after r75613 -- make all UI-facing strings
+        to be passed directly to WebInspector.UIString
+
+        https://bugs.webkit.org/show_bug.cgi?id=52365
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/ApplicationCacheItemsView.js:
+        (WebInspector.ApplicationCacheItemsView.prototype._updateCallback):
+        (WebInspector.ApplicationCacheItemsView.prototype._populateDataGrid):
+        * inspector/front-end/AuditRules.js:
+        (WebInspector.AuditRules.GzipRule.prototype.doRun):
+        (WebInspector.AuditRules.CookieSizeRule.prototype.processCookies):
+        (WebInspector.AuditRules.StaticCookielessRule.prototype.processCookies):
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.EventListenerBreakpointsSidebarPane):
+        (WebInspector.EventListenerBreakpointsSidebarPane.prototype._createCategory):
+        * inspector/front-end/CookieItemsView.js:
+        (WebInspector.CookieItemsView.prototype._updateWithCookies):
+        * inspector/front-end/ImageView.js:
+        (WebInspector.ImageView.prototype._createContentIfNeeded.onImageLoad):
+        (WebInspector.ImageView.prototype._createContentIfNeeded):
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkTimeCalculator.prototype.formatValue):
+        (WebInspector.NetworkTransferTimeCalculator.prototype.formatValue):
+        (WebInspector.NetworkTransferDurationCalculator.prototype.formatValue):
+        * inspector/front-end/ProfileDataGridTree.js:
+        (WebInspector.ProfileDataGridNode.prototype.get data.formatMilliseconds):
+        (WebInspector.ProfileDataGridNode.prototype.get data):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.Type.toUIString):
+        (WebInspector.Resource.Type.toString):
+        * inspector/front-end/TimelineOverviewPane.js:
+        (WebInspector.TimelineOverviewCalculator.prototype.formatValue):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel):
+        (WebInspector.TimelineCalculator.prototype.formatValue):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._generateAggregatedInfo):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
+        * inspector/front-end/utilities.js:
+        ():
+
 2011-01-13  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
 
         Reviewed by Simon Hausmann.
index 95867a4..72b57de 100644 (file)
Binary files a/Source/WebCore/English.lproj/localizedStrings.js and b/Source/WebCore/English.lproj/localizedStrings.js differ
index f5147e3..e7aa188 100644 (file)
@@ -167,7 +167,7 @@ WebInspector.ApplicationCacheItemsView.prototype = {
         this._emptyMsgElement.addStyleClass("hidden");
         this.deleteButton.visible = true;
 
-        var totalSizeString = Number.bytesToString(this._size, WebInspector.UIString);
+        var totalSizeString = Number.bytesToString(this._size);
         this._treeElement.subtitle = WebInspector.UIString("%s (%s)", lastPathComponent, totalSizeString);
 
         // FIXME: For Chrome, put creationTime and updateTime somewhere.
@@ -223,7 +223,7 @@ WebInspector.ApplicationCacheItemsView.prototype = {
             var resource = this._resources[i];
             data[0] = resource.name;
             data[1] = resource.type;
-            data[2] = Number.bytesToString(resource.size, WebInspector.UIString);
+            data[2] = Number.bytesToString(resource.size);
             var node = new WebInspector.DataGridNode(data);
             node.resource = resource;
             node.selectable = true;
index 3f79c25..7aa891f 100644 (file)
@@ -92,13 +92,13 @@ WebInspector.AuditRules.GzipRule.prototype = {
                 }
                 var savings = 2 * size / 3;
                 totalSavings += savings;
-                summary.addChild(String.sprintf("%s could save ~%s", WebInspector.AuditRuleResult.linkifyDisplayName(resource.url), Number.bytesToString(savings, WebInspector.UIString)));
+                summary.addChild(String.sprintf("%s could save ~%s", WebInspector.AuditRuleResult.linkifyDisplayName(resource.url), Number.bytesToString(savings)));
                 result.violationCount++;
             }
         }
         if (!totalSavings)
             return callback(null);
-        summary.value = String.sprintf("Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):", Number.bytesToString(totalSavings, WebInspector.UIString));
+        summary.value = String.sprintf("Compressing the following resources with gzip could reduce their transfer size by about two thirds (~%s):", Number.bytesToString(totalSavings));
         callback(result);
     },
 
@@ -966,7 +966,7 @@ WebInspector.AuditRules.CookieSizeRule.prototype = {
         for (var i = 0, len = sortedCookieSizes.length; i < len; ++i) {
             var maxCookieSize = sortedCookieSizes[i].maxCookieSize;
             if (maxCookieSize > this._maxBytesThreshold)
-                hugeCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ": " + Number.bytesToString(maxCookieSize, WebInspector.UIString));
+                hugeCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(sortedCookieSizes[i].domain) + ": " + Number.bytesToString(maxCookieSize));
         }
 
         var bigAvgCookieDomains = [];
@@ -975,9 +975,9 @@ WebInspector.AuditRules.CookieSizeRule.prototype = {
             var domain = sortedCookieSizes[i].domain;
             var avgCookieSize = sortedCookieSizes[i].avgCookieSize;
             if (avgCookieSize > this._avgBytesThreshold && avgCookieSize < this._maxBytesThreshold)
-                bigAvgCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(domain) + ": " + Number.bytesToString(avgCookieSize, WebInspector.UIString));
+                bigAvgCookieDomains.push(WebInspector.AuditRuleResult.resourceDomain(domain) + ": " + Number.bytesToString(avgCookieSize));
         }
-        result.addChild(String.sprintf("The average cookie size for all requests on this page is %s", Number.bytesToString(avgAllCookiesSize, WebInspector.UIString)));
+        result.addChild(String.sprintf("The average cookie size for all requests on this page is %s", Number.bytesToString(avgAllCookiesSize)));
 
         var message;
         if (hugeCookieDomains.length) {
@@ -1027,7 +1027,7 @@ WebInspector.AuditRules.StaticCookielessRule.prototype = {
         if (badUrls.length < this._minResources)
             return;
 
-        var entry = result.addChild(String.sprintf("%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:", Number.bytesToString(cookieBytes, WebInspector.UIString)), true);
+        var entry = result.addChild(String.sprintf("%s of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:", Number.bytesToString(cookieBytes)), true);
         entry.addURLs(badUrls);
         result.violationCount = badUrls.length;
     },
index 6103c00..408c5ba 100644 (file)
@@ -265,24 +265,24 @@ WebInspector.EventListenerBreakpointsSidebarPane = function()
     WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.EventListenerBreakpointAdded, this._breakpointAdded, this);
 
     this._breakpointItems = {};
-    this._createCategory(/*@LS*/"Keyboard", "listener", ["keydown", "keyup", "keypress", "textInput"]);
-    this._createCategory(/*@LS*/"Mouse", "listener", ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"]);
+    this._createCategory(WebInspector.UIString("Keyboard"), "listener", ["keydown", "keyup", "keypress", "textInput"]);
+    this._createCategory(WebInspector.UIString("Mouse"), "listener", ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"]);
     // FIXME: uncomment following once inspector stops being drop targer in major ports.
     // Otherwise, inspector page reacts on drop event and tries to load the event data.
-    // this._createCategory(/*@LS*/"Drag", "listener", ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]);
-    this._createCategory(/*@LS*/"Control", "listener", ["resize", "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"]);
-    this._createCategory(/*@LS*/"Clipboard", "listener", ["copy", "cut", "paste", "beforecopy", "beforecut", "beforepaste"]);
-    this._createCategory(/*@LS*/"Load", "listener", ["load", "unload", "abort", "error"]);
-    this._createCategory(/*@LS*/"DOM Mutation", "listener", ["DOMActivate", "DOMFocusIn", "DOMFocusOut", "DOMAttrModified", "DOMCharacterDataModified", "DOMNodeInserted", "DOMNodeInsertedIntoDocument", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMSubtreeModified", "DOMContentLoaded"]);
-    this._createCategory(/*@LS*/"Device", "listener", ["deviceorientation", "devicemotion"]);
-    this._createCategory(/*@LS*/"Timer", "instrumentation", ["setTimer", "clearTimer", "timerFired"]);
+    // this._createCategory(WebInspector.UIString("Drag"), "listener", ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]);
+    this._createCategory(WebInspector.UIString("Control"), "listener", ["resize", "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"]);
+    this._createCategory(WebInspector.UIString("Clipboard"), "listener", ["copy", "cut", "paste", "beforecopy", "beforecut", "beforepaste"]);
+    this._createCategory(WebInspector.UIString("Load"), "listener", ["load", "unload", "abort", "error"]);
+    this._createCategory(WebInspector.UIString("DOM Mutation"), "listener", ["DOMActivate", "DOMFocusIn", "DOMFocusOut", "DOMAttrModified", "DOMCharacterDataModified", "DOMNodeInserted", "DOMNodeInsertedIntoDocument", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMSubtreeModified", "DOMContentLoaded"]);
+    this._createCategory(WebInspector.UIString("Device"), "listener", ["deviceorientation", "devicemotion"]);
+    this._createCategory(WebInspector.UIString("Timer"), "instrumentation", ["setTimer", "clearTimer", "timerFired"]);
 }
 
 WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
     _createCategory: function(name, type, eventNames)
     {
         var categoryItem = {};
-        categoryItem.element = new TreeElement(WebInspector.UIString(name));
+        categoryItem.element = new TreeElement(name);
         this.categoriesTreeOutline.appendChild(categoryItem.element);
         categoryItem.element.listItemElement.addStyleClass("event-category");
         categoryItem.element.selectable = true;
index f9b9c6d..dc76b39 100644 (file)
@@ -101,7 +101,7 @@ WebInspector.CookieItemsView.prototype = {
         this._emptyMsgElement.addStyleClass("hidden");
         if (isAdvanced) {
             this._treeElement.subtitle = String.sprintf(WebInspector.UIString("%d cookies (%s)"), this._cookies.length,
-                Number.bytesToString(this._totalSize, WebInspector.UIString));
+                Number.bytesToString(this._totalSize));
             this._deleteButton.visible = true;
         }
         this._cookiesTable.updateWidths();
index 54a16bb..c5772c8 100644 (file)
@@ -87,7 +87,7 @@ WebInspector.ImageView.prototype = {
 
             var imageProperties = [
                 { name: WebInspector.UIString("Dimensions"), value: WebInspector.UIString("%d × %d", imagePreviewElement.naturalWidth, imagePreviewElement.naturalHeight) },
-                { name: WebInspector.UIString("File size"), value: Number.bytesToString(resourceSize, WebInspector.UIString) },
+                { name: WebInspector.UIString("File size"), value: Number.bytesToString(resourceSize) },
                 { name: WebInspector.UIString("MIME type"), value: this.resource.mimeType }
             ];
     
index 7b6df8b..ff42061 100644 (file)
@@ -1230,7 +1230,7 @@ WebInspector.NetworkTimeCalculator.prototype = {
 
     formatValue: function(value)
     {
-        return Number.secondsToString(value, WebInspector.UIString);
+        return Number.secondsToString(value);
     },
 
     _lowerBound: function(resource)
@@ -1254,7 +1254,7 @@ WebInspector.NetworkTransferTimeCalculator = function()
 WebInspector.NetworkTransferTimeCalculator.prototype = {
     formatValue: function(value)
     {
-        return Number.secondsToString(value, WebInspector.UIString);
+        return Number.secondsToString(value);
     },
 
     _lowerBound: function(resource)
@@ -1278,7 +1278,7 @@ WebInspector.NetworkTransferDurationCalculator = function()
 WebInspector.NetworkTransferDurationCalculator.prototype = {
     formatValue: function(value)
     {
-        return Number.secondsToString(value, WebInspector.UIString);
+        return Number.secondsToString(value);
     },
 
     _upperBound: function(resource)
index adf34f1..7988674 100644 (file)
@@ -50,7 +50,7 @@ WebInspector.ProfileDataGridNode.prototype = {
     {
         function formatMilliseconds(time)
         {
-            return Number.secondsToString(time / 1000, WebInspector.UIString, !Preferences.samplingCPUProfiler);
+            return Number.secondsToString(time / 1000, !Preferences.samplingCPUProfiler);
         }
 
         var data = {};
index fd56ee9..988c4e6 100644 (file)
@@ -55,7 +55,27 @@ WebInspector.Resource.Type = {
 
     toUIString: function(type)
     {
-        return WebInspector.UIString(WebInspector.Resource.Type.toString(type));
+        switch (type) {
+            case this.Document:
+                return WebInspector.UIString("Document");
+            case this.Stylesheet:
+                return WebInspector.UIString("Stylesheet");
+            case this.Image:
+                return WebInspector.UIString("Image");
+            case this.Font:
+                return WebInspector.UIString("Font");
+            case this.Script:
+                return WebInspector.UIString("Script");
+            case this.XHR:
+                return WebInspector.UIString("XHR");
+            case this.Media:
+                return WebInspector.UIString("Media");
+            case this.WebSocket:
+                return WebInspector.UIString("WebSocket");
+            case this.Other:
+            default:
+                return WebInspector.UIString("Other");
+        }
     },
 
     // Returns locale-independent string identifier of resource type (primarily for use in extension API).
@@ -64,24 +84,24 @@ WebInspector.Resource.Type = {
     {
         switch (type) {
             case this.Document:
-                return /*@LS*/"document";
+                return "document";
             case this.Stylesheet:
-                return /*@LS*/"stylesheet";
+                return "stylesheet";
             case this.Image:
-                return /*@LS*/"image";
+                return "image";
             case this.Font:
-                return /*@LS*/"font";
+                return "font";
             case this.Script:
-                return /*@LS*/"script";
+                return "script";
             case this.XHR:
-                return /*@LS*/"xhr";
+                return "xhr";
             case this.Media:
-                return /*@LS*/"media";
+                return "media";
             case this.WebSocket:
-                return /*@LS*/"websocket";
+                return "websocket";
             case this.Other:
             default:
-                return /*@LS*/"other";
+                return "other";
         }
     }
 }
index 55e24c5..0dac916 100644 (file)
@@ -398,7 +398,7 @@ WebInspector.TimelineOverviewCalculator.prototype = {
 
     formatValue: function(value)
     {
-        return Number.secondsToString(value, WebInspector.UIString);
+        return Number.secondsToString(value);
     }
 }
 
index acca387..7206d81 100644 (file)
@@ -83,7 +83,7 @@ WebInspector.TimelinePanel = function()
 
     this._calculator = new WebInspector.TimelineCalculator();
     this._calculator._showShortEvents = false;
-    var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold, WebInspector.UIString);
+    var shortRecordThresholdTitle = Number.secondsToString(WebInspector.TimelinePanel.shortRecordThreshold);
     this._showShortRecordsTitleText = WebInspector.UIString("Show the records that are shorter than %s", shortRecordThresholdTitle);
     this._hideShortRecordsTitleText = WebInspector.UIString("Hide the records that are shorter than %s", shortRecordThresholdTitle);
     this._createStatusbarButtons();
@@ -710,7 +710,7 @@ WebInspector.TimelineCalculator.prototype = {
 
     formatValue: function(value)
     {
-        return Number.secondsToString(value + this.minimumBoundary - this._absoluteMinimumBoundary, WebInspector.UIString);
+        return Number.secondsToString(value + this.minimumBoundary - this._absoluteMinimumBoundary);
     }
 }
 
@@ -908,7 +908,7 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
             label.className = "timeline-aggregated-category timeline-" + index;
             cell.appendChild(label);
             var text = document.createElement("span");
-            text.textContent = Number.secondsToString(this._aggregatedStats[index] + 0.0001, WebInspector.UIString);
+            text.textContent = Number.secondsToString(this._aggregatedStats[index] + 0.0001);
             cell.appendChild(text);
         }
         return cell;
@@ -919,10 +919,10 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
         var contentHelper = new WebInspector.TimelinePanel.PopupContentHelper(this.title);
 
         if (this._children && this._children.length) {
-            contentHelper._appendTextRow(WebInspector.UIString("Self Time"), Number.secondsToString(this._selfTime + 0.0001, WebInspector.UIString));
+            contentHelper._appendTextRow(WebInspector.UIString("Self Time"), Number.secondsToString(this._selfTime + 0.0001));
             contentHelper._appendElementRow(WebInspector.UIString("Aggregated Time"), this._generateAggregatedInfo());
         }
-        var text = WebInspector.UIString("%s (at %s)", Number.secondsToString(this._lastChildEndTime - this.startTime, WebInspector.UIString),
+        var text = WebInspector.UIString("%s (at %s)", Number.secondsToString(this._lastChildEndTime - this.startTime),
             calculator.formatValue(this.startTime - calculator.minimumBoundary));
         contentHelper._appendTextRow(WebInspector.UIString("Duration"), text);
 
@@ -930,14 +930,14 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
 
         switch (this.type) {
             case recordTypes.GCEvent:
-                contentHelper._appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta, WebInspector.UIString));
+                contentHelper._appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta));
                 break;
             case recordTypes.TimerInstall:
             case recordTypes.TimerFire:
             case recordTypes.TimerRemove:
                 contentHelper._appendTextRow(WebInspector.UIString("Timer ID"), this.data.timerId);
                 if (typeof this.timeout === "number") {
-                    contentHelper._appendTextRow(WebInspector.UIString("Timeout"), Number.secondsToString(this.timeout / 1000, WebInspector.UIString));
+                    contentHelper._appendTextRow(WebInspector.UIString("Timeout"), Number.secondsToString(this.timeout / 1000));
                     contentHelper._appendTextRow(WebInspector.UIString("Repeats"), !this.singleShot);
                 }
                 break;
@@ -978,7 +978,7 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
             contentHelper._appendLinkRow(WebInspector.UIString("Function Call"), this.data.scriptName, this.data.scriptLine);
 
         if (this.usedHeapSize)
-            contentHelper._appendTextRow(WebInspector.UIString("Used Heap Size"), WebInspector.UIString("%s of %s", Number.bytesToString(this.usedHeapSize, WebInspector.UIString), Number.bytesToString(this.totalHeapSize, WebInspector.UIString)));
+            contentHelper._appendTextRow(WebInspector.UIString("Used Heap Size"), WebInspector.UIString("%s of %s", Number.bytesToString(this.usedHeapSize), Number.bytesToString(this.totalHeapSize)));
 
         if (this.callSiteStackTrace && this.callSiteStackTrace.length)
             contentHelper._appendStackTrace(WebInspector.UIString("Call Site stack"), this.callSiteStackTrace);
@@ -993,7 +993,7 @@ WebInspector.TimelinePanel.FormattedRecord.prototype = {
     {
         switch (record.type) {
             case WebInspector.TimelineAgent.RecordType.GCEvent:
-                return WebInspector.UIString("%s collected", Number.bytesToString(record.data.usedHeapSizeDelta, WebInspector.UIString));
+                return WebInspector.UIString("%s collected", Number.bytesToString(record.data.usedHeapSizeDelta));
             case WebInspector.TimelineAgent.RecordType.TimerFire:
                 return record.data.scriptName ? WebInspector.linkifyResourceAsNode(record.data.scriptName, "scripts", record.data.scriptLine, "", "") : record.data.timerId;
             case WebInspector.TimelineAgent.RecordType.FunctionCall:
index 653e53a..8705faf 100644 (file)
@@ -643,61 +643,56 @@ function parentNode(node)
     return node.parentNode;
 }
 
-Number.millisToString = function(ms, formatterFunction, higherResolution)
+Number.millisToString = function(ms, higherResolution)
 {
-    return Number.secondsToString(ms / 1000, formatterFunction, higherResolution);
+    return Number.secondsToString(ms / 1000, higherResolution);
 }
 
-Number.secondsToString = function(seconds, formatterFunction, higherResolution)
+Number.secondsToString = function(seconds, higherResolution)
 {
-    if (!formatterFunction)
-        formatterFunction = String.sprintf;
-
     if (seconds === 0)
         return "0";
 
     var ms = seconds * 1000;
     if (higherResolution && ms < 1000)
-        return formatterFunction(/*@LS*/"%.3fms", ms);
+        return WebInspector.UIString("%.3fms", ms);
     else if (ms < 1000)
-        return formatterFunction(/*@LS*/"%.0fms", ms);
+        return WebInspector.UIString("%.0fms", ms);
 
     if (seconds < 60)
-        return formatterFunction(/*@LS*/"%.2fs", seconds);
+        return WebInspector.UIString("%.2fs", seconds);
 
     var minutes = seconds / 60;
     if (minutes < 60)
-        return formatterFunction(/*@LS*/"%.1fmin", minutes);
+        return WebInspector.UIString("%.1fmin", minutes);
 
     var hours = minutes / 60;
     if (hours < 24)
-        return formatterFunction(/*@LS*/"%.1fhrs", hours);
+        return WebInspector.UIString("%.1fhrs", hours);
 
     var days = hours / 24;
-    return formatterFunction(/*@LS*/"%.1f days", days);
+    return WebInspector.UIString("%.1f days", days);
 }
 
-Number.bytesToString = function(bytes, formatterFunction, higherResolution)
+Number.bytesToString = function(bytes, higherResolution)
 {
-    if (!formatterFunction)
-        formatterFunction = String.sprintf;
     if (typeof higherResolution === "undefined")
         higherResolution = true;
 
     if (bytes < 1024)
-        return formatterFunction(/*@LS*/"%.0fB", bytes);
+        return WebInspector.UIString("%.0fB", bytes);
 
     var kilobytes = bytes / 1024;
     if (higherResolution && kilobytes < 1024)
-        return formatterFunction(/*@LS*/"%.2fKB", kilobytes);
+        return WebInspector.UIString("%.2fKB", kilobytes);
     else if (kilobytes < 1024)
-        return formatterFunction(/*@LS*/"%.0fKB", kilobytes);
+        return WebInspector.UIString("%.0fKB", kilobytes);
 
     var megabytes = kilobytes / 1024;
     if (higherResolution)
-        return formatterFunction(/*@LS*/"%.2fMB", megabytes);
+        return WebInspector.UIString("%.2fMB", megabytes);
     else
-        return formatterFunction(/*@LS*/"%.0fMB", megabytes);
+        return WebInspector.UIString("%.0fMB", megabytes);
 }
 
 Number.constrain = function(num, min, max)
index 78bd791..c46e5f8 100644 (file)
@@ -1,3 +1,14 @@
+2011-01-13  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Cleanup after r75613 -- make all UI-facing strings
+        to be passed directly to WebInspector.UIString
+
+        https://bugs.webkit.org/show_bug.cgi?id=52365
+
+        * Scripts/check-inspector-strings:
+
 2011-01-13  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r74881.
index 901d502..82c08d7 100755 (executable)
@@ -94,7 +94,7 @@ if __name__ == "__main__":
     _log.debug("WebKit checkout found with root: %s" % checkout_root)
     change_directory(checkout_root=checkout_root, paths=None)
 
-    strings_extractor = StringsExtractor([r"(?:WebInspector\.(?:UIString|formatLocalized)\(|/\*@LS\*/)\"((?:[^\"\\]|\\.)*?)\"", r"\"((?:[^\"\\]|\\.)*?)\""])
+    strings_extractor = StringsExtractor([r"WebInspector\.(?:UIString|formatLocalized)\(\"((?:[^\"\\]|\\.)*?)\"", r"\"((?:[^\"\\]|\\.)*?)\""])
     file_reader = TextFileReader(strings_extractor)
     file_reader.process_paths([_inspector_directory])
     localized_strings_extractor = LocalizedStringsExtractor()