|
|
|
@ -5,7 +5,7 @@ part of '../../neon.dart';
|
|
|
|
|
/// When the system locale is not supported [fallbackLocale] will be used. |
|
|
|
|
Future<AppLocalizations> appLocalizationsFromSystem([final Locale fallbackLocale = const Locale('en', 'US')]) async { |
|
|
|
|
final systemLocale = await findSystemLocale(); |
|
|
|
|
final parts = systemLocale.split('_').map((final a) => a.split('.')).reduce((final a, final b) => [...a, ...b]); |
|
|
|
|
final parts = systemLocale.split('_').map((final a) => a.split('.')).expand((final e) => e).toList(); |
|
|
|
|
final locale = Locale(parts[0], parts.length > 1 ? parts[1] : null); |
|
|
|
|
|
|
|
|
|
final isSupported = AppLocalizations.delegate.isSupported(locale); |
|
|
|
|