use the new Platform.localeName API
diff --git a/.gitignore b/.gitignore
index e3225ef..a9df6e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,5 @@
.idea/
.pub/
build/
+doc/api/
pubspec.lock
diff --git a/.idea/usage.iml b/.idea/usage.iml
index fdb5d5d..806a0eb 100644
--- a/.idea/usage.iml
+++ b/.idea/usage.iml
@@ -13,7 +13,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Dart SDK" level="application" />
<orderEntry type="library" name="Dart Packages" level="project" />
+ <orderEntry type="library" name="Dart SDK" level="project" />
</component>
</module>
\ No newline at end of file
diff --git a/changelog.md b/changelog.md
index 7558a01..674bef0 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,10 @@
# Changelog
+## 3.0.2
+- switch the method we use to determine the locale to the new dart:io
+ `Platform.localeName` field
+- change our minimum SDK version to `1.23.0`
+
## 3.0.1
- expose the `Analytics.clientId` field
diff --git a/lib/src/usage_impl_io.dart b/lib/src/usage_impl_io.dart
index ff1b153..57ac8ec 100644
--- a/lib/src/usage_impl_io.dart
+++ b/lib/src/usage_impl_io.dart
@@ -136,7 +136,7 @@
/// Return the string for the platform's locale; return's `null` if the locale
/// can't be determined.
String getPlatformLocale() {
- String locale = Platform.environment['LANG'];
+ String locale = Platform.localeName;
if (locale == null) return null;
if (locale != null) {
diff --git a/pubspec.yaml b/pubspec.yaml
index 67cc71c..517e475 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,13 +3,13 @@
# BSD-style license that can be found in the LICENSE file.
name: usage
-version: 3.0.1
+version: 3.0.2
description: A Google Analytics wrapper for both command-line, web, and Flutter apps.
homepage: https://github.com/dart-lang/usage
author: Dart Team <misc@dartlang.org>
environment:
- sdk: '>=1.19.0 <2.0.0'
+ sdk: '>=1.23.0-dev.11.7 <2.0.0'
dependencies:
path: ^1.4.0
diff --git a/test/usage_impl_io_test.dart b/test/usage_impl_io_test.dart
index a150249..bce9d03 100644
--- a/test/usage_impl_io_test.dart
+++ b/test/usage_impl_io_test.dart
@@ -44,6 +44,10 @@
test('getDartVersion', () {
expect(getDartVersion(), isNotNull);
});
+
+ test('getPlatformLocale', () {
+ expect(getPlatformLocale(), isNotNull);
+ });
});
}