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

Side by Side Diff: pkg/intl/test/message_extraction/sample_with_messages.dart

Issue 414093003: Make deferred loading of message libraries optional (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a new file I had missed Created 6 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 | Annotate | Revision Log
« no previous file with comments | « pkg/intl/test/message_extraction/message_extraction_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * This is a program with various [Intl.message] messages. It just prints 6 * This is a program with various [Intl.message] messages. It just prints
7 * all of them, and is used for testing of message extraction, translation, 7 * all of them, and is used for testing of message extraction, translation,
8 * and code generation. 8 * and code generation.
9 */ 9 */
10 library sample; 10 library sample;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 main() { 221 main() {
222 var fr = new Intl("fr"); 222 var fr = new Intl("fr");
223 var english = new Intl("en_US"); 223 var english = new Intl("en_US");
224 var de = new Intl("de_DE"); 224 var de = new Intl("de_DE");
225 // Throw in an initialize of a null locale to make sure it doesn't throw. 225 // Throw in an initialize of a null locale to make sure it doesn't throw.
226 initializeMessages(null); 226 initializeMessages(null);
227 227
228 // Verify that a translated message isn't initially present. 228 // Verify that a translated message isn't initially present.
229 var messageInGerman = Intl.withLocale('de_DE', message1); 229 var messageInGerman = Intl.withLocale('de_DE', message1);
230 test("Locales don't work before they're initialized", () 230 expect(messageInGerman, "This is a message");
231 => expect(messageInGerman, "This is a message"));
232 231
233 var f1 = initializeMessages(fr.locale) 232 var f1 = initializeMessages(fr.locale)
234 // Since English has the one message which is always translated, we 233 // Since English has the one message which is always translated, we
235 // can't print it until French is ready. 234 // can't print it until French is ready.
236 .then((_) => printStuff(english)) 235 .then((_) => printStuff(english))
237 .then((_) => printStuff(fr)); 236 .then((_) => printStuff(fr));
238 var f2 = initializeMessages('de-de').then((_) => printStuff(de)); 237 var f2 = initializeMessages('de-de').then((_) => printStuff(de));
239 return Future.wait([f1, f2]); 238 return Future.wait([f1, f2]);
240 } 239 }
OLDNEW
« no previous file with comments | « pkg/intl/test/message_extraction/message_extraction_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698