Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/app_configuration/view/app_configuration_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
tabAlignment: TabAlignment.start,
isScrollable: true,
tabs: [
Tab(text: l10n.generalTab),
Tab(text: l10n.feedTab),
Tab(text: l10n.advertisementsTab),
Tab(text: l10n.generalTab),
],
),
],
Expand Down Expand Up @@ -143,23 +143,23 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
return TabBarView(
controller: _tabController,
children: [
FeedConfigurationTab(
GeneralConfigurationTab(
remoteConfig: remoteConfig,
onConfigChanged: (newConfig) {
context.read<AppConfigurationBloc>().add(
AppConfigurationFieldChanged(remoteConfig: newConfig),
);
},
),
AdvertisementsConfigurationTab(
FeedConfigurationTab(
remoteConfig: remoteConfig,
onConfigChanged: (newConfig) {
context.read<AppConfigurationBloc>().add(
AppConfigurationFieldChanged(remoteConfig: newConfig),
);
},
),
GeneralConfigurationTab(
AdvertisementsConfigurationTab(
remoteConfig: remoteConfig,
onConfigChanged: (newConfig) {
context.read<AppConfigurationBloc>().add(
Expand Down
3 changes: 2 additions & 1 deletion lib/app_configuration/widgets/article_ad_settings_form.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:core/core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/ad_type_l10n.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/in_article_ad_slot_type_l10n.dart';
import 'package:ui_kit/ui_kit.dart';

Expand Down Expand Up @@ -97,7 +98,7 @@ class _ArticleAdSettingsFormState extends State<ArticleAdSettingsForm>
.map(
(type) => ButtonSegment<AdType>(
value: type,
label: Text(type.name),
label: Text(type.l10n(context)),
),
)
.toList(),
Expand Down
3 changes: 2 additions & 1 deletion lib/app_configuration/widgets/feed_ad_settings_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/widgets/app_config_form_fields.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/app_localizations.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/ad_type_l10n.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/app_user_role_l10n.dart';
import 'package:ui_kit/ui_kit.dart';

Expand Down Expand Up @@ -174,7 +175,7 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
.map(
(type) => ButtonSegment<AdType>(
value: type,
label: Text(type.name),
label: Text(type.l10n(context)),
),
)
.toList(),
Expand Down
48 changes: 48 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,54 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Local'**
String get adPlatformTypeLocal;

/// Tab title for Native Ads in local ads management.
///
/// In en, this message translates to:
/// **'Native Ads'**
String get nativeAdsTab;

/// Tab title for Banner Ads in local ads management.
///
/// In en, this message translates to:
/// **'Banner Ads'**
String get bannerAdsTab;

/// Tab title for Interstitial Ads in local ads management.
///
/// In en, this message translates to:
/// **'Interstitial Ads'**
String get interstitialAdsTab;

/// Tab title for Video Ads in local ads management.
///
/// In en, this message translates to:
/// **'Video Ads'**
String get videoAdsTab;

/// Label for Banner Ad Type.
///
/// In en, this message translates to:
/// **'Banner'**
String get bannerAdType;

/// Label for Native Ad Type.
///
/// In en, this message translates to:
/// **'Native'**
String get nativeAdType;

/// Label for Interstitial Ad Type.
///
/// In en, this message translates to:
/// **'Interstitial'**
String get interstitialAdType;

/// Label for Video Ad Type.
///
/// In en, this message translates to:
/// **'Video'**
String get videoAdType;
}

class _AppLocalizationsDelegate
Expand Down
24 changes: 24 additions & 0 deletions lib/l10n/app_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1263,4 +1263,28 @@ class AppLocalizationsAr extends AppLocalizations {

@override
String get adPlatformTypeLocal => 'محلي';

@override
String get nativeAdsTab => 'إعلانات أصلية';

@override
String get bannerAdsTab => 'إعلانات بانر';

@override
String get interstitialAdsTab => 'إعلانات بينية';

@override
String get videoAdsTab => 'إعلانات فيديو';

@override
String get bannerAdType => 'بانر';

@override
String get nativeAdType => 'أصلي';

@override
String get interstitialAdType => 'بيني';

@override
String get videoAdType => 'فيديو';
}
24 changes: 24 additions & 0 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1265,4 +1265,28 @@ class AppLocalizationsEn extends AppLocalizations {

@override
String get adPlatformTypeLocal => 'Local';

@override
String get nativeAdsTab => 'Native Ads';

@override
String get bannerAdsTab => 'Banner Ads';

@override
String get interstitialAdsTab => 'Interstitial Ads';

@override
String get videoAdsTab => 'Video Ads';

@override
String get bannerAdType => 'Banner';

@override
String get nativeAdType => 'Native';

@override
String get interstitialAdType => 'Interstitial';

@override
String get videoAdType => 'Video';
}
32 changes: 32 additions & 0 deletions lib/l10n/arb/app_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1581,5 +1581,37 @@
"adPlatformTypeLocal": "محلي",
"@adPlatformTypeLocal": {
"description": "اسم منصة الإعلانات المحلية للإعلانات المخصصة."
},
"nativeAdsTab": "إعلانات أصلية",
"@nativeAdsTab": {
"description": "عنوان تبويب الإعلانات الأصلية في إدارة الإعلانات المحلية."
},
"bannerAdsTab": "إعلانات بانر",
"@bannerAdsTab": {
"description": "عنوان تبويب إعلانات البانر في إدارة الإعلانات المحلية."
},
"interstitialAdsTab": "إعلانات بينية",
"@interstitialAdsTab": {
"description": "عنوان تبويب الإعلانات البينية في إدارة الإعلانات المحلية."
},
"videoAdsTab": "إعلانات فيديو",
"@videoAdsTab": {
"description": "عنوان تبويب إعلانات الفيديو في إدارة الإعلانات المحلية."
},
"bannerAdType": "بانر",
"@bannerAdType": {
"description": "تسمية نوع إعلان البانر."
},
"nativeAdType": "أصلي",
"@nativeAdType": {
"description": "تسمية نوع الإعلان الأصلي."
},
"interstitialAdType": "بيني",
"@interstitialAdType": {
"description": "تسمية نوع الإعلان البيني."
},
"videoAdType": "فيديو",
"@videoAdType": {
"description": "تسمية نوع إعلان الفيديو."
}
}
32 changes: 32 additions & 0 deletions lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1577,5 +1577,37 @@
"adPlatformTypeLocal": "Local",
"@adPlatformTypeLocal": {
"description": "The name of the Local ad platform for custom ads."
},
"nativeAdsTab": "Native Ads",
"@nativeAdsTab": {
"description": "Tab title for Native Ads in local ads management."
},
"bannerAdsTab": "Banner Ads",
"@bannerAdsTab": {
"description": "Tab title for Banner Ads in local ads management."
},
"interstitialAdsTab": "Interstitial Ads",
"@interstitialAdsTab": {
"description": "Tab title for Interstitial Ads in local ads management."
},
"videoAdsTab": "Video Ads",
"@videoAdsTab": {
"description": "Tab title for Video Ads in local ads management."
},
"bannerAdType": "Banner",
"@bannerAdType": {
"description": "Label for Banner Ad Type."
},
"nativeAdType": "Native",
"@nativeAdType": {
"description": "Label for Native Ad Type."
},
"interstitialAdType": "Interstitial",
"@interstitialAdType": {
"description": "Label for Interstitial Ad Type."
},
"videoAdType": "Video",
"@videoAdType": {
"description": "Label for Video Ad Type."
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion lib/local_ads_management/view/archived_local_ads_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _ArchivedLocalAdsViewState extends State<_ArchivedLocalAdsView>
tabAlignment: TabAlignment.start,
isScrollable: true,
tabs: AdType.values
.map((type) => Tab(text: type.name.capitalize()))
.map((type) => Tab(text: type.l10n(context)))
.toList(),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class _LocalAdsManagementViewState extends State<_LocalAdsManagementView>
tabAlignment: TabAlignment.start,
isScrollable: true,
tabs: LocalAdsManagementTab.values
.map((tab) => Tab(text: tab.name.capitalize()))
.map((tab) => Tab(text: tab.l10n(context)))
.toList(),
),
actions: [
Expand Down
21 changes: 21 additions & 0 deletions lib/shared/extensions/ad_type_l10n.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:core/core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';

/// Extension on [AdType] to provide localized descriptions.
extension AdTypeL10n on AdType {
/// Returns a localized string for the [AdType] enum value.
String l10n(BuildContext context) {
final l10n = context.l10n;
switch (this) {
case AdType.banner:
return l10n.bannerAdType;
case AdType.native:
return l10n.nativeAdType;
case AdType.interstitial:
return l10n.interstitialAdType;
case AdType.video:
return l10n.videoAdType;
}
}
}
2 changes: 2 additions & 0 deletions lib/shared/extensions/extensions.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export 'ad_platform_type_l10n.dart';
export 'ad_type_l10n.dart';
export 'app_user_role_l10n.dart';
export 'content_status_l10n.dart';
export 'feed_decorator_type_l10n.dart';
export 'in_article_ad_slot_type_l10n.dart';
export 'local_ad_to_ad_type.dart';
export 'local_ads_management_tab_l10n.dart';
export 'source_type_l10n.dart';
export 'string_truncate.dart';
Loading
Loading