| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file.part of sample; |
| 4 |
| 5 part of sample; |
| 6 |
| 7 class YouveGotMessages { |
| 8 |
| 9 // A static message, rather than a standalone function. |
| 10 static staticMessage() => Intl.message("This comes from a static method", |
| 11 name: 'staticMessage'); |
| 12 |
| 13 // An instance method, rather than a standalone function. |
| 14 method() => Intl.message("This comes from a method", name: 'method'); |
| 15 |
| 16 // A non-lambda, i.e. not using => syntax, and with an additional statement |
| 17 // before the Intl.message call. |
| 18 nonLambda() { |
| 19 // TODO(alanknight): I'm really not sure that this shouldn't be disallowed. |
| 20 var x = 'something'; |
| 21 return Intl.message("This method is not a lambda", name: 'nonLambda'); |
| 22 } |
| 23 |
| 24 // TODO(alanknight): Support plurals and named arguments. |
| 25 // plurals(num) => Intl.message(""" |
| 26 //One of the tricky things is ${Intl.plural(num, |
| 27 // { |
| 28 // '0' : 'the plural form', |
| 29 // '1' : 'the plural form', |
| 30 // 'other' : 'plural forms'})}""", |
| 31 // name: "plurals"); |
| 32 // |
| 33 //namedArgs({thing}) => Intl.message("The thing is, $thing", name: "namedArgs"); |
| 34 } |
| OLD | NEW |