| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * This provides a basic example of internationalization usage. It uses the | 6 * This provides a basic example of internationalization usage. It uses the |
| 7 * local variant of all the facilities, meaning that libraries with the | 7 * local variant of all the facilities, meaning that libraries with the |
| 8 * data for all the locales are directly imported by the program. Once lazy | 8 * data for all the locales are directly imported by the program. Once lazy |
| 9 * loading is available, we expect this to be the preferred mode, with | 9 * loading is available, we expect this to be the preferred mode, with |
| 10 * the initialization code actually loading the specific libraries needed. | 10 * the initialization code actually loading the specific libraries needed. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Example making use of the return value from withLocale; | 62 // Example making use of the return value from withLocale; |
| 63 var returnValue = Intl.withLocale(th.locale, () => runAt('now', 'today')); | 63 var returnValue = Intl.withLocale(th.locale, () => runAt('now', 'today')); |
| 64 doThisWithTheOutput(returnValue); | 64 doThisWithTheOutput(returnValue); |
| 65 } | 65 } |
| 66 | 66 |
| 67 printForLocale(aDate, intl, operation) { | 67 printForLocale(aDate, intl, operation) { |
| 68 var hmsFormat = intl.date().add_Hms(); | 68 var hmsFormat = intl.date().add_Hms(); |
| 69 var dayFormat = intl.date().add_yMMMMEEEEd(); | 69 var dayFormat = intl.date().add_yMMMMEEEEd(); |
| 70 var time = hmsFormat.format(aDate); | 70 var time = hmsFormat.format(aDate); |
| 71 var day = dayFormat.format(aDate); | 71 var day = dayFormat.format(aDate); |
| 72 Intl.withLocale(intl.locale, () => doThisWithTheOutput(operation(time,day))); | 72 Intl.withLocale(intl.locale, () => doThisWithTheOutput(operation(time, day))); |
| 73 } | 73 } |
| OLD | NEW |