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

Unified Diff: pkg/intl/test/message_extraction/sample_with_messages.dart

Issue 22286013: Add support for Intl.select (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes from review Created 7 years, 4 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/test/message_extraction/message_extraction_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/test/message_extraction/sample_with_messages.dart
diff --git a/pkg/intl/test/message_extraction/sample_with_messages.dart b/pkg/intl/test/message_extraction/sample_with_messages.dart
index 262f2f6cf4e897330cb0dddd802ee809020f2546..292273c4d0bcaa406e33a1be7da88afe273b845d 100644
--- a/pkg/intl/test/message_extraction/sample_with_messages.dart
+++ b/pkg/intl/test/message_extraction/sample_with_messages.dart
@@ -75,6 +75,25 @@ outerGender(g) => Intl.gender(g, male: 'm', female: 'f', other: 'o',
// be rejected by validation code.
invalidOuterGender(g) => Intl.gender(g, other: 'o');
+// A general select
+outerSelect(currency, amount) => Intl.select(currency,
+ {
+ "CDN" : "$amount Canadian dollars",
+ "other" : "$amount some currency or other."
+ },
+ name: "outerSelect",
+ args: [currency, amount]);
+
+// A select with a plural inside the expressions.
+nestedSelect(currency, amount) => Intl.select(currency,
+ {
+ "CDN" : """${Intl.plural(amount, one: '$amount Canadian dollar',
+ other: '$amount Canadian dollars')}""",
+ "other" : "Whatever",
+ },
+ name: "nestedSelect",
+ args: [currency, amount]);
+
// A trivial nested plural/gender where both are done directly rather than
// in interpolations.
nestedOuter(number, gen) => Intl.plural(number,
@@ -146,6 +165,10 @@ printStuff(Intl locale) {
print(outerGender("male"));
print(outerGender("female"));
print(nestedOuter(7, "male"));
+ print(outerSelect("CDN", 7));
+ print(outerSelect("EUR", 5));
+ print(nestedSelect("CDN", 1));
+ print(nestedSelect("CDN", 2));
});
}
« no previous file with comments | « pkg/intl/test/message_extraction/message_extraction_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698