Skip to content

Commit 7f7a37a

Browse files
committed
feat: integrates the localization extension into the CreateSourcePage. I will update the DropdownButtonFormField for ContentStatus to display the localized status names, replacing the temporary placeholder text.
1 parent ef53b5e commit 7f7a37a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/content_management/view/categories_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:ht_dashboard/shared/shared.dart';
1212
import 'package:ht_dashboard/shared/widgets/failure_state_widget.dart';
1313
import 'package:ht_dashboard/shared/widgets/loading_state_widget.dart';
1414
import 'package:ht_shared/ht_shared.dart';
15+
import 'package:ht_dashboard/shared/extensions/content_status_l10n.dart';
1516

1617
/// {@template categories_page}
1718
/// A page for displaying and managing Categories in a tabular format.

lib/content_management/view/create_source_page.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
44
import 'package:ht_dashboard/content_management/bloc/content_management_bloc.dart';
55
import 'package:ht_dashboard/content_management/bloc/create_source/create_source_bloc.dart';
66
import 'package:ht_dashboard/content_management/bloc/edit_source/edit_source_bloc.dart';
7+
import 'package:ht_dashboard/shared/extensions/content_status_l10n.dart';
78
import 'package:ht_dashboard/l10n/l10n.dart';
89
import 'package:ht_dashboard/shared/constants/pagination_constants.dart';
910
import 'package:ht_dashboard/shared/shared.dart';
@@ -221,12 +222,7 @@ class _CreateSourceViewState extends State<_CreateSourceView> {
221222
items: ContentStatus.values.map((status) {
222223
return DropdownMenuItem(
223224
value: status,
224-
child: Text(
225-
status.name.replaceFirst(
226-
status.name[0],
227-
status.name[0].toUpperCase(),
228-
),
229-
),
225+
child: Text(status.l10n(context)),
230226
);
231227
}).toList(),
232228
onChanged: (value) {

0 commit comments

Comments
 (0)