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

Issue 10915215: Add async initialization for Intl.message and an example (Closed)

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

Description

Add async initialization for Intl.message and an example Committed: https://code.google.com/p/dart/source/detail?r=12345

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 36

Patch Set 6 : #

Total comments: 4

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -139 lines) Patch
A pkg/intl/example/basic/basic_example.dart View 1 2 3 4 5 6 1 chunk +68 lines, -0 lines 0 comments Download
A pkg/intl/example/basic/basic_example_runner.dart View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
A pkg/intl/example/basic/messages_all.dart View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
A pkg/intl/example/basic/messages_de_de.dart View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A pkg/intl/example/basic/messages_th_th.dart View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
A pkg/intl/example/basic/pubspec.yaml View 1 chunk +9 lines, -0 lines 0 comments Download
M pkg/intl/intl.dart View 1 2 3 4 5 6 7 8 6 chunks +48 lines, -20 lines 0 comments Download
D pkg/intl/intl_message.dart View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -76 lines 0 comments Download
M pkg/intl/lib/lazy_locale_data.dart View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
A + pkg/intl/message_lookup_local.dart View 1 2 3 4 5 6 2 chunks +85 lines, -31 lines 0 comments Download
M pkg/intl/test/intl_message_test.dart View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -2 lines 0 comments Download
M pkg/intl/test/intl_test.dart View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -3 lines 0 comments Download
M pkg/pkg.status View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -6 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Alan Knight
This adds async initialization for internationalizable messages, and implements the local strategy in which they ...
8 years, 3 months ago (2012-09-11 22:50:06 UTC) #1
Emily Fortuna
https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/basic/basic_example.dart File pkg/intl/example/basic/basic_example.dart (right): https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/basic/basic_example.dart#newcode20 pkg/intl/example/basic/basic_example.dart:20: // a separate package. why not use package:intl references ...
8 years, 3 months ago (2012-09-12 01:23:48 UTC) #2
Alan Knight
PTAL https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/basic/basic_example.dart File pkg/intl/example/basic/basic_example.dart (right): https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/basic/basic_example.dart#newcode20 pkg/intl/example/basic/basic_example.dart:20: // a separate package. On 2012/09/12 01:23:48, Emily ...
8 years, 3 months ago (2012-09-12 20:58:20 UTC) #3
Emily Fortuna
lgtm, with a few additional edits. https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/basic/basic_example.dart File pkg/intl/example/basic/basic_example.dart (right): https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/basic/basic_example.dart#newcode20 pkg/intl/example/basic/basic_example.dart:20: // a separate ...
8 years, 3 months ago (2012-09-12 21:55:59 UTC) #4
Alan Knight
8 years, 3 months ago (2012-09-13 18:20:08 UTC) #5
https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/ba...
File pkg/intl/example/basic/basic_example.dart (right):

https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/ba...
pkg/intl/example/basic/basic_example.dart:20: // a separate package.
On 2012/09/12 21:55:59, Emily Fortuna wrote:
> On 2012/09/12 20:58:20, Alan Knight wrote:
> > On 2012/09/12 01:23:48, Emily Fortuna wrote:
> > > why not use package:intl references here too to set a complete example?
> > 
> > Sadly, I had them, but took them out because I set it up to be used in a
test,
> > rather than duplicating the logic to write a test, and the buildbots aren't
> > going to understand pub until post-M1.
> 
> Ah. Fair enough. Can we add a TODO?

Done.

https://chromiumcodereview.appspot.com/10915215/diff/8001/pkg/intl/example/ba...
pkg/intl/example/basic/basic_example.dart:47: runProgram(_) {
On 2012/09/12 21:55:59, Emily Fortuna wrote:
> On 2012/09/12 20:58:20, Alan Knight wrote:
> > On 2012/09/12 01:23:48, Emily Fortuna wrote:
> > > I don't quite understand why you're passed a collection of futures. In
> > > intl_message_test_using_example.dart it looks like you're just passing in
> the
> > > print function(?) Maybe I'm mis-reading this.
> > > 
> > > If you're going to pass a not used argument, I'd still give the _ a type,
> and
> > > maybe call it "notUsed" (_ is also an okay name, though)
> > 
> > runProgram is called in the "then" call from Futures.wait on locale
> > initialization, so it gets the result, which is a collection of the Futures
> that
> > were waited on. 
> > 
> > The call from the test was wrong, and didn't get caught because the name
> didn't
> > end in _test, so it wasn't run. Fixed.
> > 
> > I liked the _ convention without a type because it made the thing visually
> > minimal, making it easy to ignore. But I put in a type.
> 
> Fair enough. I'm convinced. Feel free to disregard my suggestion then.

Done :-)

https://chromiumcodereview.appspot.com/10915215/diff/6015/pkg/intl/intl.dart
File pkg/intl/intl.dart (right):

https://chromiumcodereview.appspot.com/10915215/diff/6015/pkg/intl/intl.dart#...
pkg/intl/intl.dart:101: static String verifiedLocale(String newLocale) {
On 2012/09/12 21:55:59, Emily Fortuna wrote:
> looks like this method is no longer being used (used to be used in the
> constructor.) Shouldn't we call it from the constructor?
It's used by DateFormat, because it uses the set of locales that have date
formats, which doesn't make sense to use generally, as the set might be quite
different for locales. Added a TODO to move, rename, or generalize it. There's
another TODO to add similar functionality for messages, at which point it might
be easier to see how to generalize it.

https://chromiumcodereview.appspot.com/10915215/diff/6015/pkg/intl/message_lo...
File pkg/intl/message_lookup_local.dart (right):

https://chromiumcodereview.appspot.com/10915215/diff/6015/pkg/intl/message_lo...
pkg/intl/message_lookup_local.dart:118: LibraryMirror messagesForThisLocale =
_libraries['$_sourcePrefix$actualLocale'];
On 2012/09/12 21:55:59, Emily Fortuna wrote:
> 80 char alert :-P

Done.

Powered by Google App Engine
This is Rietveld 408576698