Title: [239286] trunk/Source/WebInspectorUI
Revision
239286
Author
drou...@apple.com
Date
2018-12-17 13:16:30 -0800 (Mon, 17 Dec 2018)

Log Message

Web Inspector: Audit: add plural result strings
https://bugs.webkit.org/show_bug.cgi?id=192769
<rdar://problem/46628680>

Reviewed by Brian Burg.

* UserInterface/Views/AuditTestContentView.js:
(WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):

* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.layout):

* Localizations/en.lproj/localizedStrings.js:

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (239285 => 239286)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-12-17 21:15:39 UTC (rev 239285)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-12-17 21:16:30 UTC (rev 239286)
@@ -1,5 +1,21 @@
 2018-12-17  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: Audit: add plural result strings
+        https://bugs.webkit.org/show_bug.cgi?id=192769
+        <rdar://problem/46628680>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Views/AuditTestContentView.js:
+        (WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):
+
+        * UserInterface/Views/AuditTestGroupContentView.js:
+        (WI.AuditTestGroupContentView.prototype.layout):
+
+        * Localizations/en.lproj/localizedStrings.js:
+
+2018-12-17  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: Settings: add singular "space" UIString
         https://bugs.webkit.org/show_bug.cgi?id=192766
         <rdar://problem/46776948>

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (239285 => 239286)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2018-12-17 21:15:39 UTC (rev 239285)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2018-12-17 21:16:30 UTC (rev 239286)
@@ -25,14 +25,14 @@
 localizedStrings["%d Error"] = "%d Error";
 localizedStrings["%d Errors"] = "%d Errors";
 localizedStrings["%d Errors, %d Warnings"] = "%d Errors, %d Warnings";
-localizedStrings["%d Fail"] = "%d Fail";
+localizedStrings["%d Failed"] = "%d Failed";
 localizedStrings["%d Frame"] = "%d Frame";
 localizedStrings["%d Frames"] = "%d Frames";
 localizedStrings["%d More\u2026"] = "%d More\u2026";
-localizedStrings["%d Pass"] = "%d Pass";
+localizedStrings["%d Passed"] = "%d Passed";
 localizedStrings["%d Threads"] = "%d Threads";
 localizedStrings["%d Unsupported"] = "%d Unsupported";
-localizedStrings["%d Warn"] = "%d Warn";
+localizedStrings["%d Warning"] = "%d Warning";
 localizedStrings["%d Warnings"] = "%d Warnings";
 localizedStrings["%d \xd7 %d pixels"] = "%d \xd7 %d pixels";
 localizedStrings["%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)"] = "%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)";
@@ -921,8 +921,8 @@
 localizedStrings["The \u201C%s\u201D audit failed"] = "The \u201C%s\u201D audit failed";
 localizedStrings["The \u201C%s\u201D audit is unsupported"] = "The \u201C%s\u201D audit is unsupported";
 localizedStrings["The \u201C%s\u201D audit passed"] = "The \u201C%s\u201D audit passed";
+localizedStrings["The \u201C%s\u201D audit resulted in a warning"] = "The \u201C%s\u201D audit resulted in a warning";
 localizedStrings["The \u201C%s\u201D audit threw an error"] = "The \u201C%s\u201D audit threw an error";
-localizedStrings["The \u201C%s\u201D audit warned"] = "The \u201C%s\u201D audit warned";
 localizedStrings["The \u201C%s\u201D\ntable is empty."] = "The \u201C%s\u201D\ntable is empty.";
 localizedStrings["The page's content has changed"] = "The page's content has changed";
 localizedStrings["The resource was requested insecurely."] = "The resource was requested insecurely.";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js (239285 => 239286)


--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js	2018-12-17 21:15:39 UTC (rev 239285)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js	2018-12-17 21:16:30 UTC (rev 239286)
@@ -180,7 +180,7 @@
             else if (result.didFail)
                 message = WI.UIString("The \u201C%s\u201D audit failed");
             else if (result.didWarn)
-                message = WI.UIString("The \u201C%s\u201D audit warned");
+                message = WI.UIString("The \u201C%s\u201D audit resulted in a warning");
             else if (result.didPass)
                 message = WI.UIString("The \u201C%s\u201D audit passed");
             else if (result.unsupported)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js (239285 => 239286)


--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js	2018-12-17 21:15:39 UTC (rev 239285)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js	2018-12-17 21:16:30 UTC (rev 239286)
@@ -97,11 +97,12 @@
         if (!this._levelScopeBar) {
             let scopeBarItems = [];
 
-            let addScopeBarItem = (level, label) => {
+            let addScopeBarItem = (level, labelSingular, labelPlural) => {
                 let count = levelCounts[level];
                 if (isNaN(count) || count <= 0)
                     return;
 
+                let label = (labelPlural && count !== 1) ? labelPlural : labelSingular;
                 let scopeBarItem = new WI.ScopeBarItem(level, label.format(count), {
                     className: level,
                     exclusive: false,
@@ -111,10 +112,10 @@
                 scopeBarItems.push(scopeBarItem);
             };
 
-            addScopeBarItem(WI.AuditTestCaseResult.Level.Pass, WI.UIString("%d Pass"));
-            addScopeBarItem(WI.AuditTestCaseResult.Level.Warn, WI.UIString("%d Warn"));
-            addScopeBarItem(WI.AuditTestCaseResult.Level.Fail, WI.UIString("%d Fail"));
-            addScopeBarItem(WI.AuditTestCaseResult.Level.Error, WI.UIString("%d Error"));
+            addScopeBarItem(WI.AuditTestCaseResult.Level.Pass, WI.UIString("%d Passed"));
+            addScopeBarItem(WI.AuditTestCaseResult.Level.Warn, WI.UIString("%d Warning"), WI.UIString("%d Warnings"));
+            addScopeBarItem(WI.AuditTestCaseResult.Level.Fail, WI.UIString("%d Failed"));
+            addScopeBarItem(WI.AuditTestCaseResult.Level.Error, WI.UIString("%d Error"), WI.UIString("%d Errors"));
             addScopeBarItem(WI.AuditTestCaseResult.Level.Unsupported, WI.UIString("%d Unsupported"));
 
             this._levelScopeBar = new WI.ScopeBar(null, scopeBarItems);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to