diff --git a/lib/ui/window.dart b/lib/ui/window.dart index f9bb67ed29bee..4a012d7b0949a 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -395,7 +395,6 @@ class Locale { /// /// The format of the produced string is 'language-script_country'. Any null field /// will result in the corresponding encoding being omitted. - @override String toCompleteString() { final StringBuffer out = StringBuffer(languageCode); if (scriptCode != null) diff --git a/testing/dart/locale_test.dart b/testing/dart/locale_test.dart index 66fd537a72444..00858a5e81b27 100644 --- a/testing/dart/locale_test.dart +++ b/testing/dart/locale_test.dart @@ -27,7 +27,10 @@ void main() { expect(const Locale.fromSubtags(languageCode: 'en').toString(), 'en'); expect(const Locale.fromSubtags(languageCode: 'en').languageCode, 'en'); - expect(const Locale.fromSubtags(scriptCode: 'Latn').toString(), 'und_Latn'); + expect(const Locale.fromSubtags(scriptCode: 'Latn').toString(), 'und'); + expect(const Locale.fromSubtags(scriptCode: 'Latn').toCompleteString(), 'und-Latn'); + expect(const Locale.fromSubtags(scriptCode: 'Latn', countryCode: 'US').toCompleteString(), 'und_US'); + expect(const Locale.fromSubtags(scriptCode: 'Latn', countryCode: 'US').toCompleteString(), 'und-Latn_US'); expect(const Locale.fromSubtags(scriptCode: 'Latn').scriptCode, 'Latn'); expect(const Locale.fromSubtags(countryCode: 'US').toString(), 'und_US'); expect(const Locale.fromSubtags(countryCode: 'US').countryCode, 'US');