Skip to content

Commit 5aaee6b

Browse files
committed
feat(app_configuration): add localized labels and descriptions for notification types
- Add _getNotificationDescription method to provide localized descriptions - Update notification fields to use localized labels and descriptions - Improve user experience by providing context-specific information for each
1 parent 8572ab2 commit 5aaee6b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

lib/app_configuration/widgets/saved_filter_limits_form.dart

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,21 @@ class _SavedFilterLimitsFormState extends State<SavedFilterLimitsForm>
260260
);
261261
}
262262

263+
String _getNotificationDescription(
264+
BuildContext context,
265+
PushNotificationSubscriptionDeliveryType type,
266+
) {
267+
final l10n = AppLocalizationsX(context).l10n;
268+
switch (type) {
269+
case PushNotificationSubscriptionDeliveryType.breakingOnly:
270+
return l10n.notificationSubscriptionBreakingOnlyDescription;
271+
case PushNotificationSubscriptionDeliveryType.dailyDigest:
272+
return l10n.notificationSubscriptionDailyDigestDescription;
273+
case PushNotificationSubscriptionDeliveryType.weeklyRoundup:
274+
return l10n.notificationSubscriptionWeeklyRoundupDescription;
275+
}
276+
}
277+
263278
late final TabController _notificationTabController;
264279

265280
Widget _buildNotificationFields(
@@ -306,8 +321,8 @@ class _SavedFilterLimitsFormState extends State<SavedFilterLimitsForm>
306321
(type) {
307322
final value = limits.notificationSubscriptions?[type] ?? 0;
308323
return AppConfigIntField(
309-
label: '',
310-
description: '',
324+
label: type.l10n(context),
325+
description: _getNotificationDescription(context, type),
311326
value: value,
312327
onChanged: (newValue) =>
313328
_onValueChanged(role, type.name, newValue),

0 commit comments

Comments
 (0)