From eeecc36e03f6cdb88178159820d34b6de688e9e7 Mon Sep 17 00:00:00 2001 From: Jerry <89069957+Jerry23011@users.noreply.github.com> Date: Sun, 3 Nov 2024 01:10:19 -0700 Subject: [PATCH] perf(UI): add build number to about view --- VirusTotal/Localizable.xcstrings | 8 ++++---- VirusTotal/Views/Internal/AboutView.swift | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/VirusTotal/Localizable.xcstrings b/VirusTotal/Localizable.xcstrings index 2d4d536..7887c1d 100644 --- a/VirusTotal/Localizable.xcstrings +++ b/VirusTotal/Localizable.xcstrings @@ -105,24 +105,24 @@ } } }, - "about.current.version %@" : { + "about.current.version %@ (%@)" : { "localizations" : { "cs" : { "stringUnit" : { "state" : "translated", - "value" : "Verze %@" + "value" : "Verze %1$@ (%2$@)" } }, "en" : { "stringUnit" : { "state" : "translated", - "value" : "Version %@" + "value" : "Version %1$@ (%2$@)" } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "版本 %@" + "value" : "版本 %1$@ (%2$@)" } } } diff --git a/VirusTotal/Views/Internal/AboutView.swift b/VirusTotal/Views/Internal/AboutView.swift index e6cbc26..447b669 100644 --- a/VirusTotal/Views/Internal/AboutView.swift +++ b/VirusTotal/Views/Internal/AboutView.swift @@ -44,7 +44,7 @@ struct AboutView: View { Text(appName) .font(.system(size: 35, weight: .medium)) - Text("about.current.version \(version)") + Text("about.current.version \(version) (\(buildNumber))") .font(.system(size: 13)) .foregroundColor(.gray) @@ -100,6 +100,9 @@ struct AboutView: View { private var version: String { Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "" } + private var buildNumber: String { + Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "" + } private var copyrightInfo: String { Bundle.main.localizedString( forKey: "NSHumanReadableCopyright",