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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
« pkg/intl/lib/intl.dart ('K') | « pkg/intl/lib/intl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/src/intl_message.dart
diff --git a/pkg/intl/lib/src/intl_message.dart b/pkg/intl/lib/src/intl_message.dart
index 13aad6248562b233564c31adb0dabd00b05b121f..c3ea2d1c407a51777555ca43e311b21a3d7a7343 100644
--- a/pkg/intl/lib/src/intl_message.dart
+++ b/pkg/intl/lib/src/intl_message.dart
@@ -34,6 +34,7 @@
library intl_message;
import 'package:analyzer/analyzer.dart';
+import 'package:json/json.dart' as json;
/** A default function for the [Message.expanded] method. */
_nullTransform(msg, chunk) => chunk;
@@ -315,7 +316,15 @@ class MainMessage extends ComplexMessage {
String description;
/** The examples from the Intl.message call */
- String examples;
+ Map<String, dynamic> get examples => _examples;
+ void set examples(x) {
+ var map = json.parse(x);
+ for (var key in map.keys.toList()) {
+ map[key.toUpperCase()] = map[key];
+ }
+ }
+
+ Map<String, dynamic> _examples = const {};
/**
* The name, which may come from the function name, from the arguments
« pkg/intl/lib/intl.dart ('K') | « pkg/intl/lib/intl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698