Title: [107288] trunk/Source/WebCore
Revision
107288
Author
[email protected]
Date
2012-02-09 13:47:58 -0800 (Thu, 09 Feb 2012)

Log Message

The localization of htmlSelectMultipleItems() needs better support of pluralization
https://bugs.webkit.org/show_bug.cgi?id=78197

Patch by Benjamin Poulain <[email protected]> on 2012-02-09
Reviewed by Joseph Pecoraro.

For translation, the localization of 0 and 1 depends on the language.

* English.lproj/Localizable.strings:
* platform/DefaultLocalizationStrategy.cpp:
(WebCore::DefaultLocalizationStrategy::htmlSelectMultipleItems):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107287 => 107288)


--- trunk/Source/WebCore/ChangeLog	2012-02-09 21:40:03 UTC (rev 107287)
+++ trunk/Source/WebCore/ChangeLog	2012-02-09 21:47:58 UTC (rev 107288)
@@ -1,3 +1,16 @@
+2012-02-09  Benjamin Poulain  <[email protected]>
+
+        The localization of htmlSelectMultipleItems() needs better support of pluralization
+        https://bugs.webkit.org/show_bug.cgi?id=78197
+
+        Reviewed by Joseph Pecoraro.
+
+        For translation, the localization of 0 and 1 depends on the language.
+
+        * English.lproj/Localizable.strings:
+        * platform/DefaultLocalizationStrategy.cpp:
+        (WebCore::DefaultLocalizationStrategy::htmlSelectMultipleItems):
+
 2012-02-09  Anders Carlsson  <[email protected]>
 
         ScrollingTreeNodeMac should implement ScrollElasticityController

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (107287 => 107288)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2012-02-09 21:40:03 UTC (rev 107287)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2012-02-09 21:47:58 UTC (rev 107288)
@@ -25,6 +25,15 @@
 /* Label to describe the number of files selected in a file upload control that allows multiple files */
 "%d files" = "%d files";
 
+/* Present the element <select multiple> when no <option> items are selected (iOS only) */
+"0 Items" = "0 Items";
+
+/* Present the element <select multiple> when a single <option> is selected (iOS only) */
+"1 Item" = "1 Item";
+
+/* Present the number of selected <option> items in a <select multiple> element (iOS only) */
+"%d Items" = "%d Items";
+
 /* Menu item title for KEYGEN pop-up menu */
 "1024 (Medium Grade)" = "1024 (Medium Grade)";
 

Modified: trunk/Source/WebCore/platform/DefaultLocalizationStrategy.cpp (107287 => 107288)


--- trunk/Source/WebCore/platform/DefaultLocalizationStrategy.cpp	2012-02-09 21:40:03 UTC (rev 107287)
+++ trunk/Source/WebCore/platform/DefaultLocalizationStrategy.cpp	2012-02-09 21:47:58 UTC (rev 107288)
@@ -770,7 +770,14 @@
 #if PLATFORM(IOS)
 String DefaultLocalizationStrategy::htmlSelectMultipleItems(int count)
 {
-    return formatLocalizedString(WEB_UI_STRING("%d Items", "Present the number of selected <option> items in a <select multiple> element (iOS only)"), count);
+    switch (count) {
+    case 0:
+        return WEB_UI_STRING("0 Items", "Present the element <select multiple> when no <option> items are selected (iOS only)");
+    case 1:
+        return WEB_UI_STRING("1 Item", "Present the element <select multiple> when a single <option> is selected (iOS only)");
+    default:
+        return formatLocalizedString(WEB_UI_STRING("%d Items", "Present the number of selected <option> items in a <select multiple> element (iOS only)"), count);
+    }
 }
 #endif // PLATFORM(IOS)
 #endif // PLATFORM(MAC)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to