| 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 10 matching lines...) Expand all Loading... |
| 21 switch (localeName) { | 21 switch (localeName) { |
| 22 case 'th_TH' : return th_TH.messages; | 22 case 'th_TH' : return th_TH.messages; |
| 23 case 'de' : return de.messages; | 23 case 'de' : return de.messages; |
| 24 default: return null; | 24 default: return null; |
| 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.immediate(null); | 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 if (actualLocale == null) return null; | 36 if (actualLocale == null) return null; |
| 37 return _findExact(actualLocale); | 37 return _findExact(actualLocale); |
| 38 } | 38 } |
| OLD | NEW |