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 file should be imported, along with date_format.dart in order to read | 6 * This file should be imported, along with date_format.dart in order to read |
7 * locale data from files in the file system. | 7 * locale data from files in the file system. |
8 */ | 8 */ |
9 | 9 |
10 library date_symbol_data_json; | 10 library date_symbol_data_json; |
(...skipping 15 matching lines...) Expand all Loading... |
26 */ | 26 */ |
27 Future initializeDateFormatting(String locale, String path) { | 27 Future initializeDateFormatting(String locale, String path) { |
28 var reader = new FileDataReader('${path}symbols${Platform.pathSeparator}'); | 28 var reader = new FileDataReader('${path}symbols${Platform.pathSeparator}'); |
29 initializeDateSymbols(() => new LazyLocaleData( | 29 initializeDateSymbols(() => new LazyLocaleData( |
30 reader, _createDateSymbol, availableLocalesForDateFormatting)); | 30 reader, _createDateSymbol, availableLocalesForDateFormatting)); |
31 var reader2 = new FileDataReader('${path}patterns${Platform.pathSeparator}'); | 31 var reader2 = new FileDataReader('${path}patterns${Platform.pathSeparator}'); |
32 initializeDatePatterns(() => new LazyLocaleData( | 32 initializeDatePatterns(() => new LazyLocaleData( |
33 reader2, (x) => x, availableLocalesForDateFormatting)); | 33 reader2, (x) => x, availableLocalesForDateFormatting)); |
34 return initializeIndividualLocaleDateFormatting( | 34 return initializeIndividualLocaleDateFormatting( |
35 (symbols, patterns) { | 35 (symbols, patterns) { |
36 return Futures.wait([ | 36 return Future.wait([ |
37 symbols.initLocale(locale), | 37 symbols.initLocale(locale), |
38 patterns.initLocale(locale)]); | 38 patterns.initLocale(locale)]); |
39 }); | 39 }); |
40 } | 40 } |
41 | 41 |
42 /** Defines how new date symbol entries are created. */ | 42 /** Defines how new date symbol entries are created. */ |
43 DateSymbols _createDateSymbol(Map map) { | 43 DateSymbols _createDateSymbol(Map map) { |
44 return new DateSymbols.deserializeFromMap(map); | 44 return new DateSymbols.deserializeFromMap(map); |
45 } | 45 } |
OLD | NEW |