From d5bbaa644bcabad1df8feff34e896ef4a27b194d Mon Sep 17 00:00:00 2001 From: Antoine Robiez Date: Thu, 27 Apr 2023 17:11:54 +0200 Subject: [PATCH 1/2] Changed the twitter hashtag --- Podfile.lock | 2 +- RobotConf/SwiftGen/Strings.swift | 4 ++++ RobotConf/UI/About/AboutView.swift | 2 +- RobotConf/UI/About/AboutViewModel.swift | 4 +++- RobotConf/UI/Resources/en.lproj/Localizable.strings | 1 + RobotConf/UI/Resources/fr.lproj/Localizable.strings | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 1333359..829fec6 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -17,4 +17,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: e13e13db912b10785acb747759cad7c4c40d5d72 -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 diff --git a/RobotConf/SwiftGen/Strings.swift b/RobotConf/SwiftGen/Strings.swift index a7e6d40..b69cf4d 100644 --- a/RobotConf/SwiftGen/Strings.swift +++ b/RobotConf/SwiftGen/Strings.swift @@ -35,6 +35,10 @@ internal enum L10n { internal static let sponsors = L10n.tr("Localizable", "about.sponsors") /// About internal static let tabTitle = L10n.tr("Localizable", "about.tabTitle") + internal enum Social { + /// #AMxDC23 + internal static let twitterHashtag = L10n.tr("Localizable", "about.social.twitterHashtag") + } } internal enum Agenda { diff --git a/RobotConf/UI/About/AboutView.swift b/RobotConf/UI/About/AboutView.swift index d5cf60b..ac5ac47 100644 --- a/RobotConf/UI/About/AboutView.swift +++ b/RobotConf/UI/About/AboutView.swift @@ -42,7 +42,7 @@ struct AboutView: View { Button(action: { self.viewModel.openHashtagPage() }) { - Text("#AndroidMakers") + Text(L10n.About.Social.twitterHashtag) .foregroundColor(Color(Asset.Colors.link.color)) } HStack(spacing: 16) { diff --git a/RobotConf/UI/About/AboutViewModel.swift b/RobotConf/UI/About/AboutViewModel.swift index b8eeebe..7fc69a9 100644 --- a/RobotConf/UI/About/AboutViewModel.swift +++ b/RobotConf/UI/About/AboutViewModel.swift @@ -34,7 +34,9 @@ class AboutViewModel: ObservableObject, Identifiable { } func openHashtagPage() { - let screenName = "AndroidMakers" + let screenName = L10n.About.Social.twitterHashtag + .addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)! + let appURL = URL(string: "twitter://search?query=\(screenName)")! let webURL = URL(string: "https://twitter.com/search?q=\(screenName)")! diff --git a/RobotConf/UI/Resources/en.lproj/Localizable.strings b/RobotConf/UI/Resources/en.lproj/Localizable.strings index 5cc92fc..71d1e47 100644 --- a/RobotConf/UI/Resources/en.lproj/Localizable.strings +++ b/RobotConf/UI/Resources/en.lproj/Localizable.strings @@ -35,6 +35,7 @@ All the talks will be recorded, and uploaded on the Youtube channel."; "about.coc" = "Code of conduct"; "about.social" = "Social"; "about.sponsors" = "Sponsors"; +"about.social.twitterHashtag" = "#AMxDC23"; "talk.complexity.beginner" = "Beginner"; "talk.complexity.intermediate" = "Intermediate"; diff --git a/RobotConf/UI/Resources/fr.lproj/Localizable.strings b/RobotConf/UI/Resources/fr.lproj/Localizable.strings index 7e25f30..92a053c 100644 --- a/RobotConf/UI/Resources/fr.lproj/Localizable.strings +++ b/RobotConf/UI/Resources/fr.lproj/Localizable.strings @@ -35,6 +35,7 @@ Tous les talks seront enregistrées, et mis sur la chaîne YouTube."; "about.coc" = "Code de conduite"; "about.social" = "Social"; "about.sponsors" = "Sponsors"; +"about.social.twitterHashtag" = "#AMxDC23"; "talk.complexity.beginner" = "Débutant"; "talk.complexity.intermediate" = "Intermédiaire"; From c511238240aeba9c63a004c21f89f291f28e9e5b Mon Sep 17 00:00:00 2001 From: Antoine Robiez Date: Thu, 27 Apr 2023 17:15:24 +0200 Subject: [PATCH 2/2] Do not unwrap values brutally --- RobotConf/UI/About/AboutViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobotConf/UI/About/AboutViewModel.swift b/RobotConf/UI/About/AboutViewModel.swift index 7fc69a9..24a31e7 100644 --- a/RobotConf/UI/About/AboutViewModel.swift +++ b/RobotConf/UI/About/AboutViewModel.swift @@ -35,7 +35,7 @@ class AboutViewModel: ObservableObject, Identifiable { func openHashtagPage() { let screenName = L10n.About.Social.twitterHashtag - .addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)! + .addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" let appURL = URL(string: "twitter://search?query=\(screenName)")! let webURL = URL(string: "https://twitter.com/search?q=\(screenName)")!