| 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 * A library for general helper code associated with the intl library | 6 * A library for general helper code associated with the intl library |
| 7 * rather than confined to specific parts of it. | 7 * rather than confined to specific parts of it. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 library intl_helpers; | 10 library intl_helpers; |
| 11 import '../date_symbols.dart'; | 11 import '../date_symbols.dart'; |
| 12 | 12 |
| 13 import 'dart:async'; |
| 14 |
| 13 /** | 15 /** |
| 14 * This is used as a marker for a locale data map that hasn't been initialized, | 16 * This is used as a marker for a locale data map that hasn't been initialized, |
| 15 * and will throw an exception on any usage that isn't the fallback | 17 * and will throw an exception on any usage that isn't the fallback |
| 16 * patterns/symbols provided. | 18 * patterns/symbols provided. |
| 17 */ | 19 */ |
| 18 class UninitializedLocaleData<F> { | 20 class UninitializedLocaleData<F> { |
| 19 final String message; | 21 final String message; |
| 20 final F fallbackData; | 22 final F fallbackData; |
| 21 const UninitializedLocaleData(this.message, this.fallbackData); | 23 const UninitializedLocaleData(this.message, this.fallbackData); |
| 22 | 24 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 56 |
| 55 /** | 57 /** |
| 56 * Initialize the message lookup mechanism. This is for internal use only. | 58 * Initialize the message lookup mechanism. This is for internal use only. |
| 57 * User applications should import `message_lookup_local.dart` and call | 59 * User applications should import `message_lookup_local.dart` and call |
| 58 * `initializeMessages` | 60 * `initializeMessages` |
| 59 */ | 61 */ |
| 60 void initializeInternalMessageLookup(Function lookupFunction) { | 62 void initializeInternalMessageLookup(Function lookupFunction) { |
| 61 if (messageLookup is UninitializedLocaleData) { | 63 if (messageLookup is UninitializedLocaleData) { |
| 62 messageLookup = lookupFunction(); | 64 messageLookup = lookupFunction(); |
| 63 } | 65 } |
| 64 } | 66 } |
| OLD | NEW |