selfprivacy.org.app/lib/config/localization.dart
2024-01-23 20:49:47 +04:00

39 lines
946 B
Dart

import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
class Localization extends StatelessWidget {
const Localization({
super.key,
this.child,
});
final Widget? child;
@override
Widget build(final BuildContext context) => EasyLocalization(
supportedLocales: const [
Locale('ru'),
Locale('en'),
Locale('uk'),
Locale('de'),
Locale('fr'),
Locale('es'),
Locale('cs'),
Locale('pl'),
Locale('th'),
Locale('az'),
Locale('be'),
Locale('he'),
Locale('lv'),
Locale('mk'),
Locale('sk'),
Locale('sl'),
],
path: 'assets/translations',
fallbackLocale: const Locale('en'),
useFallbackTranslations: true,
saveLocale: false,
useOnlyLangCode: true,
child: child!,
);
}