Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions lib/web_ui/lib/src/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -478,19 +478,17 @@ class Locale {
int get hashCode => hashValues(languageCode, scriptCode, countryCode);

@override
String toString() {
String toString() => _rawToString('_');

// TODO(yjbanov): implement to match flutter native.
String toLanguageTag() => _rawToString('-');

String _rawToString(String separator) {
final StringBuffer out = StringBuffer(languageCode);
if (scriptCode != null) {
out.write('_$scriptCode');
}
if (_countryCode != null) {
out.write('_$countryCode');
}
if (scriptCode != null) out.write('$separator$scriptCode');
if (_countryCode != null) out.write('$separator$countryCode');
return out.toString();
}

// TODO(yjbanov): implement to match flutter native.
String toLanguageTag() => '_';
}

/// The most basic interface to the host operating system's user interface.
Expand Down