From 6443430ae74fe0de60bc0cb0a4f6638e7ecdc06f Mon Sep 17 00:00:00 2001 From: Jens Utbult Date: Fri, 22 Nov 2024 13:57:07 +0100 Subject: [PATCH] Added Slovak language support. --- Authenticator.xcodeproj/project.pbxproj | 1 + Authenticator/UI/About/AboutView.swift | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Authenticator.xcodeproj/project.pbxproj b/Authenticator.xcodeproj/project.pbxproj index 70dfbe81..3780871d 100644 --- a/Authenticator.xcodeproj/project.pbxproj +++ b/Authenticator.xcodeproj/project.pbxproj @@ -677,6 +677,7 @@ Base, fr, ja, + sk, ); mainGroup = 818866AA22DFD729006BC0A8; packageReferences = ( diff --git a/Authenticator/UI/About/AboutView.swift b/Authenticator/UI/About/AboutView.swift index 46e8f418..47397588 100644 --- a/Authenticator/UI/About/AboutView.swift +++ b/Authenticator/UI/About/AboutView.swift @@ -38,6 +38,7 @@ struct AboutView: View { .multilineTextAlignment(.center) Text("\(UIApplication.appVersion) (build \(UIApplication.appBuildNumber))") .font(.body) + AboutLanguageView() } .frame(maxWidth: .infinity) .padding(.top, 10) @@ -114,3 +115,23 @@ struct AboutView: View { } } +struct AboutLanguageView: View { + + var shouldShowLanguageNote: Bool { + guard let langCode = Bundle.main.preferredLocalizations.first else { return false } + return langCode.lowercased() == "sk" + } + + var body: some View { + if shouldShowLanguageNote { + Text("This translation is a community effort, please visit [crowdin.com](https://crowdin.com/project/yubico-authenticator-ios) to contribute.") + .multilineTextAlignment(.center) + .font(.footnote) + .foregroundStyle(.secondary) + .padding(.top, 15) + } else { + EmptyView() + } + } + +}