Chromium Code Reviews| Index: pkg/intl/lib/intl.dart |
| =================================================================== |
| --- pkg/intl/lib/intl.dart (revision 13089) |
| +++ pkg/intl/lib/intl.dart (working copy) |
| @@ -25,7 +25,7 @@ |
| * can also be set explicitly, and will then apply to any new instances where |
| * the locale isn't specified. |
| */ |
| - static String _defaultLocale; |
| + static String _defaultLocale = systemLocale; |
|
Emily Fortuna
2012/10/02 00:17:19
sorry, why are the changes in this file preferable
Alan Knight
2012/10/02 00:24:29
It sets the systemLocale on creation so it can avo
Emily Fortuna
2012/10/02 00:48:35
Seems good if we can initialize systemLocale and _
Alan Knight
2012/10/02 16:21:42
No, we can't, because getting the real value may i
Emily Fortuna
2012/10/02 17:11:37
Right, that's what I figured. So are we going to m
Alan Knight
2012/10/02 20:22:03
I don't want to make withLocale async. The only op
|
| /** |
| * The system's locale, as obtained from the window.navigator.language |
| @@ -167,8 +167,7 @@ |
| static String withLocale(String locale, Function msg_function) { |
| // We have to do this silliness because Locale is not known at compile time, |
| // but must be a static variable. |
| - if (_defaultLocale == null) _defaultLocale = systemLocale; |
| - var oldLocale = _defaultLocale; |
| + var oldLocale = _defaultLocale; |
|
Emily Fortuna
2012/10/02 00:17:19
alert alert spurious whitespace
Alan Knight
2012/10/02 00:24:29
Done.
|
| _defaultLocale = locale; |
| var result = msg_function(); |
| _defaultLocale = oldLocale; |
| @@ -195,7 +194,6 @@ |
| * locale. |
| */ |
| static String getCurrentLocale() { |
| - if (_defaultLocale == null) _defaultLocale = systemLocale; |
| return _defaultLocale; |
| } |
| } |