попытки в локализацию 2
This commit is contained in:
parent
2e52b5d09d
commit
2ddd459f25
@ -95,35 +95,3 @@ abstract class AppLocale {
|
|||||||
String get heroNoImage;
|
String get heroNoImage;
|
||||||
String get heroNoDescription;
|
String get heroNoDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppLocaleDelegate extends LocalizationsDelegate<AppLocale> {
|
|
||||||
const _AppLocaleDelegate();
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<AppLocale> load(Locale locale) {
|
|
||||||
return SynchronousFuture<AppLocale>(lookupAppLocale(locale));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isSupported(Locale locale) => <String>['en', 'ru'].contains(locale.languageCode);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool shouldReload(_AppLocaleDelegate old) => false;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppLocale lookupAppLocale(Locale locale) {
|
|
||||||
|
|
||||||
|
|
||||||
// Lookup logic when only language code is specified.
|
|
||||||
switch (locale.languageCode) {
|
|
||||||
case 'en': return AppLocaleEn();
|
|
||||||
case 'ru': return AppLocaleRu();
|
|
||||||
}
|
|
||||||
|
|
||||||
throw FlutterError(
|
|
||||||
'AppLocale.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.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'app_locale.dart';
|
import 'app_locale.dart';
|
||||||
|
|
||||||
import 'app_locale.dart';
|
// ignore_for_file: type=lint
|
||||||
|
|
||||||
/// The translations for Russian (`ru`).
|
/// The translations for Russian (`ru`).
|
||||||
class AppLocaleRu extends AppLocale {
|
class AppLocaleRu extends AppLocale {
|
||||||
|
Loading…
Reference in New Issue
Block a user