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

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

Issue 20072002: Allow Intl.plural/gender as the top-level, omitting the Intl.message wrapper and the first layer of… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes from review Created 7 years, 5 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/part_of_sample_with_messages.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 6776b10139183cbbe5974f70244952a7e46e9aa3..9bad4b9ecab27139af6285f62dc858b6a9be5c7c 100644
--- a/pkg/intl/test/message_extraction/sample_with_messages.dart
+++ b/pkg/intl/test/message_extraction/sample_with_messages.dart
@@ -68,6 +68,23 @@ noVariables() => Intl.message(someString, name: "noVariables");
// characters that ought to be escaped during code generation.
escapable() => Intl.message("Escapable characters here: ", name: "escapable");
+outerPlural(n) => Intl.plural(n, zero: 'none', one: 'one', other: 'some',
+ name: 'outerPlural', desc: 'A plural with no enclosing message', args: [n]);
+
+outerGender(g) => Intl.gender(g, male: 'm', female: 'f', other: 'o',
+ name: 'outerGender', desc: 'A gender with no enclosing message', args: [g]);
+
+// A standalone gender message where we don't provide name or args. This should
+// be rejected by validation code.
+invalidOuterGender(g) => Intl.gender(g, other: 'o');
+
+// A trivial nested plural/gender where both are done directly rather than
+// in interpolations.
+nestedOuter(number, gen) => Intl.plural(number,
+ other: Intl.gender(gen, male: "$number male", other: "$number other"),
+ name: 'nestedOuter',
+ args: [number, gen]);
+
printStuff(Intl locale) {
// Use a name that's not a literal so this will get skipped. Then we have
@@ -125,6 +142,12 @@ printStuff(Intl locale) {
print(thing.nested([], "magasin"));
print(thing.nested([bob, bob], "magasin"));
print(thing.nested([alice, alice], "magasin"));
+
+ print(outerPlural(0));
+ print(outerPlural(1));
+ print(outerGender("male"));
+ print(outerGender("female"));
+ print(nestedOuter(7, "male"));
});
}
« no previous file with comments | « pkg/intl/test/message_extraction/part_of_sample_with_messages.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698