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

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

Issue 132963002: Read Intl.message examples argument as a map, not a string (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks for the test framework Created 6 years, 11 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/make_hardcoded_translation.dart ('k') | pkg/pkg.status » ('j') | 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;
11 11
12 import "package:intl/intl.dart"; 12 import "package:intl/intl.dart";
13 import "foo_messages_all.dart"; 13 import "foo_messages_all.dart";
14 import "print_to_list.dart"; 14 import "print_to_list.dart";
15 import "dart:async"; 15 import "dart:async";
16 16
17 part 'part_of_sample_with_messages.dart'; 17 part 'part_of_sample_with_messages.dart';
18 18
19 message1() => Intl.message("This is a message", name: 'message1', desc: 'foo' ); 19 message1() => Intl.message("This is a message", name: 'message1', desc: 'foo' );
20 20
21 message2(x) => Intl.message("Another message with parameter $x", 21 message2(x) => Intl.message("Another message with parameter $x",
22 name: 'message2', desc: 'Description 2', args: [x]); 22 name: 'message2', desc: 'Description 2', args: [x], examples: {'x' : 3});
23 23
24 // A string with multiple adjacent strings concatenated together, verify 24 // A string with multiple adjacent strings concatenated together, verify
25 // that the parser handles this properly. 25 // that the parser handles this properly.
26 multiLine() => Intl.message("This " 26 multiLine() => Intl.message("This "
27 "string " 27 "string "
28 "extends " 28 "extends "
29 "across " 29 "across "
30 "multiple " 30 "multiple "
31 "lines.", 31 "lines.",
32 name: "multiLine"); 32 name: "multiLine");
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 var fr = new Intl("fr"); 180 var fr = new Intl("fr");
181 var english = new Intl("en_US"); 181 var english = new Intl("en_US");
182 var de = new Intl("de_DE"); 182 var de = new Intl("de_DE");
183 // Throw in an initialize of a null locale to make sure it doesn't throw. 183 // Throw in an initialize of a null locale to make sure it doesn't throw.
184 initializeMessages(null); 184 initializeMessages(null);
185 var f1 = initializeMessages(fr.locale).then((_) => printStuff(fr)); 185 var f1 = initializeMessages(fr.locale).then((_) => printStuff(fr));
186 var f2 = initializeMessages(de.locale).then((_) => printStuff(de)); 186 var f2 = initializeMessages(de.locale).then((_) => printStuff(de));
187 printStuff(english); 187 printStuff(english);
188 return Future.wait([f1, f2]); 188 return Future.wait([f1, f2]);
189 } 189 }
OLDNEW
« no previous file with comments | « pkg/intl/test/message_extraction/make_hardcoded_translation.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698