| Index: pkg/intl/test/message_extraction/extract_to_json.dart
|
| diff --git a/pkg/intl/test/message_extraction/extract_to_json.dart b/pkg/intl/test/message_extraction/extract_to_json.dart
|
| index ce5c907704f8ff188469c7757f1134231384dd96..fd601804c67b8a2a2f3d0511eddc90aa546f1a97 100644
|
| --- a/pkg/intl/test/message_extraction/extract_to_json.dart
|
| +++ b/pkg/intl/test/message_extraction/extract_to_json.dart
|
| @@ -57,18 +57,20 @@ main() {
|
| * store it to the file in Dart interpolation syntax, so the transformation
|
| * is trivial.
|
| */
|
| -String leaveTheInterpolationsInDartForm(IntlMessage msg, chunk) =>
|
| - (chunk is String) ? chunk : "\$${msg.arguments[chunk]}";
|
| +String leaveTheInterpolationsInDartForm(MainMessage msg, chunk) {
|
| + if (chunk is String) return chunk;
|
| + if (chunk is int) return "\$${msg.arguments[chunk]}";
|
| + return chunk.toCode();
|
| +}
|
|
|
| /**
|
| - * Convert the [IntlMessage] to a trivial JSON format.
|
| + * Convert the [MainMessage] to a trivial JSON format.
|
| */
|
| -Map toJson(IntlMessage message) {
|
| - return {
|
| - "name" : message.name,
|
| - "description" : message.description,
|
| - "message" : message.fullMessage(leaveTheInterpolationsInDartForm),
|
| - "examples" : message.examples,
|
| - "arguments" : message.arguments
|
| - };
|
| +Map toJson(MainMessage message) {
|
| + var result = new Map<String, Object>();
|
| + for (var attribute in message.attributeNames) {
|
| + result[attribute] = message[attribute];
|
| + }
|
| + result["message"] = message.expanded(leaveTheInterpolationsInDartForm);
|
| + return result;
|
| }
|
|
|