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

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

Issue 140843002: [Intl] Cleanup some code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 void writeSymbols(locale, symbols) { 63 void writeSymbols(locale, symbols) {
64 var file = new File(path.join(dataDirectory, 'symbols', '${locale}.json')); 64 var file = new File(path.join(dataDirectory, 'symbols', '${locale}.json'));
65 var output = file.openWrite(); 65 var output = file.openWrite();
66 writeToJSON(symbols, output); 66 writeToJSON(symbols, output);
67 output.close(); 67 output.close();
68 } 68 }
69 69
70 void writePatterns(locale, patterns) { 70 void writePatterns(locale, patterns) {
71 var file = new File(path.join(dataDirectory, 'patterns', '${locale}.json')); 71 var file = new File(path.join(dataDirectory, 'patterns', '${locale}.json'));
72 var output = file.openWrite(); 72 file.openWrite()..write(JSON.encode(patterns))..close();
73 output.write(JSON.encode(patterns));
74 output.close();
75 } 73 }
76 74
77 void writeToJSON(dynamic data, IOSink out) { 75 void writeToJSON(dynamic data, IOSink out) {
78 out.write(JSON.encode(data.serializeToMap())); 76 out.write(JSON.encode(data.serializeToMap()));
79 } 77 }
OLDNEW
« pkg/intl/lib/number_format.dart ('K') | « pkg/intl/lib/number_format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698