Skip to content

Instantly share code, notes, and snippets.

@BenjaminPoulain
Created February 9, 2012 20:21
Show Gist options
  • Save BenjaminPoulain/1782812 to your computer and use it in GitHub Desktop.
Save BenjaminPoulain/1782812 to your computer and use it in GitHub Desktop.
Index: Source/WebCore/ChangeLog
===================================================================
--- Source/WebCore/ChangeLog (revision 107269)
+++ Source/WebCore/ChangeLog (working copy)
@@ -1,3 +1,16 @@
+2012-02-09 Benjamin Poulain <bpoulain@apple.com>
+
+ 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 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r107035.
Index: Source/WebCore/platform/DefaultLocalizationStrategy.cpp
===================================================================
--- Source/WebCore/platform/DefaultLocalizationStrategy.cpp (revision 107269)
+++ Source/WebCore/platform/DefaultLocalizationStrategy.cpp (working copy)
@@ -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)
Index: Source/WebCore/English.lproj/Localizable.strings
===================================================================
--- Source/WebCore/English.lproj/Localizable.strings (revision 107269)
+++ Source/WebCore/English.lproj/Localizable.strings (working copy)
@@ -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";
+
+/* printf format for multiple items in HTML select (Used only by PLATFORM(IOS) code) */
+"%d Items" = "%d Items";
+
/* Menu item title for KEYGEN pop-up menu */
"1024 (Medium Grade)" = "1024 (Medium Grade)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment