@@ -766,15 +766,14 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
766
766
@override
767
767
Widget build (BuildContext context) {
768
768
final userPreferenceConfig = widget.remoteConfig.userPreferenceConfig;
769
+ final l10n = context.l10n;
769
770
770
771
return Column (
771
772
children: [
772
773
widget.buildIntField (
773
774
context,
774
- label: 'Followed Items Limit' ,
775
- description:
776
- 'Maximum number of countries, news sources, or categories this '
777
- 'user role can follow (each type has its own limit).' ,
775
+ label: l10n.followedItemsLimitLabel,
776
+ description: l10n.followedItemsLimitDescription,
778
777
value: _getFollowedItemsLimit (userPreferenceConfig),
779
778
onChanged: (value) {
780
779
widget.onConfigChanged (
@@ -790,8 +789,8 @@ class _UserPreferenceLimitsFormState extends State<_UserPreferenceLimitsForm> {
790
789
),
791
790
widget.buildIntField (
792
791
context,
793
- label: 'Saved Headlines Limit' ,
794
- description: 'Maximum number of headlines this user role can save.' ,
792
+ label: l10n.savedHeadlinesLimitLabel ,
793
+ description: l10n.savedHeadlinesLimitDescription ,
795
794
value: _getSavedHeadlinesLimit (userPreferenceConfig),
796
795
onChanged: (value) {
797
796
widget.onConfigChanged (
@@ -990,15 +989,14 @@ class _AdConfigFormState extends State<_AdConfigForm> {
990
989
@override
991
990
Widget build (BuildContext context) {
992
991
final adConfig = widget.remoteConfig.adConfig;
992
+ final l10n = context.l10n;
993
993
994
994
return Column (
995
995
children: [
996
996
widget.buildIntField (
997
997
context,
998
- label: 'Ad Frequency' ,
999
- description:
1000
- 'How often an ad can appear for this user role (e.g., a value '
1001
- 'of 5 means an ad could be placed after every 5 news items).' ,
998
+ label: l10n.adFrequencyLabel,
999
+ description: l10n.adFrequencyDescription,
1002
1000
value: _getAdFrequency (adConfig),
1003
1001
onChanged: (value) {
1004
1002
widget.onConfigChanged (
@@ -1011,10 +1009,8 @@ class _AdConfigFormState extends State<_AdConfigForm> {
1011
1009
),
1012
1010
widget.buildIntField (
1013
1011
context,
1014
- label: 'Ad Placement Interval' ,
1015
- description:
1016
- 'Minimum number of news items that must be shown before the '
1017
- 'very first ad appears for this user role.' ,
1012
+ label: l10n.adPlacementIntervalLabel,
1013
+ description: l10n.adPlacementIntervalDescription,
1018
1014
value: _getAdPlacementInterval (adConfig),
1019
1015
onChanged: (value) {
1020
1016
widget.onConfigChanged (
@@ -1027,10 +1023,8 @@ class _AdConfigFormState extends State<_AdConfigForm> {
1027
1023
),
1028
1024
widget.buildIntField (
1029
1025
context,
1030
- label: 'Articles Before Interstitial Ads' ,
1031
- description:
1032
- 'Number of articles this user role needs to read before a '
1033
- 'full-screen interstitial ad is shown.' ,
1026
+ label: l10n.articlesBeforeInterstitialAdsLabel,
1027
+ description: l10n.articlesBeforeInterstitialAdsDescription,
1034
1028
value: _getArticlesBeforeInterstitial (adConfig),
1035
1029
onChanged: (value) {
1036
1030
widget.onConfigChanged (
@@ -1198,27 +1192,29 @@ class _AccountActionConfigFormState extends State<_AccountActionConfigForm> {
1198
1192
super .dispose ();
1199
1193
}
1200
1194
1201
- String _formatLabel (String enumName) {
1195
+ String _formatLabel (String enumName, AppLocalizations l10n ) {
1202
1196
// Converts camelCase to Title Case
1203
1197
final spaced = enumName.replaceAllMapped (
1204
1198
RegExp ('([A-Z])' ),
1205
1199
(match) => ' ${match .group (1 )}' ,
1206
1200
);
1207
- return '${spaced [0 ].toUpperCase ()}${spaced .substring (1 )} Days ' ;
1201
+ return '${spaced [0 ].toUpperCase ()}${spaced .substring (1 )} ${ l10n . daysSuffix } ' ;
1208
1202
}
1209
1203
1210
1204
@override
1211
1205
Widget build (BuildContext context) {
1212
1206
final accountActionConfig = widget.remoteConfig.accountActionConfig;
1213
1207
final relevantActionTypes = _getDaysMap (accountActionConfig).keys.toList ();
1208
+ final l10n = context.l10n;
1214
1209
1215
1210
return Column (
1216
1211
children: relevantActionTypes.map ((actionType) {
1217
1212
return widget.buildIntField (
1218
1213
context,
1219
- label: _formatLabel (actionType.name),
1220
- description:
1221
- 'Minimum number of days before showing the ${actionType .name } prompt.' ,
1214
+ label: _formatLabel (actionType.name, l10n),
1215
+ description: l10n.daysBetweenPromptDescription (
1216
+ actionType: actionType.name,
1217
+ ),
1222
1218
value: _getDaysMap (accountActionConfig)[actionType] ?? 0 ,
1223
1219
onChanged: (value) {
1224
1220
final currentMap = _getDaysMap (accountActionConfig);
0 commit comments