From 88586a48ae8ce735c05caabb0296a1a7a87c46b5 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Tue, 28 Jun 2022 13:01:57 +0200 Subject: [PATCH] fix: rename l10n ext + improve supported locales --- .../__brick__/lib/core/extensions/.gitkeep | 0 .../enable_l10n}} | 0 .../lib/presentation/pages/counter/counter_page.dart | 2 +- .../lib/presentation/pages/initial/initial_page.dart | 2 +- bricks/wyatt_clean_code/__brick__/lib/widget_tree.dart | 10 +++------- 5 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 bricks/wyatt_clean_code/__brick__/lib/core/extensions/.gitkeep rename bricks/wyatt_clean_code/__brick__/lib/core/extensions/{{{#enable_l10n}}l10n.dart{{ => {{#enable_l10n}}app_localizations_x.dart{{}/enable_l10n}} (100%) diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/extensions/.gitkeep b/bricks/wyatt_clean_code/__brick__/lib/core/extensions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/extensions/{{#enable_l10n}}l10n.dart{{/enable_l10n}} b/bricks/wyatt_clean_code/__brick__/lib/core/extensions/{{#enable_l10n}}app_localizations_x.dart{{/enable_l10n}} similarity index 100% rename from bricks/wyatt_clean_code/__brick__/lib/core/extensions/{{#enable_l10n}}l10n.dart{{/enable_l10n}} rename to bricks/wyatt_clean_code/__brick__/lib/core/extensions/{{#enable_l10n}}app_localizations_x.dart{{/enable_l10n}} diff --git a/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/counter/counter_page.dart b/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/counter/counter_page.dart index c5c70fd..91be000 100644 --- a/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/counter/counter_page.dart +++ b/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/counter/counter_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/bloc/counter_cubit/counter_cubit.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/shared/state_management/counter_state_management.dart'; -{{#enable_l10n}}import 'package:{{project_name.snakeCase()}}/core/extensions/l10n.dart';{{/enable_l10n}} +{{#enable_l10n}}import 'package:{{project_name.snakeCase()}}/core/extensions/app_localizations_x.dart';{{/enable_l10n}} import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/pages/counter/widgets/counter_text.dart'; class CounterPage extends StatelessWidget { diff --git a/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/initial/initial_page.dart b/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/initial/initial_page.dart index 258ff83..0f7f0b6 100644 --- a/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/initial/initial_page.dart +++ b/bricks/wyatt_clean_code/__brick__/lib/presentation/pages/initial/initial_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; {{#enable_router}}import 'package:go_router/go_router.dart'; import 'package:{{project_name.snakeCase()}}/core/resources/app_router.dart';{{/enable_router}} {{^enable_router}}import 'package:{{project_name.snakeCase()}}/presentation/pages/counter/counter_page.dart';{{/enable_router}} -{{#enable_l10n}}import 'package:{{project_name.snakeCase()}}/core/extensions/l10n.dart';{{/enable_l10n}} +{{#enable_l10n}}import 'package:{{project_name.snakeCase()}}/core/extensions/app_localizations_x.dart';{{/enable_l10n}} class InitialPage extends StatelessWidget { const InitialPage({super.key}); diff --git a/bricks/wyatt_clean_code/__brick__/lib/widget_tree.dart b/bricks/wyatt_clean_code/__brick__/lib/widget_tree.dart index 690c099..2d30095 100644 --- a/bricks/wyatt_clean_code/__brick__/lib/widget_tree.dart +++ b/bricks/wyatt_clean_code/__brick__/lib/widget_tree.dart @@ -2,7 +2,7 @@ import 'package:go_router/go_router.dart';{{/enable_router}} import 'package:{{project_name.snakeCase()}}/core/resources/app_theme.dart'; {{#enable_l10n}}import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:{{project_name.snakeCase()}}/core/extensions/l10n.dart';{{/enable_l10n}} +import 'package:{{project_name.snakeCase()}}/core/extensions/app_localizations_x.dart';{{/enable_l10n}} import 'package:{{project_name.snakeCase()}}/presentation/pages/initial/initial_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -40,9 +40,7 @@ class WidgetTree extends StatelessWidget { GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], - supportedLocales: const [ - Locale('fr', 'FR'), - ],{{/enable_l10n}} + supportedLocales: AppLocalizations.supportedLocales,{{/enable_l10n}} ); {{/enable_router}}{{^enable_router}} return MaterialApp( @@ -56,9 +54,7 @@ class WidgetTree extends StatelessWidget { GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], - supportedLocales: const [ - Locale('fr', 'FR'), - ],{{/enable_l10n}} + supportedLocales: AppLocalizations.supportedLocales,{{/enable_l10n}} ); {{/enable_router}} },