Chromium Code Reviews| 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 static staticMessage() => Intl.message("This comes from a static method", | |
| 9 name: 'staticMessage'); | |
| 10 | |
| 11 method() => Intl.message("This comes from a method", name: 'method'); | |
| 12 | |
| 13 nonLambda() { | |
| 14 // TODO(alanknight): I'm really not sure that this shouldn't be disallowed. | |
| 15 var x = 'something'; | |
| 16 return Intl.message("This method is not a lambda", name: 'nonLambda'); | |
|
Emily Fortuna
2013/03/13 18:54:43
What's trying to be tested here?
Alan Knight
2013/03/14 17:49:05
The parser recognizing and properly extracting a m
Emily Fortuna
2013/03/14 19:45:00
gotcha!
| |
| 17 } | |
| 18 | |
| 19 // TODO(alanknight): Support plurals and named arguments. | |
| 20 // plurals(num) => Intl.message(""" | |
| 21 //One of the tricky things is ${Intl.plural(num, | |
| 22 // { | |
| 23 // '0' : 'the plural form', | |
| 24 // '1' : 'the plural form', | |
| 25 // 'other' : 'plural forms'})}""", | |
| 26 // name: "plurals"); | |
| 27 // | |
| 28 //namedArgs({thing}) => Intl.message("The thing is, $thing", name: "namedArgs"); | |
| 29 } | |
| OLD | NEW |