Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: pkg/intl/tool/generate_locale_data_files.dart

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/intl/lib/src/date_format_field.dart ('k') | pkg/unittest/mock.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 utility program to take locale data represented as a Dart map whose keys 6 * A utility program to take locale data represented as a Dart map whose keys
7 * are locale names and write it into individual JSON files named by locale. 7 * are locale names and write it into individual JSON files named by locale.
8 * This should be run any time the locale data changes. 8 * This should be run any time the locale data changes.
9 * 9 *
10 * The files are written under "data/dates", in two subdirectories, "symbols" 10 * The files are written under "data/dates", in two subdirectories, "symbols"
(...skipping 22 matching lines...) Expand all
33 outputStream.writeString( 33 outputStream.writeString(
34 '// Copyright (c) 2012, the Dart project authors. Please see the ' 34 '// Copyright (c) 2012, the Dart project authors. Please see the '
35 'AUTHORS file\n// for details. All rights reserved. Use of this source' 35 'AUTHORS file\n// for details. All rights reserved. Use of this source'
36 'code is governed by a\n// BSD-style license that can be found in the' 36 'code is governed by a\n// BSD-style license that can be found in the'
37 ' LICENSE file.\n\n' 37 ' LICENSE file.\n\n'
38 '/// Hard-coded list of all available locales for dates.\n'); 38 '/// Hard-coded list of all available locales for dates.\n');
39 outputStream.writeString('final availableLocalesForDateFormatting = const ['); 39 outputStream.writeString('final availableLocalesForDateFormatting = const [');
40 List<String> allLocales = DateFormat.allLocalesWithSymbols(); 40 List<String> allLocales = DateFormat.allLocalesWithSymbols();
41 allLocales.forEach((locale) { 41 allLocales.forEach((locale) {
42 outputStream.writeString('"$locale"'); 42 outputStream.writeString('"$locale"');
43 if (locale == allLocales.last()) { 43 if (locale == allLocales.last) {
44 outputStream.writeString('];'); 44 outputStream.writeString('];');
45 } else { 45 } else {
46 outputStream.writeString(',\n '); 46 outputStream.writeString(',\n ');
47 } 47 }
48 }); 48 });
49 } 49 }
50 50
51 void writeSymbolData() { 51 void writeSymbolData() {
52 dateTimeSymbolMap().forEach( 52 dateTimeSymbolMap().forEach(
53 (locale, symbols) => writeSymbols(locale, symbols)); 53 (locale, symbols) => writeSymbols(locale, symbols));
(...skipping 14 matching lines...) Expand all
68 void writePatterns(locale, patterns) { 68 void writePatterns(locale, patterns) {
69 var file = new File('${dataDirectory}patterns/${locale}.json'); 69 var file = new File('${dataDirectory}patterns/${locale}.json');
70 var outputStream = file.openOutputStream(); 70 var outputStream = file.openOutputStream();
71 outputStream.writeString(JSON.stringify(patterns)); 71 outputStream.writeString(JSON.stringify(patterns));
72 outputStream.close(); 72 outputStream.close();
73 } 73 }
74 74
75 void writeToJSON(Dynamic data, OutputStream out) { 75 void writeToJSON(Dynamic data, OutputStream out) {
76 out.writeString(JSON.stringify(data.serializeToMap())); 76 out.writeString(JSON.stringify(data.serializeToMap()));
77 } 77 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/src/date_format_field.dart ('k') | pkg/unittest/mock.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698