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

Side by Side Diff: packages/intl/example/basic/messages_all.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * This imports all of the different message libraries and provides an
7 * [initializeMessages] function that sets up the lookup for a particular
8 * library.
9 */
10 library messages_all;
11
12 import 'dart:async';
13 import 'package:intl/message_lookup_by_library.dart';
14 import 'package:intl/src/intl_helpers.dart';
15 import 'messages_th_th.dart' as th_TH;
16 import 'messages_de.dart' as de;
17 import 'package:intl/intl.dart';
18
19 // TODO(alanknight): Use lazy loading of the requested library.
20 MessageLookupByLibrary _findExact(localeName) {
21 switch (localeName) {
22 case 'th_TH':
23 return th_TH.messages;
24 case 'de':
25 return de.messages;
26 default:
27 return null;
28 }
29 }
30
31 initializeMessages(localeName) {
32 initializeInternalMessageLookup(() => new CompositeMessageLookup());
33 messageLookup.addLocale(localeName, _findGeneratedMessagesFor);
34 return new Future.value();
35 }
36
37 MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
38 var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null,
39 onFailure: (_) => null);
40 if (actualLocale == null) return null;
41 return _findExact(actualLocale);
42 }
OLDNEW
« no previous file with comments | « packages/intl/example/basic/basic_example_runner.dart ('k') | packages/intl/example/basic/messages_de.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698