From 0c571a2df69eabf2e6165faf3a11089b315c936b Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Fri, 25 Nov 2022 18:47:49 +0100 Subject: [PATCH] fix: Localizable string issues --- .../HashtagTimelineHeaderView.swift | 18 ++++++++++++++---- .../Generated/Strings.swift | 4 ++-- .../Resources/Base.lproj/Localizable.strings | 2 +- .../Resources/en.lproj/Localizable.strings | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift index 1b64a1a48..fac856dc2 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineHeaderView.swift @@ -10,6 +10,7 @@ import CoreDataStack import MastodonSDK import MastodonUI import MastodonAsset +import MastodonLocalization fileprivate extension CGFloat { static let padding: CGFloat = 16 @@ -155,10 +156,19 @@ extension HashtagTimelineHeaderView { followButton.setTitle(entity.following == true ? L10n.Scene.FollowedTags.Actions.unfollow : L10n.Scene.FollowedTags.Actions.follow, for: .normal) followButton.backgroundColor = entity.following == true ? Asset.Colors.Button.tagUnfollow.color : Asset.Colors.Button.tagFollow.color - followButton.setTitleColor( - entity.following == true ? Asset.Colors.Button.tagFollow.color : Asset.Colors.Button.tagUnfollow.color, - for: .normal - ) + + switch traitCollection.userInterfaceStyle { + case .dark: + followButton.setTitleColor( + .lightGray, + for: .normal + ) + default: + followButton.setTitleColor( + entity.following == true ? Asset.Colors.Button.tagFollow.color : Asset.Colors.Button.tagUnfollow.color, + for: .normal + ) + } postCountLabel.text = String(entity.postCount) participantsLabel.text = String(entity.participantsCount) diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index 34c2b350e..5bed76fce 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -639,6 +639,8 @@ public enum L10n { public enum Actions { /// follow public static let follow = L10n.tr("Localizable", "Scene.FollowedTags.Actions.Follow", fallback: "follow") + /// unfollow + public static let unfollow = L10n.tr("Localizable", "Scene.FollowedTags.Actions.Unfollow", fallback: "unfollow") } public enum Header { /// participants @@ -647,8 +649,6 @@ public enum L10n { public static let posts = L10n.tr("Localizable", "Scene.FollowedTags.Header.Posts", fallback: "posts") /// posts today public static let postsToday = L10n.tr("Localizable", "Scene.FollowedTags.Header.PostsToday", fallback: "posts today") - /// unfollow - public static let unfollow = L10n.tr("Localizable", "Scene.FollowedTags.Header.Unfollow", fallback: "unfollow") } } public enum Follower { diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 6882b0fc5..2fb57c1b3 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -236,7 +236,7 @@ uploaded to Mastodon."; "Scene.FollowedTags.Header.Participants" = "participants"; "Scene.FollowedTags.Header.PostsToday" = "posts today"; "Scene.FollowedTags.Actions.Follow" = "follow"; -"Scene.FollowedTags.Header.Unfollow" = "unfollow"; +"Scene.FollowedTags.Actions.Unfollow" = "unfollow"; "Scene.Following.Footer" = "Follows from other servers are not displayed."; "Scene.Following.Title" = "following"; "Scene.HomeTimeline.NavigationBarState.Accessibility.LogoHint" = "Tap to scroll to top and tap again to previous location"; diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings index 35509900f..3d1f4c0a4 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings @@ -236,7 +236,7 @@ uploaded to Mastodon."; "Scene.FollowedTags.Header.Participants" = "participants"; "Scene.FollowedTags.Header.PostsToday" = "posts today"; "Scene.FollowedTags.Actions.Follow" = "follow"; -"Scene.FollowedTags.Header.Unfollow" = "unfollow"; +"Scene.FollowedTags.Actions.Unfollow" = "unfollow"; "Scene.Following.Footer" = "Follows from other servers are not displayed."; "Scene.Following.Title" = "following"; "Scene.HomeTimeline.NavigationBarState.Accessibility.LogoHint" = "Tap to scroll to top and tap again to previous location";