Skip to content

Commit f29fae5

Browse files
committed
refactor: updates the ContentStatusL10n extension to use the actual localization keys that we added to the .arb files in the previous step. This replaces the placeholder text and connects the enum to the localization system.
1 parent 6edae50 commit f29fae5

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lib/content_management/view/categories_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:ht_dashboard/l10n/l10n.dart';
88
import 'package:ht_dashboard/router/routes.dart';
99
import 'package:ht_dashboard/shared/constants/pagination_constants.dart';
1010
import 'package:ht_dashboard/shared/constants/app_spacing.dart';
11+
import 'package:ht_dashboard/shared/shared.dart';
1112
import 'package:ht_dashboard/shared/widgets/failure_state_widget.dart';
1213
import 'package:ht_dashboard/shared/widgets/loading_state_widget.dart';
1314
import 'package:ht_shared/ht_shared.dart';

lib/shared/extensions/content_status_l10n.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ extension ContentStatusL10n on ContentStatus {
99
final l10n = context.l10n;
1010
switch (this) {
1111
case ContentStatus.active:
12-
// TODO(l10n): Add translation for contentStatusActive
13-
return 'Active';
12+
return l10n.contentStatusActive;
1413
case ContentStatus.archived:
15-
// TODO(l10n): Add translation for contentStatusArchived
16-
return 'Archived';
14+
return l10n.contentStatusArchived;
1715
case ContentStatus.draft:
18-
// TODO(l10n): Add translation for contentStatusDraft
19-
return 'Draft';
16+
return l10n.contentStatusDraft;
2017
}
2118
}
22-
}
19+
}

0 commit comments

Comments
 (0)