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

Side by Side Diff: pkg/intl/intl_standalone.dart

Issue 10939002: Fix finding locale from OS on Windows (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
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 * This provides facilities for Internationalization that are only available 6 * This provides facilities for Internationalization that are only available
7 * when running standalone. You should import only one of this or 7 * when running standalone. You should import only one of this or
8 * intl_browser.dart. Right now the only thing provided here is finding 8 * intl_browser.dart. Right now the only thing provided here is finding
9 * the operating system locale. 9 * the operating system locale.
10 */ 10 */
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return _getAppleDefaults(); 44 return _getAppleDefaults();
45 } 45 }
46 // We can't find anything, don't set the system locale and return null. 46 // We can't find anything, don't set the system locale and return null.
47 return new Future.immediate(null); 47 return new Future.immediate(null);
48 } 48 }
49 49
50 /** 50 /**
51 * Regular expression to match the expected output of systeminfo on 51 * Regular expression to match the expected output of systeminfo on
52 * Windows. e.g. System Locale:<tab>en_US;English (United States) 52 * Windows. e.g. System Locale:<tab>en_US;English (United States)
53 */ 53 */
54 RegExp _sysInfoRegex = const RegExp(@"System Locale:\t(\w\w-\w+);"); 54 RegExp _sysInfoRegex = const RegExp(@"System Locale:\s+(\w\w-\w+);");
55 55
56 /** 56 /**
57 * Regular expression to match the expected output of reading the defaults 57 * Regular expression to match the expected output of reading the defaults
58 * database for AppleLanguages on Mac systems. 58 * database for AppleLanguages on Mac systems.
59 * e.g. { 59 * e.g. {
60 * en, 60 * en,
61 * "pt-PT", 61 * "pt-PT",
62 * ... 62 * ...
63 */ 63 */
64 RegExp _appleDefaultsRegex = const RegExp(@'(\w\w_\w+)'); 64 RegExp _appleDefaultsRegex = const RegExp(@'(\w\w_\w+)');
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return new Future.immediate(locale); 107 return new Future.immediate(locale);
108 } 108 }
109 109
110 /** 110 /**
111 * Set [Intl.systemLocale] to be the canonicalizedLocale of [aLocale]. 111 * Set [Intl.systemLocale] to be the canonicalizedLocale of [aLocale].
112 */ 112 */
113 Future<String> _setLocale(aLocale) { 113 Future<String> _setLocale(aLocale) {
114 Intl.systemLocale = Intl.canonicalizedLocale(aLocale); 114 Intl.systemLocale = Intl.canonicalizedLocale(aLocale);
115 return new Future.immediate(Intl.systemLocale); 115 return new Future.immediate(Intl.systemLocale);
116 } 116 }
OLDNEW
« pkg/intl/intl.dart ('K') | « pkg/intl/intl.dart ('k') | pkg/intl/test/intl_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698