[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-changes
Subject:    [webkit-changes] [239452] trunk
From:       drousso () apple ! com
Date:       2018-12-20 18:29:46
Message-ID: 20181220182946.283CC10051CC () svn ! webkit ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[239452] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt;  } #msg dl a { font-weight: \
bold} #msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
 #patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
                .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://trac.webkit.org/projects/webkit/changeset/239452">239452</a></dd> \
<dt>Author</dt> <dd>drousso@apple.com</dd> <dt>Date</dt> <dd>2018-12-20 10:29:45 \
-0800 (Thu, 20 Dec 2018)</dd> </dl>

<h3>Log Message</h3>
<pre>Web Inspector: UIString should take an optional key and description to aid \
localization https://bugs.webkit.org/show_bug.cgi?id=153962
&lt;rdar://problem/24542505&gt;

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Base/LoadLocalizedStrings.js:
(WI.UIString):

* UserInterface/Test/Test.js:
(WI.UIString):

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

Tools:

* Scripts/extract-localizable-js-strings:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
 <li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
 <li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseLoadLocalizedStringsjs">trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js</a></li>
 <li><a href="#trunkSourceWebInspectorUIUserInterfaceTestTestjs">trunk/Source/WebInspectorUI/UserInterface/Test/Test.js</a></li>
 <li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsAuditTestGroupContentViewjs" \
>trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js</a></li>
> 
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptsextractlocalizablejsstrings">trunk/Tools/Scripts/extract-localizable-js-strings</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (239451 => \
239452)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 18:27:46 UTC \
                (rev 239451)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 18:29:45 UTC (rev 239452)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2018-12-20  Devin Rousso  &lt;drousso@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: UIString should take an optional key and \
description to aid localization +        \
https://bugs.webkit.org/show_bug.cgi?id=153962 +        \
&lt;rdar://problem/24542505&gt; +
+        Reviewed by Brian Burg.
+
+        * UserInterface/Base/LoadLocalizedStrings.js:
+        (WI.UIString):
+
+        * UserInterface/Test/Test.js:
+        (WI.UIString):
+
+        * UserInterface/Views/AuditTestGroupContentView.js:
+        (WI.AuditTestGroupContentView.prototype.initialLayout):
+
+2018-12-20  Devin Rousso  &lt;drousso@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Audits: don't cache default audits
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=192918
</span><span class="cx">         &lt;rdar://problem/46626543&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (239451 => \
239452)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2018-12-20 \
                18:27:46 UTC (rev 239451)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2018-12-20 \
18:29:45 UTC (rev 239452) </span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx"> localizedStrings[&quot;%s delay&quot;] = &quot;%s \
delay&quot;; </span><span class="cx"> localizedStrings[&quot;%s eval\n%s async&quot;] \
= &quot;%s eval\n%s async&quot;; </span><span class="cx"> localizedStrings[&quot;%s \
interval&quot;] = &quot;%s interval&quot;; \
</span><del>-localizedStrings[&quot;%s%%&quot;] = &quot;%s%%&quot;; </del><span \
class="cx"> localizedStrings[&quot;(Action %s)&quot;] = &quot;(Action %s)&quot;; \
</span><span class="cx"> localizedStrings[&quot;(Disk)&quot;] = &quot;(Disk)&quot;; \
</span><span class="cx"> localizedStrings[&quot;(Index)&quot;] = &quot;(Index)&quot;; \
</span><span class="lines">@@ -672,6 +671,8 @@ </span><span class="cx"> \
localizedStrings[&quot;Pause Processing&quot;] = &quot;Pause Processing&quot;; \
</span><span class="cx"> localizedStrings[&quot;Pause Reason&quot;] = &quot;Pause \
Reason&quot;; </span><span class="cx"> localizedStrings[&quot;Pause script execution \
(%s or %s)&quot;] = &quot;Pause script execution (%s or %s)&quot;; </span><ins>+/* \
The number of tests that passed expressed as a percentage, followed by a literal %. \
*/ +localizedStrings[&quot;Percentage (of audits)&quot;] = &quot;%s%%&quot;;
</ins><span class="cx"> localizedStrings[&quot;Ping&quot;] = &quot;Ping&quot;;
</span><span class="cx"> localizedStrings[&quot;Ping Frame&quot;] = &quot;Ping \
Frame&quot;; </span><span class="cx"> localizedStrings[&quot;Pings&quot;] = \
&quot;Pings&quot;; </span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseLoadLocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js (239451 => \
239452)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js	2018-12-20 \
                18:27:46 UTC (rev 239451)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/LoadLocalizedStrings.js	2018-12-20 \
18:29:45 UTC (rev 239452) </span><span class="lines">@@ -41,23 +41,25 @@
</span><span class="cx">     return string;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-WI.UIString = function(string)
</del><ins>+WI.UIString = function(string, key, comment)
</ins><span class="cx"> {
</span><span class="cx">     if (WI.dontLocalizeUserInterface)
</span><span class="cx">         return string;
</span><span class="cx"> 
</span><del>-    if (window.localizedStrings &amp;&amp; string in \
                window.localizedStrings)
-        return window.localizedStrings[string];
</del><ins>+    key = key || string;
</ins><span class="cx"> 
</span><ins>+    if (window.localizedStrings &amp;&amp; key in \
window.localizedStrings) +        return window.localizedStrings[key];
+
</ins><span class="cx">     if (!window.localizedStrings)
</span><del>-        console.error(`Attempted to load localized string \
&quot;${string}&quot; before localizedStrings was initialized.`); </del><ins>+        \
console.error(`Attempted to load localized string &quot;${key}&quot; before \
localizedStrings was initialized.`, comment); </ins><span class="cx"> 
</span><span class="cx">     if (!this._missingLocalizedStrings)
</span><span class="cx">         this._missingLocalizedStrings = {};
</span><span class="cx"> 
</span><del>-    if (!(string in this._missingLocalizedStrings)) {
-        console.error(&quot;Localized string \&quot;&quot; + string + &quot;\&quot; \
                was not found.&quot;);
-        this._missingLocalizedStrings[string] = true;
</del><ins>+    if (!(key in this._missingLocalizedStrings)) {
+        console.error(`Localized string &quot;${key}&quot; was not found.`, \
comment); +        this._missingLocalizedStrings[key] = true;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return &quot;LOCALIZED STRING NOT FOUND&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTestTestjs"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebInspectorUI/UserInterface/Test/Test.js (239451 => 239452)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/Source/WebInspectorUI/UserInterface/Test/Test.js	2018-12-20 18:27:46 UTC (rev \
                239451)
+++ trunk/Source/WebInspectorUI/UserInterface/Test/Test.js	2018-12-20 18:29:45 UTC \
(rev 239452) </span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> WI.isDebugUIEnabled = () =&gt; false;
</span><span class="cx"> 
</span><span class="cx"> WI.unlocalizedString = (string) =&gt; string;
</span><del>-WI.UIString = (string) =&gt; string;
</del><ins>+WI.UIString = (string, key, comment) =&gt; string;
</ins><span class="cx"> 
</span><span class="cx"> WI.indentString = () =&gt; &quot;    &quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsAuditTestGroupContentViewjs"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js (239451 \
=> 239452)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js	2018-12-20 \
                18:27:46 UTC (rev 239451)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js	2018-12-20 \
18:29:45 UTC (rev 239452) </span><span class="lines">@@ -65,7 +65,8 @@
</span><span class="cx"> 
</span><span class="cx">         this._percentageTextElement = \
document.createElement(&quot;span&quot;); </span><span class="cx"> 
</span><del>-        String.format(WI.UIString(&quot;%s%%&quot;), \
[this._percentageTextElement], String.standardFormatters, this._percentageContainer, \
(a, b) =&gt; { </del><ins>+        const format = WI.UIString(&quot;%s%%&quot;, \
&quot;Percentage (of audits)&quot;, &quot;The number of tests that passed expressed \
as a percentage, followed by a literal %.&quot;); +        String.format(format, \
[this._percentageTextElement], String.standardFormatters, this._percentageContainer, \
(a, b) =&gt; { </ins><span class="cx">             a.append(b);
</span><span class="cx">             return a;
</span><span class="cx">         });
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (239451 => 239452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog	2018-12-20 18:27:46 UTC (rev 239451)
+++ trunk/Tools/ChangeLog	2018-12-20 18:29:45 UTC (rev 239452)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2018-12-20  Devin Rousso  &lt;drousso@apple.com&gt;
+
+        Web Inspector: UIString should take an optional key and description to aid \
localization +        https://bugs.webkit.org/show_bug.cgi?id=153962
+        &lt;rdar://problem/24542505&gt;
+
+        Reviewed by Brian Burg.
+
+        * Scripts/extract-localizable-js-strings:
+
</ins><span class="cx"> 2018-12-20  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unparented WKWebView can't retrieve main resource \
data for a main frame plugin </span></span></pre></div>
<a id="trunkToolsScriptsextractlocalizablejsstrings"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/extract-localizable-js-strings \
(239451 => 239452)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/extract-localizable-js-strings	2018-12-20 \
                18:27:46 UTC (rev 239451)
+++ trunk/Tools/Scripts/extract-localizable-js-strings	2018-12-20 18:29:45 UTC (rev \
239452) </span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">         chomp;
</span><span class="cx"> 
</span><span class="cx">         # Handle WebInspector strings. Prints a warning if a \
non-string literal is passed to WI.UIString(). </span><del>-        \
HandleUIString($1, $1, &quot;&quot;, $file, $.) while \
s/WI\.UIString\(&quot;([^&quot;]+)&quot;\)//; </del><ins>+        HandleUIString($1, \
$2 || $1, $3 || &quot;&quot;, $file, $.) while \
s/WI\.UIString\(&quot;([^&quot;]+)&quot;(?:,\s*&quot;([^&quot;]+)&quot;(?:,\s*&quot;([^&quot;]+)&quot;)?)?\)//;
 </ins><span class="cx">         print &quot;$file:$.:WARNING: $&amp;\n&quot; while \
s/WI\.UIString\(.*?\)//; </span><span class="cx"> 
</span><span class="cx">         # Handle strings for other projects that also use \
this script. </span><span class="lines">@@ -151,6 +151,7 @@
</span><span class="cx"> my $localizedStrings = &quot;var localizedStrings = new \
Object;\n\n&quot;; </span><span class="cx"> 
</span><span class="cx"> for my $key (sort keys %commentByKey) {
</span><ins>+    $localizedStrings .= &quot;/* $commentByKey{$key} */\n&quot; if \
length $commentByKey{$key}; </ins><span class="cx">     $localizedStrings .= \
&quot;localizedStrings[\&quot;$key\&quot;] = \
\&quot;$stringByKey{$key}\&quot;;\n&quot;; </span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>



_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic