From 28f7c6bbe8ae26a13c4e90814c601136e49ce1bd Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 27 Aug 2022 22:48:49 +0200 Subject: [PATCH] Restore longer localizations in Settings/About --- Passepartout/App/Views/AboutView.swift | 7 ++++--- Passepartout/App/Views/SettingsView.swift | 2 +- .../AppShared/Constants/SwiftGen+Strings.swift | 12 ++++++++++++ Passepartout/AppShared/en.lproj/Localizable.strings | 8 ++++---- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Passepartout/App/Views/AboutView.swift b/Passepartout/App/Views/AboutView.swift index b1a5e933..dd90f593 100644 --- a/Passepartout/App/Views/AboutView.swift +++ b/Passepartout/App/Views/AboutView.swift @@ -70,13 +70,14 @@ struct AboutView: View { } } + // FIXME: l10n, refactor string ids private var supportSection: some View { Section { - Button(L10n.Menu.Contextual.Support.joinCommunity) { + Button(L10n.Menu.System.Support.joinCommunity) { URL.openURL(redditURL) } - Button(L10n.Menu.Contextual.shareTwitter, action: shareOnTwitter) - Button(L10n.Menu.Contextual.Support.writeReview, action: submitReview) + Button(L10n.Menu.System.ShareTwitter.caption, action: shareOnTwitter) + Button(L10n.Menu.System.Support.writeReview, action: submitReview) } header: { Text(L10n.Menu.All.Support.title) } diff --git a/Passepartout/App/Views/SettingsView.swift b/Passepartout/App/Views/SettingsView.swift index a2b9ab74..09d0230e 100644 --- a/Passepartout/App/Views/SettingsView.swift +++ b/Passepartout/App/Views/SettingsView.swift @@ -62,7 +62,7 @@ struct SettingsView: View { NavigationLink { DonateView() } label: { - Text(L10n.Donate.title) + Text(L10n.Menu.System.Support.donate) }.disabled(!productManager.canMakePayments()) } footer: { HStack { diff --git a/Passepartout/AppShared/Constants/SwiftGen+Strings.swift b/Passepartout/AppShared/Constants/SwiftGen+Strings.swift index 5905db1c..1dc6e0b3 100644 --- a/Passepartout/AppShared/Constants/SwiftGen+Strings.swift +++ b/Passepartout/AppShared/Constants/SwiftGen+Strings.swift @@ -546,6 +546,18 @@ internal enum L10n { return L10n.tr("Localizable", "menu.system.quit.title", String(describing: p1), fallback: "Quit %@") } } + internal enum ShareTwitter { + /// Tweet about it! + internal static let caption = L10n.tr("Localizable", "menu.system.share_twitter.caption", fallback: "Tweet about it!") + } + internal enum Support { + /// Make a donation + internal static let donate = L10n.tr("Localizable", "menu.system.support.donate", fallback: "Make a donation") + /// Join community + internal static let joinCommunity = L10n.tr("Localizable", "menu.system.support.join_community", fallback: "Join community") + /// Write a review + internal static let writeReview = L10n.tr("Localizable", "menu.system.support.write_review", fallback: "Write a review") + } } } internal enum NetworkSettings { diff --git a/Passepartout/AppShared/en.lproj/Localizable.strings b/Passepartout/AppShared/en.lproj/Localizable.strings index 85d5e395..1e230fbe 100644 --- a/Passepartout/AppShared/en.lproj/Localizable.strings +++ b/Passepartout/AppShared/en.lproj/Localizable.strings @@ -82,11 +82,11 @@ //"menu.system.active_profile.messages.missing_credentials" = "No account configured"; //"menu.system.organizer.title" = "Organizer"; //"menu.system.preferences.title" = "Preferences"; -//"menu.system.support.donate" = "Make a donation"; -//"menu.system.support.join_community" = "Join community"; -//"menu.system.support.write_review" = "Write a review"; +"menu.system.support.donate" = "Make a donation"; +"menu.system.support.join_community" = "Join community"; +"menu.system.support.write_review" = "Write a review"; // "menu.system.support.translate" = "Offer to translate"; -//"menu.system.share_twitter.caption" = "Tweet about it!"; +"menu.system.share_twitter.caption" = "Tweet about it!"; //"menu.system.share_generic.caption" = "Invite a friend"; "menu.system.quit.title" = "Quit %@"; //"menu.system.quit.messages.confirm" = "The VPN, if enabled, will still run in the background. Do you want to quit?";