2020-12-01 12:26:29 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Localization extends StatelessWidget {
|
|
|
|
const Localization({
|
2022-10-26 16:26:09 +00:00
|
|
|
super.key,
|
2020-12-01 12:26:29 +00:00
|
|
|
this.child,
|
2022-06-05 19:36:32 +00:00
|
|
|
});
|
2020-12-01 12:26:29 +00:00
|
|
|
|
2021-03-15 15:39:44 +00:00
|
|
|
final Widget? child;
|
2020-12-01 12:26:29 +00:00
|
|
|
@override
|
2022-06-05 19:36:32 +00:00
|
|
|
Widget build(final BuildContext context) => EasyLocalization(
|
2023-01-31 22:57:55 +00:00
|
|
|
supportedLocales: const [
|
2024-03-14 17:22:03 +00:00
|
|
|
Locale('ar'),
|
2024-01-23 14:01:51 +00:00
|
|
|
Locale('az'),
|
|
|
|
Locale('be'),
|
2024-03-14 17:22:03 +00:00
|
|
|
Locale('cs'),
|
|
|
|
Locale('de'),
|
|
|
|
Locale('en'),
|
|
|
|
Locale('es'),
|
|
|
|
Locale('et'),
|
|
|
|
Locale('fr'),
|
2024-01-23 14:01:51 +00:00
|
|
|
Locale('he'),
|
2024-03-14 17:22:03 +00:00
|
|
|
Locale('kk'),
|
2024-01-23 14:01:51 +00:00
|
|
|
Locale('lv'),
|
|
|
|
Locale('mk'),
|
2024-03-14 17:22:03 +00:00
|
|
|
Locale('pl'),
|
|
|
|
Locale('ru'),
|
2024-01-23 14:01:51 +00:00
|
|
|
Locale('sk'),
|
|
|
|
Locale('sl'),
|
2024-03-14 17:22:03 +00:00
|
|
|
Locale('th'),
|
|
|
|
Locale('uk'),
|
|
|
|
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'),
|
2023-01-31 22:57:55 +00:00
|
|
|
],
|
2022-06-05 22:40:34 +00:00
|
|
|
path: 'assets/translations',
|
|
|
|
fallbackLocale: const Locale('en'),
|
2022-10-04 08:26:18 +00:00
|
|
|
useFallbackTranslations: true,
|
2022-06-05 22:40:34 +00:00
|
|
|
saveLocale: false,
|
2024-03-14 17:22:03 +00:00
|
|
|
useOnlyLangCode: false,
|
2022-06-05 22:40:34 +00:00
|
|
|
child: child!,
|
|
|
|
);
|
2020-12-01 12:26:29 +00:00
|
|
|
}
|