Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Issue 6736003: This adds a formatter for plurals that works for all locales. (Closed)

Created:
9 years, 9 months ago by Greg Spencer (Chromium)
Modified:
8 years, 5 months ago
CC:
chromium-reviews, Ben Goodger (Google)
Visibility:
Public.

Description

This adds a formatter for plurals that works for all locales. This uses icu to generate plural strings for a given integer when initially set up with a set of six grit message ids. It should vastly simplify creating plurals, at least on the programming side. BUG=none TEST=Ran new unit test.

Patch Set 1 #

Patch Set 2 : Adding example messages and docs #

Patch Set 3 : (upload after rebase) #

Patch Set 4 : Removing bogus DCHECK #

Total comments: 17

Patch Set 5 : Initial review changes #

Total comments: 23

Patch Set 6 : Review changes #

Patch Set 7 : Review changes #

Patch Set 8 : Review changes #

Patch Set 9 : Review changes #

Total comments: 5

Patch Set 10 : upload after rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+741 lines, -0 lines) Patch
M chrome/chrome_common.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/plural_formatter.h View 1 2 3 4 5 1 chunk +105 lines, -0 lines 0 comments Download
A chrome/common/plural_formatter.cc View 1 2 3 4 5 6 7 8 9 1 chunk +179 lines, -0 lines 0 comments Download
A chrome/common/plural_formatter_example.grd View 1 1 chunk +95 lines, -0 lines 0 comments Download
A chrome/common/plural_formatter_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +359 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Greg Spencer (Chromium)
I needed to do a plural string in the UI, and couldn't find any code ...
9 years, 9 months ago (2011-03-24 19:39:37 UTC) #1
Paweł Hajdan Jr.
I'm not familiar enough with ICU to review code, so I'll let Jungshik focus on ...
9 years, 9 months ago (2011-03-25 09:32:17 UTC) #2
Greg Spencer (Chromium)
Thanks for the review, Paweł! http://codereview.chromium.org/6736003/diff/5001/chrome/common/plural_formatter.cc File chrome/common/plural_formatter.cc (right): http://codereview.chromium.org/6736003/diff/5001/chrome/common/plural_formatter.cc#newcode27 chrome/common/plural_formatter.cc:27: } // anonymous namespace ...
9 years, 9 months ago (2011-03-25 23:05:31 UTC) #3
tfarina
As Pawel, I just focused on the public interface and the style things. http://codereview.chromium.org/6736003/diff/8001/chrome/common/plural_formatter.cc File ...
9 years, 9 months ago (2011-03-26 02:05:15 UTC) #4
Paweł Hajdan Jr.
LGTM with comments. http://codereview.chromium.org/6736003/diff/5001/chrome/common/plural_formatter.cc File chrome/common/plural_formatter.cc (right): http://codereview.chromium.org/6736003/diff/5001/chrome/common/plural_formatter.cc#newcode29 chrome/common/plural_formatter.cc:29: class PluralFormatterImpl { On 2011/03/25 23:05:31, ...
9 years, 8 months ago (2011-03-28 18:52:28 UTC) #5
Greg Spencer (Chromium)
Thanks for the drive-by, tfarina! http://codereview.chromium.org/6736003/diff/8001/chrome/common/plural_formatter.cc File chrome/common/plural_formatter.cc (right): http://codereview.chromium.org/6736003/diff/8001/chrome/common/plural_formatter.cc#newcode7 chrome/common/plural_formatter.cc:7: #include <vector> On 2011/03/26 ...
9 years, 8 months ago (2011-03-28 23:13:37 UTC) #6
Greg Spencer (Chromium)
Wow. All those change sets are because the server was returning a 500 when I ...
9 years, 8 months ago (2011-03-29 17:17:56 UTC) #7
tfarina
Hi Greg, what is the status of this change? http://codereview.chromium.org/6736003/diff/17043/chrome/common/plural_formatter.h File chrome/common/plural_formatter.h (right): http://codereview.chromium.org/6736003/diff/17043/chrome/common/plural_formatter.h#newcode67 chrome/common/plural_formatter.h:67: ...
9 years, 8 months ago (2011-04-12 01:25:01 UTC) #8
Greg Spencer (Chromium)
9 years, 8 months ago (2011-04-12 16:11:31 UTC) #9
On 2011/04/12 01:25:01, tfarina wrote:
> Hi Greg, what is the status of this change?

Well... I ran into a road block because jshin wants to have this use the new TC
syntax used in google3 instead of the six separate messages.   It will take some
extra work to make that happen (perhaps even writing a parser), so this change
may be dead in the water, or it may change significantly.

I was writing this because I had a use case for it, and thought I'd do the right
thing and
make a general solution, but I won't have time to work on it for a couple of
weeks,  and there's no pressing need from my side.

Powered by Google App Engine
This is Rietveld 408576698