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

Side by Side Diff: pkg/intl/lib/src/intl_message.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/lib/intl.dart ('k') | pkg/intl/pubspec.yaml » ('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 provides classes to represent the internal structure of the 6 * This provides classes to represent the internal structure of the
7 * arguments to `Intl.message`. It is used when parsing sources to extract 7 * arguments to `Intl.message`. It is used when parsing sources to extract
8 * messages or to generate code for message substitution. Normal programs 8 * messages or to generate code for message substitution. Normal programs
9 * using Intl would not import this library. 9 * using Intl would not import this library.
10 * 10 *
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 void addPieces(List<Message> messages) { 316 void addPieces(List<Message> messages) {
317 for (var each in messages) { 317 for (var each in messages) {
318 messagePieces.add(Message.from(each, this)); 318 messagePieces.add(Message.from(each, this));
319 } 319 }
320 } 320 }
321 321
322 /** The description provided in the Intl.message call. */ 322 /** The description provided in the Intl.message call. */
323 String description; 323 String description;
324 324
325 /** The examples from the Intl.message call */ 325 /** The examples from the Intl.message call */
326 String examples; 326 Map<String, dynamic> examples;
327 327
328 /** 328 /**
329 * The name, which may come from the function name, from the arguments 329 * The name, which may come from the function name, from the arguments
330 * to Intl.message, or we may just re-use the message. 330 * to Intl.message, or we may just re-use the message.
331 */ 331 */
332 String _name; 332 String _name;
333 333
334 /** 334 /**
335 * A placeholder for any other identifier that the translation format 335 * A placeholder for any other identifier that the translation format
336 * may want to use. 336 * may want to use.
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 out.write('('); 669 out.write('(');
670 out.write(mainArgument); 670 out.write(mainArgument);
671 var args = codeAttributeNames; 671 var args = codeAttributeNames;
672 out.write(", {"); 672 out.write(", {");
673 args.fold(out, (buffer, arg) => buffer..write( 673 args.fold(out, (buffer, arg) => buffer..write(
674 "'$arg': '${this[arg].toCode()}', ")); 674 "'$arg': '${this[arg].toCode()}', "));
675 out.write("})}"); 675 out.write("})}");
676 return out.toString(); 676 return out.toString();
677 } 677 }
678 } 678 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/intl.dart ('k') | pkg/intl/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698