Title: [214841] trunk/Source/WebInspectorUI
Revision
214841
Author
commit-qu...@webkit.org
Date
2017-04-03 15:06:24 -0700 (Mon, 03 Apr 2017)

Log Message

Web Inspector: "Space" is not localizable in Timelines record button tooltips
https://bugs.webkit.org/show_bug.cgi?id=170420
<rdar://problem/30871371>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2017-04-03
Reviewed by Timothy Hatcher.

* UserInterface/Base/LoadLocalizedStrings.js:
(WebInspector.unlocalizedString):
(WebInspector.UIString):
* UserInterface/Base/Main.js:
Move UIString / unlocalizedString to LoadLocalizedString.js.
They may be needed before Main.js has introduced it.

* UserInterface/Test/Test.js:
Provide a default implementaiton of unlocalizedString.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/KeyboardShortcut.js:
Most keys use a symbol to represent the key. "Space" was the one
exception, so use a localized string.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (214840 => 214841)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-04-03 22:05:04 UTC (rev 214840)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-04-03 22:06:24 UTC (rev 214841)
@@ -1,5 +1,28 @@
 2017-04-03  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: "Space" is not localizable in Timelines record button tooltips
+        https://bugs.webkit.org/show_bug.cgi?id=170420
+        <rdar://problem/30871371>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/LoadLocalizedStrings.js:
+        (WebInspector.unlocalizedString):
+        (WebInspector.UIString):
+        * UserInterface/Base/Main.js:
+        Move UIString / unlocalizedString to LoadLocalizedString.js.
+        They may be needed before Main.js has introduced it.
+
+        * UserInterface/Test/Test.js:
+        Provide a default implementaiton of unlocalizedString.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Models/KeyboardShortcut.js:
+        Most keys use a symbol to represent the key. "Space" was the one
+        exception, so use a localized string.
+
+2017-04-03  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Tooltip for close tab button should match Safari
         https://bugs.webkit.org/show_bug.cgi?id=170417
         <rdar://problem/31378423>

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


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2017-04-03 22:05:04 UTC (rev 214840)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2017-04-03 22:06:24 UTC (rev 214841)
@@ -767,6 +767,7 @@
 localizedStrings["Sort Descending"] = "Sort Descending";
 localizedStrings["Source"] = "Source";
 localizedStrings["Sources"] = "Sources";
+localizedStrings["Space"] = "Space";
 localizedStrings["Spaces"] = "Spaces";
 localizedStrings["Spacing"] = "Spacing";
 localizedStrings["Specificity: (%d, %d, %d)"] = "Specificity: (%d, %d, %d)";

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js (214840 => 214841)


--- trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js	2017-04-03 22:05:04 UTC (rev 214840)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js	2017-04-03 22:06:24 UTC (rev 214841)
@@ -32,3 +32,30 @@
     if (localizedStringsURL)
         document.write("<script src="" + localizedStringsURL + "\"></script>");
 })();
+
+WebInspector.unlocalizedString = function(string)
+{
+    // Intentionally do nothing, since this is for engineering builds
+    // (such as in Debug UI) or in text that is standardized in English.
+    // For example, CSS property names and values are never localized.
+    return string;
+};
+
+WebInspector.UIString = function(string, vararg)
+{
+    if (WebInspector.dontLocalizeUserInterface)
+        return string;
+
+    if (window.localizedStrings && string in window.localizedStrings)
+        return window.localizedStrings[string];
+
+    if (!this._missingLocalizedStrings)
+        this._missingLocalizedStrings = {};
+
+    if (!(string in this._missingLocalizedStrings)) {
+        console.error("Localized string \"" + string + "\" was not found.");
+        this._missingLocalizedStrings[string] = true;
+    }
+
+    return "LOCALIZED STRING NOT FOUND";
+};

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (214840 => 214841)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2017-04-03 22:05:04 UTC (rev 214840)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2017-04-03 22:06:24 UTC (rev 214841)
@@ -1064,33 +1064,6 @@
     this.tabBrowser.showTabForContentView(tabContentView);
 };
 
-WebInspector.unlocalizedString = function(string)
-{
-    // Intentionally do nothing, since this is for engineering builds
-    // (such as in Debug UI) or in text that is standardized in English.
-    // For example, CSS property names and values are never localized.
-    return string;
-};
-
-WebInspector.UIString = function(string, vararg)
-{
-    if (WebInspector.dontLocalizeUserInterface)
-        return string;
-
-    if (window.localizedStrings && string in window.localizedStrings)
-        return window.localizedStrings[string];
-
-    if (!this._missingLocalizedStrings)
-        this._missingLocalizedStrings = {};
-
-    if (!(string in this._missingLocalizedStrings)) {
-        console.error("Localized string \"" + string + "\" was not found.");
-        this._missingLocalizedStrings[string] = true;
-    }
-
-    return "LOCALIZED STRING NOT FOUND";
-};
-
 WebInspector.indentString = function()
 {
     if (WebInspector.settings.indentWithTabs.value)

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js (214840 => 214841)


--- trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js	2017-04-03 22:05:04 UTC (rev 214840)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/KeyboardShortcut.js	2017-04-03 22:06:24 UTC (rev 214841)
@@ -232,7 +232,7 @@
     Tab: new WebInspector.Key(9, "\u21e5"),
     Enter: new WebInspector.Key(13, "\u21a9"),
     Escape: new WebInspector.Key(27, "\u238b"),
-    Space: new WebInspector.Key(32, "Space"),
+    Space: new WebInspector.Key(32, WebInspector.UIString("Space")),
     PageUp: new WebInspector.Key(33, "\u21de"),
     PageDown: new WebInspector.Key(34, "\u21df"),
     End: new WebInspector.Key(35, "\u2198"),

Modified: trunk/Source/WebInspectorUI/UserInterface/Test/Test.js (214840 => 214841)


--- trunk/Source/WebInspectorUI/UserInterface/Test/Test.js	2017-04-03 22:05:04 UTC (rev 214840)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/Test.js	2017-04-03 22:06:24 UTC (rev 214841)
@@ -102,6 +102,7 @@
 
 WebInspector.isDebugUIEnabled = () => false;
 
+WebInspector.unlocalizedString = (string) => string;
 WebInspector.UIString = (string) => string;
 
 WebInspector.indentString = () => "    ";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to