Bug 78197

Summary: The localization of htmlSelectMultipleItems() needs better support of pluralization
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: WebKit Misc.Assignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, joepeck
Priority: P2 Keywords: EasyFix, InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch joepeck: review+

Description Benjamin Poulain 2012-02-08 19:41:55 PST
The pluralization of 0 and 1 depends on the language.
Comment 1 Benjamin Poulain 2012-02-08 19:58:08 PST
Created attachment 126228 [details]
Patch
Comment 2 Joseph Pecoraro 2012-02-08 21:22:01 PST
Comment on attachment 126228 [details]
Patch

Can we ASSERT(count > 0) or even better convert its type to be unsigned [and then the localization to be %u]?

Likewise we could change the WEB_UI_STRING description string to be slightly different for 0 items and 1 items.
In the 0 case its a presentation string when there are no selected options, and the 1 is for just 1 selected option,
in a <select multiple>.
Comment 3 Benjamin Poulain 2012-02-08 22:46:23 PST
(In reply to comment #2)
> (From update of attachment 126228 [details])
> Can we ASSERT(count > 0) or even better convert its type to be unsigned [and then the localization to be %u]?

That is a good point, there is really no reason to use an int here. I will make a separate patch for that to avoid messing up our stuff too much.
Comment 4 Alexey Proskuryakov 2012-02-09 10:22:54 PST
It's not just 0 and 1 that are language dependent. For example, 20 and 21 need different noun forms in Russian. I believe that there are lots of other cases like this.

Is there a Radar bug tracking this issue? If there is one, please post its number in a comment, add it to ChangeLog, and add InRadar keyword.
Comment 5 Benjamin Poulain 2012-02-09 13:48:19 PST
Committed r107288: <http://trac.webkit.org/changeset/107288>
Comment 6 Benjamin Poulain 2012-02-09 13:54:24 PST
<rdar://problem/10814922>