<!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>[214723] trunk/Source</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/214723">214723</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2017-04-01 21:53:39 -0700 (Sat, 01 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] &lt;input type=file&gt; label should be specified using plural rules
https://bugs.webkit.org/show_bug.cgi?id=170388

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.

* English.lproj/Localizable.stringsdict: Added an entry for the new key &quot;%lu photo(s) and
  %lu video(s)&quot;, with plural rules covering all the different combinations in English.
  Other localizations may specify additional combinations as needed.

Source/WebKit2:

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
  Instead of calling -_displayStringForPhotos:videos:, use
  +[NSString localizedStringWithFormat:] with the new format string &quot;%lu photo(s) and
  %lu video(s)&quot; for which there are plural rules.
(-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreEnglishlprojLocalizablestrings">trunk/Source/WebCore/English.lproj/Localizable.strings</a></li>
<li><a href="#trunkSourceWebCoreEnglishlprojLocalizablestringsdict">trunk/Source/WebCore/English.lproj/Localizable.stringsdict</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosformsWKFileUploadPanelmm">trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214722 => 214723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-02 01:56:34 UTC (rev 214722)
+++ trunk/Source/WebCore/ChangeLog        2017-04-02 04:53:39 UTC (rev 214723)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-04-01  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        [iOS] &lt;input type=file&gt; label should be specified using plural rules
+        https://bugs.webkit.org/show_bug.cgi?id=170388
+
+        Reviewed by Alexey Proskuryakov.
+
+        * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
+
+        * English.lproj/Localizable.stringsdict: Added an entry for the new key &quot;%lu photo(s) and
+          %lu video(s)&quot;, with plural rules covering all the different combinations in English.
+          Other localizations may specify additional combinations as needed.
+
</ins><span class="cx"> 2017-04-01  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rolling back &lt;https://trac.webkit.org/r214697&gt;, as it made WebKit2.DataDetectionReferenceDate time out.
</span></span></pre></div>
<a id="trunkSourceWebCoreEnglishlprojLocalizablestrings"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (214722 => 214723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/English.lproj/Localizable.strings        2017-04-02 01:56:34 UTC (rev 214722)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings        2017-04-02 04:53:39 UTC (rev 214723)
</span><span class="lines">@@ -1,12 +1,3 @@
</span><del>-/* File Upload multiple photos label */
-&quot;# Photos (file upload on page label for multiple photos)&quot; = &quot;%@ Photos&quot;;
-
-/* File Upload images and videos label */
-&quot;# Photos and # Videos (file upload on page label for image and videos)&quot; = &quot;%@ and %@&quot;;
-
-/* File Upload multiple videos label */
-&quot;# Videos (file upload on page label for multiple videos)&quot; = &quot;%@ Videos&quot;;
-
</del><span class="cx"> /* accessibility help text for media controller time value &gt;= 1 day */
</span><span class="cx"> &quot;%1$d days %2$d hours %3$d minutes %4$d seconds&quot; = &quot;%1$d days %2$d hours %3$d minutes %4$d seconds&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -67,6 +58,9 @@
</span><span class="cx"> /* Label for PDF page number indicator. */
</span><span class="cx"> &quot;%d of %d&quot; = &quot;%d of %d&quot;;
</span><span class="cx"> 
</span><ins>+/* label next to file upload control; parameters are the number of photos and the number of videos */
+&quot;%lu photo(s) and %lu video(s)&quot; = &quot;%lu photo(s) and %lu video(s)&quot;;
+
</ins><span class="cx"> /* window title for a standalone image (uses multiplication symbol, not x) */
</span><span class="cx"> &quot;%s %d×%d pixels&quot; = &quot;%s %d×%d pixels&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -82,12 +76,6 @@
</span><span class="cx"> /* Present the element &lt;select multiple&gt; when a single &lt;option&gt; is selected (iOS only) */
</span><span class="cx"> &quot;1 Item&quot; = &quot;1 Item&quot;;
</span><span class="cx"> 
</span><del>-/* File Upload single photo label */
-&quot;1 Photo (file upload on page label for one photo)&quot; = &quot;1 Photo&quot;;
-
-/* File Upload single video label */
-&quot;1 Video (file upload on page label for one video)&quot; = &quot;1 Video&quot;;
-
</del><span class="cx"> /* Option in segmented control for choosing list type in text editing */
</span><span class="cx"> &quot;1. 2. 3.&quot; = &quot;1. 2. 3.&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreEnglishlprojLocalizablestringsdict"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/English.lproj/Localizable.stringsdict (214722 => 214723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/English.lproj/Localizable.stringsdict        2017-04-02 01:56:34 UTC (rev 214722)
+++ trunk/Source/WebCore/English.lproj/Localizable.stringsdict        2017-04-02 04:53:39 UTC (rev 214723)
</span><span class="lines">@@ -2,6 +2,61 @@
</span><span class="cx"> &lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
</span><span class="cx"> &lt;plist version=&quot;1.0&quot;&gt;
</span><span class="cx"> &lt;dict&gt;
</span><ins>+        &lt;key&gt;%lu photo(s) and %lu video(s)&lt;/key&gt;
+        &lt;dict&gt;
+                &lt;key&gt;NSStringLocalizedFormatKey&lt;/key&gt;
+                &lt;string&gt;%1$#@photos@&lt;/string&gt;
+                &lt;key&gt;photos&lt;/key&gt;
+                &lt;dict&gt;
+                        &lt;key&gt;NSStringFormatSpecTypeKey&lt;/key&gt;
+                        &lt;string&gt;NSStringPluralRuleType&lt;/string&gt;
+                        &lt;key&gt;NSStringFormatValueTypeKey&lt;/key&gt;
+                        &lt;string&gt;lu&lt;/string&gt;
+                        &lt;key&gt;zero&lt;/key&gt;
+                        &lt;string&gt;%2$#@zeroPhotosVideos@&lt;/string&gt;
+                        &lt;key&gt;one&lt;/key&gt;
+                        &lt;string&gt;%2$#@onePhotoVideos@&lt;/string&gt;
+                        &lt;key&gt;other&lt;/key&gt;
+                        &lt;string&gt;%2$#@otherPhotosVideos@&lt;/string&gt;
+                &lt;/dict&gt;
+                &lt;key&gt;zeroPhotosVideos&lt;/key&gt;
+                &lt;dict&gt;
+                        &lt;key&gt;NSStringFormatSpecTypeKey&lt;/key&gt;
+                        &lt;string&gt;NSStringPluralRuleType&lt;/string&gt;
+                        &lt;key&gt;NSStringFormatValueTypeKey&lt;/key&gt;
+                        &lt;string&gt;lu&lt;/string&gt;
+                        &lt;key&gt;one&lt;/key&gt;
+                        &lt;string&gt;1 video&lt;/string&gt;
+                        &lt;key&gt;other&lt;/key&gt;
+                        &lt;string&gt;%2$lu videos&lt;/string&gt;
+                &lt;/dict&gt;
+                &lt;key&gt;onePhotoVideos&lt;/key&gt;
+                &lt;dict&gt;
+                        &lt;key&gt;NSStringFormatSpecTypeKey&lt;/key&gt;
+                        &lt;string&gt;NSStringPluralRuleType&lt;/string&gt;
+                        &lt;key&gt;NSStringFormatValueTypeKey&lt;/key&gt;
+                        &lt;string&gt;lu&lt;/string&gt;
+                        &lt;key&gt;zero&lt;/key&gt;
+                        &lt;string&gt;1 photo&lt;/string&gt;
+                        &lt;key&gt;one&lt;/key&gt;
+                        &lt;string&gt;1 photo and 1 video&lt;/string&gt;
+                        &lt;key&gt;other&lt;/key&gt;
+                        &lt;string&gt;1 photo and %2$lu videos&lt;/string&gt;
+                &lt;/dict&gt;
+                &lt;key&gt;otherPhotosVideos&lt;/key&gt;
+                &lt;dict&gt;
+                        &lt;key&gt;NSStringFormatSpecTypeKey&lt;/key&gt;
+                        &lt;string&gt;NSStringPluralRuleType&lt;/string&gt;
+                        &lt;key&gt;NSStringFormatValueTypeKey&lt;/key&gt;
+                        &lt;string&gt;lu&lt;/string&gt;
+                        &lt;key&gt;zero&lt;/key&gt;
+                        &lt;string&gt;%1$lu photos&lt;/string&gt;
+                        &lt;key&gt;one&lt;/key&gt;
+                        &lt;string&gt;%1$lu photos and 1 video&lt;/string&gt;
+                        &lt;key&gt;other&lt;/key&gt;
+                        &lt;string&gt;%1$lu photos and %2$lu videos&lt;/string&gt;
+                &lt;/dict&gt;
+        &lt;/dict&gt;
</ins><span class="cx">         &lt;key&gt;Use no more than %d character(s)&lt;/key&gt;
</span><span class="cx">         &lt;dict&gt;
</span><span class="cx">                 &lt;key&gt;NSStringLocalizedFormatKey&lt;/key&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (214722 => 214723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-04-02 01:56:34 UTC (rev 214722)
+++ trunk/Source/WebKit2/ChangeLog        2017-04-02 04:53:39 UTC (rev 214723)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2017-04-01  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [iOS] &lt;input type=file&gt; label should be specified using plural rules
+        https://bugs.webkit.org/show_bug.cgi?id=170388
+
+        Reviewed by Alexey Proskuryakov.
+
+        * UIProcess/ios/forms/WKFileUploadPanel.mm:
+        (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
+          Instead of calling -_displayStringForPhotos:videos:, use
+          +[NSString localizedStringWithFormat:] with the new format string &quot;%lu photo(s) and
+          %lu video(s)&quot; for which there are plural rules.
+        (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.
+
+2017-04-01  Dan Bernstein  &lt;mitz@apple.com&gt;
+
</ins><span class="cx">         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=170385
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosformsWKFileUploadPanelmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm (214722 => 214723)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm        2017-04-02 01:56:34 UTC (rev 214722)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm        2017-04-02 04:53:39 UTC (rev 214723)
</span><span class="lines">@@ -711,7 +711,7 @@
</span><span class="cx"> {
</span><span class="cx">     NSUInteger count = [infos count];
</span><span class="cx">     if (index == count) {
</span><del>-        NSString *displayString = [self _displayStringForPhotos:processedImageCount videos:processedVideoCount];
</del><ins>+        NSString *displayString = (processedImageCount || processedVideoCount) ? [NSString localizedStringWithFormat:WEB_UI_NSSTRING(@&quot;%lu photo(s) and %lu video(s)&quot;, &quot;label next to file upload control; parameters are the number of photos and the number of videos&quot;), (unsigned long)processedImageCount, (unsigned long)processedVideoCount] : nil;
</ins><span class="cx">         successBlock(processedResults, displayString);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -864,69 +864,6 @@
</span><span class="cx">     [self _uploadItemForJPEGRepresentationOfImage:originalImage successBlock:successBlock failureBlock:failureBlock];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (NSString *)_displayStringForPhotos:(NSUInteger)imageCount videos:(NSUInteger)videoCount
-{
-    if (!imageCount &amp;&amp; !videoCount)
-        return nil;
-
-    NSString *title;
-    NSString *countString;
-    NSString *imageString;
-    NSString *videoString;
-    NSUInteger numberOfTypes = 2;
-
-    RetainPtr&lt;NSNumberFormatter&gt; countFormatter = adoptNS([[NSNumberFormatter alloc] init]);
-    [countFormatter setLocale:[NSLocale currentLocale]];
-    [countFormatter setGeneratesDecimalNumbers:YES];
-    [countFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
-
-    // Generate the individual counts for each type.
-    switch (imageCount) {
-    case 0:
-        imageString = nil;
-        --numberOfTypes;
-        break;
-    case 1:
-        imageString = WEB_UI_STRING_KEY(&quot;1 Photo&quot;, &quot;1 Photo (file upload on page label for one photo)&quot;, &quot;File Upload single photo label&quot;);
-        break;
-    default:
-        countString = [countFormatter stringFromNumber:@(imageCount)];
-        imageString = [NSString stringWithFormat:WEB_UI_STRING_KEY(&quot;%@ Photos&quot;, &quot;# Photos (file upload on page label for multiple photos)&quot;, &quot;File Upload multiple photos label&quot;), countString];
-        break;
-    }
-
-    switch (videoCount) {
-    case 0:
-        videoString = nil;
-        --numberOfTypes;
-        break;
-    case 1:
-        videoString = WEB_UI_STRING_KEY(&quot;1 Video&quot;, &quot;1 Video (file upload on page label for one video)&quot;, &quot;File Upload single video label&quot;);
-        break;
-    default:
-        countString = [countFormatter stringFromNumber:@(videoCount)];
-        videoString = [NSString stringWithFormat:WEB_UI_STRING_KEY(&quot;%@ Videos&quot;, &quot;# Videos (file upload on page label for multiple videos)&quot;, &quot;File Upload multiple videos label&quot;), countString];
-        break;
-    }
-
-    // Combine into a single result string if needed.
-    switch (numberOfTypes) {
-    case 2:
-        // FIXME: For localization we should build a complete string. We should have a localized string for each different combination.
-        title = [NSString stringWithFormat:WEB_UI_STRING_KEY(&quot;%@ and %@&quot;, &quot;# Photos and # Videos (file upload on page label for image and videos)&quot;, &quot;File Upload images and videos label&quot;), imageString, videoString];
-        break;
-    case 1:
-        title = imageString ? imageString : videoString;
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        title = nil;
-        break;
-    }
-
-    return [title lowercaseString];
-}
-
</del><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #pragma clang diagnostic pop
</span></span></pre>
</div>
</div>

</body>
</html>