Skip to content
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
5 changes: 4 additions & 1 deletion packages/ubuntu_localizations/lib/src/localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
/// * [Intl.defaultLocale]
/// * [Intl.systemLocale]
Future<void> initDefaultLocale([String? locale]) async {
Intl.defaultLocale = locale ?? await findSystemLocale();
Intl.defaultLocale = locale ??
await findSystemLocale()

Check warning on line 34 in packages/ubuntu_localizations/lib/src/localizations.dart

View check run for this annotation

Codecov / codecov/patch

packages/ubuntu_localizations/lib/src/localizations.dart#L33-L34

Added lines #L33 - L34 were not covered by tests
// Fallback to 'en' if the system locale is 'POSIX' or undefined.
.then((l) => l == 'POSIX' || l == 'und' ? 'en' : l);

Check warning on line 36 in packages/ubuntu_localizations/lib/src/localizations.dart

View check run for this annotation

Codecov / codecov/patch

packages/ubuntu_localizations/lib/src/localizations.dart#L36

Added line #L36 was not covered by tests
}

/// A localized language and its locale.
Expand Down