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

Issue 22286013: Add support for Intl.select (Closed)

Created:
7 years, 4 months ago by Alan Knight
Modified:
7 years, 4 months ago
Reviewers:
Emily Fortuna
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add support for Intl.select Moves some of the validation logic into the appropriate objects, so we can more easily deal with Select, which takes its arguments in a Map, versus Plural/Gender which expect named arguments. R=efortuna@google.com Committed: https://code.google.com/p/dart/source/detail?r=25965

Patch Set 1 #

Total comments: 6

Patch Set 2 : Changes from review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+248 lines, -66 lines) Patch
M pkg/intl/lib/extract_messages.dart View 7 chunks +28 lines, -50 lines 0 comments Download
M pkg/intl/lib/intl.dart View 1 2 chunks +27 lines, -11 lines 0 comments Download
M pkg/intl/lib/src/intl_message.dart View 1 7 chunks +128 lines, -5 lines 0 comments Download
M pkg/intl/test/message_extraction/make_hardcoded_translation.dart View 2 chunks +30 lines, -0 lines 0 comments Download
M pkg/intl/test/message_extraction/message_extraction_test.dart View 3 chunks +12 lines, -0 lines 0 comments Download
M pkg/intl/test/message_extraction/sample_with_messages.dart View 2 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Alan Knight
7 years, 4 months ago (2013-08-08 23:05:13 UTC) #1
Emily Fortuna
lgtm with a few comments. https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/intl.dart File pkg/intl/lib/intl.dart (right): https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/intl.dart#newcode318 pkg/intl/lib/intl.dart:318: Intl.select(choice, cases), indent this ...
7 years, 4 months ago (2013-08-08 23:49:55 UTC) #2
Alan Knight
Committed patchset #2 manually as r25965 (presubmit successful).
7 years, 4 months ago (2013-08-09 17:08:09 UTC) #3
Alan Knight
7 years, 4 months ago (2013-08-09 17:09:16 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/intl.dart
File pkg/intl/lib/intl.dart (right):

https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/intl.dart#newcod...
pkg/intl/lib/intl.dart:318: Intl.select(choice, cases),
On 2013/08/08 23:49:55, Emily Fortuna wrote:
> indent this stuff +2 more spaces.

Done.

https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/src/intl_message...
File pkg/intl/lib/src/intl_message.dart (right):

https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/src/intl_message...
pkg/intl/lib/src/intl_message.dart:588: * Create a new [Select] providing
[mainArgument] and the list of possible
On 2013/08/08 23:49:55, Emily Fortuna wrote:
> what types can mainArgument be since it's not typed in the signature?

It's a String. On the superclass it's typed as a field, and the
super-constructor just has it as this., where convention is to omit the type.
But I'll add it here for clarity.

https://codereview.chromium.org/22286013/diff/1/pkg/intl/lib/src/intl_message...
pkg/intl/lib/src/intl_message.dart:619: Map
argumentsOfInterestFor(MethodInvocation node) {
On 2013/08/08 23:49:55, Emily Fortuna wrote:
> should this actually be private? It seems more like a helper function.

It's somewhat of a helper, but it's a helper for the extract_messages code which
is a separate library, to get the arguments when they might be passed as named
arguments or might be a map, depending on the type of operation. So it's called
externally and can't be private.

Powered by Google App Engine
This is Rietveld 408576698