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

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

Issue 10952004: Change intl to use new pub layout (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months 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/test/number_format_test.dart ('k') | no next file » | 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
Bob Nystrom 2012/09/18 21:11:23 For consistency's sake, this should be in a "tool"
Alan Knight 2012/09/18 22:02:36 Done.
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"
11 * and "patterns". In "data/dates" it will also generate "localeList.dart", 11 * and "patterns". In "data/dates" it will also generate "localeList.dart",
12 * which is sourced by the date_symbol_data... files. 12 * which is sourced by the date_symbol_data... files.
13 */ 13 */
14 14
15 #import('../date_symbols.dart'); 15 #import('../lib/date_symbols.dart');
16 #import('../date_symbol_data_local.dart'); 16 #import('../lib/date_symbol_data_local.dart');
17 #import('../date_time_patterns.dart'); 17 #import('../lib/date_time_patterns.dart');
18 #import('../date_format.dart'); 18 #import('../lib/date_format.dart');
19 #import('dart:io'); 19 #import('dart:io');
20 #import('dart:json'); 20 #import('dart:json');
21 #import('../test/data_directory.dart'); 21 #import('../test/data_directory.dart');
22 22
23 main() { 23 main() {
24 initializeDateFormatting("en_IGNORED", null); 24 initializeDateFormatting("en_IGNORED", null);
25 writeSymbolData(); 25 writeSymbolData();
26 writePatternData(); 26 writePatternData();
27 // TODO(alanknight): Are the en_ISO patterns reliably the same as general en? 27 // TODO(alanknight): Are the en_ISO patterns reliably the same as general en?
28 writePatterns("en_ISO", dateTimePatternMap()["en"]); 28 writePatterns("en_ISO", dateTimePatternMap()["en"]);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void writePatterns(locale, patterns) { 70 void writePatterns(locale, patterns) {
71 var file = new File('${dataDirectory}patterns/${locale}.json'); 71 var file = new File('${dataDirectory}patterns/${locale}.json');
72 var outputStream = file.openOutputStream(); 72 var outputStream = file.openOutputStream();
73 outputStream.writeString(JSON.stringify(patterns)); 73 outputStream.writeString(JSON.stringify(patterns));
74 outputStream.close(); 74 outputStream.close();
75 } 75 }
76 76
77 void writeToJSON(Dynamic data, OutputStream out) { 77 void writeToJSON(Dynamic data, OutputStream out) {
78 out.writeString(JSON.stringify(data.serializeToMap())); 78 out.writeString(JSON.stringify(data.serializeToMap()));
79 } 79 }
OLDNEW
« no previous file with comments | « pkg/intl/test/number_format_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698