diff --git a/Localization/StringsConvertor/input/Base.lproj/app.json b/Localization/StringsConvertor/input/Base.lproj/app.json index 4a680e512..8658e52d8 100644 --- a/Localization/StringsConvertor/input/Base.lproj/app.json +++ b/Localization/StringsConvertor/input/Base.lproj/app.json @@ -470,6 +470,10 @@ }, "home_timeline": { "title": "Home", + "timeline_menu": { + "following": "Following", + "local_community": "Local" + }, "navigation_bar_state": { "offline": "Offline", "new_posts": "See new posts", diff --git a/Localization/app.json b/Localization/app.json index 4a680e512..8658e52d8 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -470,6 +470,10 @@ }, "home_timeline": { "title": "Home", + "timeline_menu": { + "following": "Following", + "local_community": "Local" + }, "navigation_bar_state": { "offline": "Offline", "new_posts": "See new posts", diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift index 1da17601b..3cb6bf956 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift @@ -103,7 +103,7 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media let refreshControl = RefreshControl() private func generateTimeSelectorMenu() -> UIMenu { - let showFollowingAction = UIAction(title: "Following", image: .init(systemName: "house")) { [weak self] _ in + let showFollowingAction = UIAction(title: L10n.Scene.HomeTimeline.TimelineMenu.following, image: .init(systemName: "house")) { [weak self] _ in guard let self, let viewModel = self.viewModel else { return } viewModel.timelineContext = .following @@ -111,7 +111,7 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media viewModel.loadLatestStateMachine.enter(HomeTimelineViewModel.LoadLatestState.ContextSwitch.self) timelineSelectorButton.setAttributedTitle( - .init(string: "Following", attributes: [ + .init(string: L10n.Scene.HomeTimeline.TimelineMenu.following, attributes: [ .font: UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 20, weight: .semibold)) ]), for: .normal) @@ -120,13 +120,13 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media timelineSelectorButton.menu = generateTimeSelectorMenu() } - let showLocalTimelineAction = UIAction(title: "Local", image: .init(systemName: "building.2")) { [weak self] action in + let showLocalTimelineAction = UIAction(title: L10n.Scene.HomeTimeline.TimelineMenu.localCommunity, image: .init(systemName: "building.2")) { [weak self] action in guard let self, let viewModel = self.viewModel else { return } viewModel.timelineContext = .localCommunity viewModel.loadLatestStateMachine.enter(HomeTimelineViewModel.LoadLatestState.ContextSwitch.self) timelineSelectorButton.setAttributedTitle( - .init(string: "Local", attributes: [ + .init(string: L10n.Scene.HomeTimeline.TimelineMenu.localCommunity, attributes: [ .font: UIFontMetrics(forTextStyle: .headline).scaledFont(for: .systemFont(ofSize: 20, weight: .semibold)) ]), for: .normal) diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index 63d7a9945..6fddef9d2 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -859,6 +859,12 @@ public enum L10n { public static let logoLabel = L10n.tr("Localizable", "Scene.HomeTimeline.NavigationBarState.Accessibility.LogoLabel", fallback: "Mastodon") } } + public enum TimelineMenu { + /// Following + public static let following = L10n.tr("Localizable", "Scene.HomeTimeline.TimelineMenu.Following", fallback: "Following") + /// Local + public static let localCommunity = L10n.tr("Localizable", "Scene.HomeTimeline.TimelineMenu.LocalCommunity", fallback: "Local") + } } public enum Login { /// Log you in on the server you created your account on. diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 4287c248d..60fb82e8f 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -304,6 +304,8 @@ uploaded to Mastodon."; "Scene.HomeTimeline.NavigationBarState.Offline" = "Offline"; "Scene.HomeTimeline.NavigationBarState.Published" = "Published!"; "Scene.HomeTimeline.NavigationBarState.Publishing" = "Publishing post..."; +"Scene.HomeTimeline.TimelineMenu.Following" = "Following"; +"Scene.HomeTimeline.TimelineMenu.LocalCommunity" = "Local"; "Scene.HomeTimeline.Title" = "Home"; "Scene.Login.ServerSearchField.Placeholder" = "Enter URL or search for your server"; "Scene.Login.Subtitle" = "Log you in on the server you created your account on.";