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

Unified Diff: pkg/intl/lib/src/intl_message.dart

Issue 182443003: Add 'meaning' to Intl.messages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
« no previous file with comments | « pkg/intl/lib/src/intl_helpers.dart ('k') | pkg/intl/test/message_extraction/foo_messages_de_DE.dart » ('j') | 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 b21c0b85812c0ee5472a83c126334befd61e2ca0..0f9ab6983a1c1ba22c8f2ccd850647de1b1b86ba 100644
--- a/pkg/intl/lib/src/intl_message.dart
+++ b/pkg/intl/lib/src/intl_message.dart
@@ -332,6 +332,13 @@ class MainMessage extends ComplexMessage {
Map<String, dynamic> examples;
/**
+ * A field to disambiguate two messages that might have exactly the
+ * same text. The two messages will also need different names, but
+ * this can be used by machine translation tools to distinguish them.
+ */
+ String meaning;
+
+ /**
* The name, which may come from the function name, from the arguments
* to Intl.message, or we may just re-use the message.
*/
@@ -409,6 +416,7 @@ class MainMessage extends ComplexMessage {
// We use the actual args from the parser rather than what's given in the
// arguments to Intl.message.
case "args" : return;
+ case "meaning" : meaning = value; return;
default: return;
}
}
@@ -425,6 +433,7 @@ class MainMessage extends ComplexMessage {
// We use the actual args from the parser rather than what's given in the
// arguments to Intl.message.
case "args" : return [];
+ case "meaning" : return meaning;
default: return null;
}
}
@@ -435,7 +444,7 @@ class MainMessage extends ComplexMessage {
get dartMessageName => "message";
/** The parameters that the Intl.message call may provide. */
- get attributeNames => const ["name", "desc", "examples", "args"];
+ get attributeNames => const ["name", "desc", "examples", "args", "meaning"];
String toString() =>
"Intl.message(${expanded()}, $name, $description, $examples, $arguments)";
« no previous file with comments | « pkg/intl/lib/src/intl_helpers.dart ('k') | pkg/intl/test/message_extraction/foo_messages_de_DE.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698