Skip to content

Commit 31dffce

Browse files
committed
fix(localization): correct translation and consistency issues
- Update Arabic translation for "savedFeedFilterLimitsTitle" - Reorder English localization entries for better consistency - Improve description for "savedFeedFilterLimitsDescription"
1 parent b44f638 commit 31dffce

File tree

5 files changed

+33
-38
lines changed

5 files changed

+33
-38
lines changed

lib/l10n/app_localizations.dart

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,15 @@ import 'app_localizations_en.dart';
6262
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
6363
/// property.
6464
abstract class AppLocalizations {
65-
AppLocalizations(String locale)
66-
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
65+
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
6766

6867
final String localeName;
6968

7069
static AppLocalizations of(BuildContext context) {
7170
return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
7271
}
7372

74-
static const LocalizationsDelegate<AppLocalizations> delegate =
75-
_AppLocalizationsDelegate();
73+
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
7674

7775
/// A list of this localizations delegate along with the default localizations
7876
/// delegates.
@@ -84,18 +82,17 @@ abstract class AppLocalizations {
8482
/// Additional delegates can be added by appending to this list in
8583
/// MaterialApp. This list does not have to be used at all if a custom list
8684
/// of delegates is preferred or required.
87-
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
88-
<LocalizationsDelegate<dynamic>>[
89-
delegate,
90-
GlobalMaterialLocalizations.delegate,
91-
GlobalCupertinoLocalizations.delegate,
92-
GlobalWidgetsLocalizations.delegate,
93-
];
85+
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
86+
delegate,
87+
GlobalMaterialLocalizations.delegate,
88+
GlobalCupertinoLocalizations.delegate,
89+
GlobalWidgetsLocalizations.delegate,
90+
];
9491

9592
/// A list of this localizations delegate's supported locales.
9693
static const List<Locale> supportedLocales = <Locale>[
9794
Locale('ar'),
98-
Locale('en'),
95+
Locale('en')
9996
];
10097

10198
/// Headline for the main authentication page
@@ -1592,17 +1589,17 @@ abstract class AppLocalizations {
15921589
/// **'How often an ad can appear for this user role (e.g., a value of 5 means an ad could be placed after every 5 news items).'**
15931590
String get adFrequencyDescription;
15941591

1595-
/// Description for the Saved Headlines Filter Limits section
1592+
/// Title for the Saved Feed Filter Limits section
15961593
///
15971594
/// In en, this message translates to:
1598-
/// **'Set limits on the number of saved feed filters for each user tier.'**
1599-
String get savedFeedFilterLimitsDescription;
1595+
/// **'Saved Filter Limits'**
1596+
String get savedFeedFilterLimitsTitle;
16001597

1601-
/// Title for the Saved Feed Filter Limits section
1598+
/// Description for the Saved Headlines Filter Limits section
16021599
///
16031600
/// In en, this message translates to:
1604-
/// **'Saved Feed Filter Limits'**
1605-
String get savedFeedFilterLimitsTitle;
1601+
/// **'Set limits on the number of saved feed filters for each user tier.'**
1602+
String get savedFeedFilterLimitsDescription;
16061603

16071604
/// Label for Ad Placement Interval
16081605
///
@@ -2841,8 +2838,7 @@ abstract class AppLocalizations {
28412838
String get saveAdMessage;
28422839
}
28432840

2844-
class _AppLocalizationsDelegate
2845-
extends LocalizationsDelegate<AppLocalizations> {
2841+
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
28462842
const _AppLocalizationsDelegate();
28472843

28482844
@override
@@ -2851,26 +2847,25 @@ class _AppLocalizationsDelegate
28512847
}
28522848

28532849
@override
2854-
bool isSupported(Locale locale) =>
2855-
<String>['ar', 'en'].contains(locale.languageCode);
2850+
bool isSupported(Locale locale) => <String>['ar', 'en'].contains(locale.languageCode);
28562851

28572852
@override
28582853
bool shouldReload(_AppLocalizationsDelegate old) => false;
28592854
}
28602855

28612856
AppLocalizations lookupAppLocalizations(Locale locale) {
2857+
2858+
28622859
// Lookup logic when only language code is specified.
28632860
switch (locale.languageCode) {
2864-
case 'ar':
2865-
return AppLocalizationsAr();
2866-
case 'en':
2867-
return AppLocalizationsEn();
2861+
case 'ar': return AppLocalizationsAr();
2862+
case 'en': return AppLocalizationsEn();
28682863
}
28692864

28702865
throw FlutterError(
28712866
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
28722867
'an issue with the localizations generation tool. Please file an issue '
28732868
'on GitHub with a reproducible sample app and the gen-l10n configuration '
2874-
'that was used.',
2869+
'that was used.'
28752870
);
28762871
}

lib/l10n/app_localizations_ar.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,11 @@ class AppLocalizationsAr extends AppLocalizations {
840840
'عدد مرات ظهور الإعلان لهذا الدور المستخدم (على سبيل المثال، قيمة 5 تعني أنه يمكن وضع إعلان بعد كل 5 عناصر إخبارية).';
841841

842842
@override
843-
String get savedFeedFilterLimitsDescription =>
844-
'الحد الأقصى لعدد مرشحات موجز الأخبار المحفوظة التي يمكن لهذا الدور إنشاؤها.';
843+
String get savedFeedFilterLimitsTitle => 'حد المرشحات المحفوظة';
845844

846845
@override
847-
String get savedFeedFilterLimitsTitle => 'حد مرشحات موجز الأخبار المحفوظة';
846+
String get savedFeedFilterLimitsDescription =>
847+
'الحد الأقصى لعدد مرشحات موجز الأخبار المحفوظة التي يمكن لهذا الدور إنشاؤها.';
848848

849849
@override
850850
String get adPlacementIntervalLabel => 'فترة وضع الإعلان';

lib/l10n/app_localizations_en.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,11 @@ class AppLocalizationsEn extends AppLocalizations {
838838
'How often an ad can appear for this user role (e.g., a value of 5 means an ad could be placed after every 5 news items).';
839839

840840
@override
841-
String get savedFeedFilterLimitsDescription =>
842-
'Set limits on the number of saved feed filters for each user tier.';
841+
String get savedFeedFilterLimitsTitle => 'Saved Filter Limits';
843842

844843
@override
845-
String get savedFeedFilterLimitsTitle => 'Saved Feed Filter Limits';
844+
String get savedFeedFilterLimitsDescription =>
845+
'Set limits on the number of saved feed filters for each user tier.';
846846

847847
@override
848848
String get adPlacementIntervalLabel => 'Ad Placement Interval';

lib/l10n/arb/app_ar.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@
10381038
"@adFrequencyDescription": {
10391039
"description": "وصف تكرار الإعلان"
10401040
},
1041-
"savedFeedFilterLimitsTitle": "حد مرشحات موجز الأخبار المحفوظة",
1041+
"savedFeedFilterLimitsTitle": "حد المرشحات المحفوظة",
10421042
"@savedFeedFilterLimitsTitle": {
10431043
"description": "وصف لحد مرشحات موجز الأخبار المحفوظة"
10441044
},

lib/l10n/arb/app_en.arb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,14 +1038,14 @@
10381038
"@adFrequencyDescription": {
10391039
"description": "Description for Ad Frequency"
10401040
},
1041+
"savedFeedFilterLimitsTitle": "Saved Filter Limits",
1042+
"@savedFeedFilterLimitsTitle": {
1043+
"description": "Title for the Saved Feed Filter Limits section"
1044+
},
10411045
"savedFeedFilterLimitsDescription": "Set limits on the number of saved feed filters for each user tier.",
10421046
"@savedFeedFilterLimitsDescription": {
10431047
"description": "Description for the Saved Headlines Filter Limits section"
10441048
},
1045-
"savedFeedFilterLimitsTitle": "Saved Feed Filter Limits",
1046-
"@savedFeedFilterLimitsTitle": {
1047-
"description": "Title for the Saved Feed Filter Limits section"
1048-
},
10491049
"adPlacementIntervalLabel": "Ad Placement Interval",
10501050
"@adPlacementIntervalLabel": {
10511051
"description": "Label for Ad Placement Interval"

0 commit comments

Comments
 (0)