| 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 imports all of the different message libraries and provides an | 6 * This imports all of the different message libraries and provides an |
| 7 * [initializeMessages] function that sets up the lookup for a particular | 7 * [initializeMessages] function that sets up the lookup for a particular |
| 8 * library. | 8 * library. |
| 9 */ | 9 */ |
| 10 library messages_all; | 10 library messages_all; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 | 27 |
| 28 initializeMessages(localeName) { | 28 initializeMessages(localeName) { |
| 29 initializeInternalMessageLookup(() => new CompositeMessageLookup()); | 29 initializeInternalMessageLookup(() => new CompositeMessageLookup()); |
| 30 messageLookup.addLocale(localeName, _findGeneratedMessagesFor); | 30 messageLookup.addLocale(localeName, _findGeneratedMessagesFor); |
| 31 return new Future.value(); | 31 return new Future.value(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 MessageLookupByLibrary _findGeneratedMessagesFor(locale) { | 34 MessageLookupByLibrary _findGeneratedMessagesFor(locale) { |
| 35 var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null); | 35 var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null, |
| 36 onFailure: (_) => null); |
| 36 if (actualLocale == null) return null; | 37 if (actualLocale == null) return null; |
| 37 return _findExact(actualLocale); | 38 return _findExact(actualLocale); |
| 38 } | 39 } |
| OLD | NEW |