Index: sdk/lib/io/platform_impl.dart |
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart |
index 5f68b7dbdef6ded8dc6ddaf263e8090d5ae94326..e5de17d02e52d6d18fe867ad5b0ac19a0c035c63 100644 |
--- a/sdk/lib/io/platform_impl.dart |
+++ b/sdk/lib/io/platform_impl.dart |
@@ -32,12 +32,25 @@ class _Platform { |
external static String _packageRoot(); |
external static String _packageConfig(); |
external static String _version(); |
+ external static String _localeName(); |
static String executable = _executable(); |
static String resolvedExecutable = _resolvedExecutable(); |
static String packageRoot = _packageRoot(); |
static String packageConfig = _packageConfig(); |
+ static String _cachedLocaleName; |
+ static String get localeName { |
+ if (_cachedLocaleName == null) { |
+ var result = _localeName(); |
+ if (result is OSError) { |
+ throw result; |
+ } |
+ _cachedLocaleName = result; |
+ } |
+ return _cachedLocaleName; |
+ } |
+ |
// Cache the OS environment. This can be an OSError instance if |
// retrieving the environment failed. |
static var /*OSError|Map<String,String>*/ _environmentCache; |