From d8b88f1cf843ede0359bfff44979b7f61caa3d34 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:11:46 +0000 Subject: [PATCH] Use the placeholder added to the force logout alert. (#3802) --- .../Resources/Localizations/en-US.lproj/Localizable.strings | 2 +- .../Resources/Localizations/en.lproj/Localizable.strings | 2 +- ElementX/Sources/Generated/Strings.swift | 6 ++++-- .../Sources/Screens/HomeScreen/HomeScreenViewModel.swift | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings b/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings index 4c62bba79..1fd284f2c 100644 --- a/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en-US.lproj/Localizable.strings @@ -120,7 +120,7 @@ "action_yes" = "Yes"; "action_yes_try_again" = "Yes, try again"; "banner_migrate_to_native_sliding_sync_action" = "Log Out & Upgrade"; -"banner_migrate_to_native_sliding_sync_app_force_logout_title" = "Element X no longer supports the old protocol. Please log out and log back in to continue using the app."; +"banner_migrate_to_native_sliding_sync_app_force_logout_title" = "%1$@ no longer supports the old protocol. Please log out and log back in to continue using the app."; "banner_migrate_to_native_sliding_sync_description" = "Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later."; "banner_migrate_to_native_sliding_sync_force_logout_title" = "Your homeserver no longer supports the old protocol. Please log out and log back in to continue using the app."; "banner_migrate_to_native_sliding_sync_title" = "Upgrade available"; diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 8d5480c94..e6e1aa663 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -120,7 +120,7 @@ "action_yes" = "Yes"; "action_yes_try_again" = "Yes, try again"; "banner_migrate_to_native_sliding_sync_action" = "Log Out & Upgrade"; -"banner_migrate_to_native_sliding_sync_app_force_logout_title" = "Element X no longer supports the old protocol. Please log out and log back in to continue using the app."; +"banner_migrate_to_native_sliding_sync_app_force_logout_title" = "%1$@ no longer supports the old protocol. Please log out and log back in to continue using the app."; "banner_migrate_to_native_sliding_sync_description" = "Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later."; "banner_migrate_to_native_sliding_sync_force_logout_title" = "Your homeserver no longer supports the old protocol. Please log out and log back in to continue using the app."; "banner_migrate_to_native_sliding_sync_title" = "Upgrade available"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 7a40a677e..12855afab 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -274,8 +274,10 @@ internal enum L10n { internal static var actionYesTryAgain: String { return L10n.tr("Localizable", "action_yes_try_again") } /// Log Out & Upgrade internal static var bannerMigrateToNativeSlidingSyncAction: String { return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_action") } - /// Element X no longer supports the old protocol. Please log out and log back in to continue using the app. - internal static var bannerMigrateToNativeSlidingSyncAppForceLogoutTitle: String { return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_app_force_logout_title") } + /// %1$@ no longer supports the old protocol. Please log out and log back in to continue using the app. + internal static func bannerMigrateToNativeSlidingSyncAppForceLogoutTitle(_ p1: Any) -> String { + return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_app_force_logout_title", String(describing: p1)) + } /// Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later. internal static var bannerMigrateToNativeSlidingSyncDescription: String { return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_description") } /// Your homeserver no longer supports the old protocol. Please log out and log back in to continue using the app. diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift index a8a68d42d..6229524e1 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift @@ -320,7 +320,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol // Delay setting the alert otherwise it automatically gets dismissed. Same as the crashed last run one DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.state.bindings.alertInfo = AlertInfo(id: UUID(), - title: L10n.bannerMigrateToNativeSlidingSyncAppForceLogoutTitle, + title: L10n.bannerMigrateToNativeSlidingSyncAppForceLogoutTitle(InfoPlistReader.main.bundleDisplayName), primaryButton: .init(title: L10n.bannerMigrateToNativeSlidingSyncAction) { [weak self] in self?.actionsSubject.send(.logoutWithoutConfirmation) })