From ffc80268c5ba69fe411af6f5b5aebb111576518e Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Tue, 23 Jul 2024 16:32:01 +0200 Subject: [PATCH] Localization for Banner (IOS-241) --- Localization/StringsConvertor/input/Base.lproj/app.json | 3 +++ Localization/app.json | 3 +++ .../Cell/NotificationFilteringBannerTableViewCell.swift | 5 ++--- .../Sources/MastodonLocalization/Generated/Strings.swift | 4 ++++ .../Resources/Base.lproj/Localizable.strings | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Localization/StringsConvertor/input/Base.lproj/app.json b/Localization/StringsConvertor/input/Base.lproj/app.json index a18a5358b..d328f00a6 100644 --- a/Localization/StringsConvertor/input/Base.lproj/app.json +++ b/Localization/StringsConvertor/input/Base.lproj/app.json @@ -753,6 +753,9 @@ "suspend": "Your account has been suspended.", "learn_more": "Learn More" }, + "filtered_notification_banner": { + "title": "Filtered Notifications" + }, "policy": { "title": "Filter Notifications from…", "not_following": { diff --git a/Localization/app.json b/Localization/app.json index a18a5358b..d328f00a6 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -753,6 +753,9 @@ "suspend": "Your account has been suspended.", "learn_more": "Learn More" }, + "filtered_notification_banner": { + "title": "Filtered Notifications" + }, "policy": { "title": "Filter Notifications from…", "not_following": { diff --git a/Mastodon/Scene/Notification/Cell/NotificationFilteringBannerTableViewCell.swift b/Mastodon/Scene/Notification/Cell/NotificationFilteringBannerTableViewCell.swift index 8892c12d5..e18ccf5a1 100644 --- a/Mastodon/Scene/Notification/Cell/NotificationFilteringBannerTableViewCell.swift +++ b/Mastodon/Scene/Notification/Cell/NotificationFilteringBannerTableViewCell.swift @@ -3,6 +3,7 @@ import UIKit import MastodonSDK import MastodonUI +import MastodonLocalization class NotificationFilteringBannerTableViewCell: UITableViewCell { @@ -29,8 +30,7 @@ class NotificationFilteringBannerTableViewCell: UITableViewCell { iconImageWrapperView.addSubview(iconImageView) titleLabel = UILabel() - //TODO: Add localization - titleLabel.text = "Filtered Notifications" + titleLabel.text = L10n.Scene.Notification.FilteredNotificationBanner.title titleLabel.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .regular)) subtitleLabel = UILabel() @@ -85,7 +85,6 @@ class NotificationFilteringBannerTableViewCell: UITableViewCell { } func configure(with policy: Mastodon.Entity.NotificationPolicy) { - //TODO: Add localization subtitleLabel.text = "\(policy.summary.pendingRequestsCount) people you may know" } } diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index b76242fc4..cc51fc6b7 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -895,6 +895,10 @@ public enum L10n { } } public enum Notification { + public enum FilteredNotificationBanner { + /// Filtered Notifications + public static let title = L10n.tr("Localizable", "Scene.Notification.FilteredNotificationBanner.Title", fallback: "Filtered Notifications") + } public enum FollowRequest { /// Accept public static let accept = L10n.tr("Localizable", "Scene.Notification.FollowRequest.Accept", fallback: "Accept") diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index b82367d7f..0c7b4bc42 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -316,6 +316,7 @@ uploaded to Mastodon."; "Scene.Login.ServerSearchField.Placeholder" = "Enter URL or search for your server"; "Scene.Login.Subtitle" = "Log in with the server where you created your account."; "Scene.Login.Title" = "Welcome Back"; +"Scene.Notification.FilteredNotificationBanner.Title" = "Filtered Notifications"; "Scene.Notification.FollowRequest.Accept" = "Accept"; "Scene.Notification.FollowRequest.Accepted" = "Accepted"; "Scene.Notification.FollowRequest.Reject" = "reject";