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

Side by Side Diff: test/message_extraction/part_of_sample_with_messages.dart

Issue 1244843002: Allow ClassName_methodName for a message name, easier to disambiguate duplicates (Closed) Base URL: https://github.com/dart-lang/intl.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « test/message_extraction/make_hardcoded_translation.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.part of sample; 3 // BSD-style license that can be found in the LICENSE file.part of sample;
4 4
5 part of sample; 5 part of sample;
6 6
7 class Person { 7 class Person {
8 String name; 8 String name;
9 String gender; 9 String gender;
10 Person(this.name, this.gender); 10 Person(this.name, this.gender);
11 } 11 }
12 12
13 class YouveGotMessages { 13 class YouveGotMessages {
14 14
15 // A static message, rather than a standalone function. 15 // A static message, rather than a standalone function.
16 static staticMessage() => 16 static staticMessage() =>
17 Intl.message("This comes from a static method", name: 'staticMessage'); 17 Intl.message("This comes from a static method", name: 'staticMessage');
18 18
19 // An instance method, rather than a standalone function. 19 // An instance method, rather than a standalone function.
20 method() => Intl.message("This comes from a method", 20 method() => Intl.message("This comes from a method",
21 name: 'method', desc: 'This is a method with a ' 21 name: 'YouveGotMessages_method', desc: 'This is a method with a '
22 'long description which spans ' 22 'long description which spans '
23 'multiple lines.'); 23 'multiple lines.');
24 24
25 // A non-lambda, i.e. not using => syntax, and with an additional statement 25 // A non-lambda, i.e. not using => syntax, and with an additional statement
26 // before the Intl.message call. 26 // before the Intl.message call.
27 nonLambda() { 27 nonLambda() {
28 var aTrueValue = true; 28 var aTrueValue = true;
29 var msg = Intl.message("This method is not a lambda", name: 'nonLambda'); 29 var msg = Intl.message("This method is not a lambda", name: 'nonLambda');
30 expect(aTrueValue, isTrue, 30 expect(aTrueValue, isTrue,
31 reason: 'Parser should not fail with additional code.'); 31 reason: 'Parser should not fail with additional code.');
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 one: "${names} est allé au $place", 67 one: "${names} est allé au $place",
68 other: "${names} sont allés au $place")}', 68 other: "${names} sont allés au $place")}',
69 female: '${Intl.plural(number, 69 female: '${Intl.plural(number,
70 one: "$names est allée au $place", 70 one: "$names est allée au $place",
71 other: "$names sont allées au $place")}' 71 other: "$names sont allées au $place")}'
72 )}''', 72 )}''',
73 name: "nestedMessage", args: [names, number, combinedGender, place]); 73 name: "nestedMessage", args: [names, number, combinedGender, place]);
74 return nestedMessage(names, number, combinedGender, place); 74 return nestedMessage(names, number, combinedGender, place);
75 } 75 }
76 } 76 }
OLDNEW
« no previous file with comments | « test/message_extraction/make_hardcoded_translation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698