Skip to content

Commit

Permalink
implement-sorting: return localization default locale
Browse files Browse the repository at this point in the history
  • Loading branch information
alesiaradkevich committed Jul 31, 2023
1 parent bec421d commit 808cd92
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/src/presentation/l10n/suggestions_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ class _SuggestionsLocalizationsDelegate
}

@override
bool isSupported(Locale locale) =>
<String>['en', 'ru', 'uk'].contains(locale.languageCode);
bool isSupported(Locale locale) => true;

@override
bool shouldReload(_SuggestionsLocalizationsDelegate old) => false;
Expand All @@ -449,11 +448,7 @@ SuggestionsLocalizations lookupSuggestionsLocalizations(Locale locale) {
return SuggestionsLocalizationsRu();
case 'uk':
return SuggestionsLocalizationsUk();
default:
return SuggestionsLocalizationsEn();
}

throw FlutterError(
'SuggestionsLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
}

0 comments on commit 808cd92

Please sign in to comment.