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

Side by Side Diff: pkg/intl/lib/generate_localized.dart

Issue 22284003: pkg: analysis aided cleanup (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nits Created 7 years, 4 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/example/basic/basic_example.dart ('k') | pkg/intl/lib/intl.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 provides utilities for generating localized versions of 6 * This provides utilities for generating localized versions of
7 * messages. It does not stand alone, but expects to be given 7 * messages. It does not stand alone, but expects to be given
8 * TranslatedMessage objects and generate code for a particular locale 8 * TranslatedMessage objects and generate code for a particular locale
9 * based on them. 9 * based on them.
10 * 10 *
11 * An example of usage can be found 11 * An example of usage can be found
12 * in test/message_extract/generate_from_json.dart 12 * in test/message_extract/generate_from_json.dart
13 */ 13 */
14 library generate_localized; 14 library generate_localized;
15 15
16 import 'extract_messages.dart';
17 import 'src/intl_message.dart'; 16 import 'src/intl_message.dart';
18 import 'dart:io'; 17 import 'dart:io';
19 import 'package:path/path.dart' as path; 18 import 'package:path/path.dart' as path;
20 19
21 /** 20 /**
22 * If the import path following package: is something else, modify the 21 * If the import path following package: is something else, modify the
23 * [intlImportPath] variable to change the import directives in the generated 22 * [intlImportPath] variable to change the import directives in the generated
24 * code. 23 * code.
25 */ 24 */
26 var intlImportPath = 'intl'; 25 var intlImportPath = 'intl';
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 messageLookup.addLocale(localeName, _findGeneratedMessagesFor); 203 messageLookup.addLocale(localeName, _findGeneratedMessagesFor);
205 return new Future.value(); 204 return new Future.value();
206 } 205 }
207 206
208 MessageLookupByLibrary _findGeneratedMessagesFor(locale) { 207 MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
209 var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null); 208 var actualLocale = Intl.verifiedLocale(locale, (x) => _findExact(x) != null);
210 if (actualLocale == null) return null; 209 if (actualLocale == null) return null;
211 return _findExact(actualLocale); 210 return _findExact(actualLocale);
212 } 211 }
213 """; 212 """;
OLDNEW
« no previous file with comments | « pkg/intl/example/basic/basic_example.dart ('k') | pkg/intl/lib/intl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698