| OLD | NEW |
| 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() => Intl.message("This comes from a static method", | 16 static staticMessage() => Intl.message("This comes from a static method", |
| 17 name: 'staticMessage'); | 17 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", name: 'method'); | 20 method() => Intl.message("This comes from a method", name: 'method', |
| 21 desc: 'This is a method with a ' |
| 22 'long description which spans ' |
| 23 'multiple lines.'); |
| 21 | 24 |
| 22 // 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 |
| 23 // before the Intl.message call. | 26 // before the Intl.message call. |
| 24 nonLambda() { | 27 nonLambda() { |
| 25 // TODO(alanknight): I'm really not sure that this shouldn't be disallowed. | 28 // TODO(alanknight): I'm really not sure that this shouldn't be disallowed. |
| 26 var x = 'something'; | 29 var x = 'something'; |
| 27 return Intl.message("This method is not a lambda", name: 'nonLambda'); | 30 return Intl.message("This method is not a lambda", name: 'nonLambda'); |
| 28 } | 31 } |
| 29 | 32 |
| 30 plurals(num) => Intl.message("""${Intl.plural(num, | 33 plurals(num) => Intl.message("""${Intl.plural(num, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 other: "${names} sont allés au $place")}', | 69 other: "${names} sont allés au $place")}', |
| 67 female: '${Intl.plural(number, | 70 female: '${Intl.plural(number, |
| 68 one: "$names est allée au $place", | 71 one: "$names est allée au $place", |
| 69 other: "$names sont allées au $place")}' | 72 other: "$names sont allées au $place")}' |
| 70 )}''', | 73 )}''', |
| 71 name: "nestedMessage", | 74 name: "nestedMessage", |
| 72 args: [names, number, combinedGender, place]); | 75 args: [names, number, combinedGender, place]); |
| 73 return nestedMessage(names, number, combinedGender, place); | 76 return nestedMessage(names, number, combinedGender, place); |
| 74 } | 77 } |
| 75 } | 78 } |
| OLD | NEW |