diff --git a/packages/ubuntu_localizations/lib/src/localizations.dart b/packages/ubuntu_localizations/lib/src/localizations.dart index 4aedff93..ad172205 100644 --- a/packages/ubuntu_localizations/lib/src/localizations.dart +++ b/packages/ubuntu_localizations/lib/src/localizations.dart @@ -30,7 +30,10 @@ class GlobalUbuntuLocalizations { /// * [Intl.defaultLocale] /// * [Intl.systemLocale] Future initDefaultLocale([String? locale]) async { - Intl.defaultLocale = locale ?? await findSystemLocale(); + Intl.defaultLocale = locale ?? + await findSystemLocale() + // Fallback to 'en' if the system locale is 'POSIX' or undefined. + .then((l) => l == 'POSIX' || l == 'und' ? 'en' : l); } /// A localized language and its locale.