Skip to content

Commit c84fb40

Browse files
committed
refactor: integrates the localization extension into the SourcesPage data table. I will update the DataCell for the status column to use the .l10n(context) extension method, ensuring the status is displayed in the user's selected language.
1 parent 50a0fe3 commit c84fb40

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/content_management/view/sources_page.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:go_router/go_router.dart';
55
import 'package:ht_dashboard/content_management/bloc/content_management_bloc.dart';
66
import 'package:ht_dashboard/content_management/bloc/edit_source/edit_source_bloc.dart';
77
import 'package:ht_dashboard/l10n/app_localizations.dart';
8+
import 'package:ht_dashboard/shared/extensions/content_status_l10n.dart';
89
import 'package:ht_dashboard/l10n/l10n.dart';
910
import 'package:ht_dashboard/router/routes.dart';
1011
import 'package:ht_dashboard/shared/constants/pagination_constants.dart';
@@ -167,14 +168,7 @@ class _SourcesDataSource extends DataTableSource {
167168
cells: [
168169
DataCell(Text(source.name)),
169170
DataCell(Text(source.sourceType?.localizedName(l10n) ?? l10n.unknown)),
170-
DataCell(
171-
Text(
172-
source.status.name.replaceFirst(
173-
source.status.name[0],
174-
source.status.name[0].toUpperCase(),
175-
),
176-
),
177-
),
171+
DataCell(Text(source.status.l10n(context))),
178172
DataCell(
179173
Text(source.updatedAt?.toLocal().toString() ?? l10n.notAvailable),
180174
),

0 commit comments

Comments
 (0)