@@ -1237,15 +1237,6 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> {
1237
1237
super .dispose ();
1238
1238
}
1239
1239
1240
- String _formatLabel (String enumName, AppLocalizations l10n) {
1241
- // Converts camelCase to Title Case
1242
- final spaced = enumName.replaceAllMapped (
1243
- RegExp ('([A-Z])' ),
1244
- (match) => ' ${match .group (1 )}' ,
1245
- );
1246
- return '${spaced [0 ].toUpperCase ()}${spaced .substring (1 )} ${l10n .daysSuffix }' ;
1247
- }
1248
-
1249
1240
@override
1250
1241
Widget build (BuildContext context) {
1251
1242
final accountActionConfig = widget.remoteConfig.accountActionConfig;
@@ -1254,10 +1245,21 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> {
1254
1245
1255
1246
return Column (
1256
1247
children: relevantActionTypes.map ((actionType) {
1248
+ final localizedActionType = switch (actionType) {
1249
+ FeedActionType .linkAccount => l10n.feedActionTypeLinkAccount,
1250
+ FeedActionType .rateApp => l10n.feedActionTypeRateApp,
1251
+ FeedActionType .followTopics => l10n.feedActionTypeFollowTopics,
1252
+ FeedActionType .followSources => l10n.feedActionTypeFollowSources,
1253
+ FeedActionType .upgrade => l10n.feedActionTypeUpgrade,
1254
+ FeedActionType .enableNotifications =>
1255
+ l10n.feedActionTypeEnableNotifications,
1256
+ };
1257
1257
return widget.buildIntField (
1258
1258
context,
1259
- label: _formatLabel (actionType.name, l10n),
1260
- description: l10n.daysBetweenPromptDescription (actionType.name),
1259
+ label: '$localizedActionType ${l10n .daysSuffix }' ,
1260
+ description: l10n.daysBetweenPromptDescription (
1261
+ localizedActionType,
1262
+ ),
1261
1263
value: _getDaysMap (accountActionConfig)[actionType] ?? 0 ,
1262
1264
onChanged: (value) {
1263
1265
final currentMap = _getDaysMap (accountActionConfig);
0 commit comments