From 1933a0cfdc4f86c33f38b56194c89212e8fbecec Mon Sep 17 00:00:00 2001 From: Fin Date: Fri, 15 Nov 2024 11:03:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bark/Localizable.xcstrings | 25 ++++++++++++++++++++++++- Common/Client.swift | 10 ---------- View/MessageSettingFooter.swift | 4 ++-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Bark/Localizable.xcstrings b/Bark/Localizable.xcstrings index 5dca365..6d77a79 100644 --- a/Bark/Localizable.xcstrings +++ b/Bark/Localizable.xcstrings @@ -3059,6 +3059,29 @@ } } }, + "version" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Version" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Sürüm" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "版本" + } + } + } + }, "viewAllSounds" : { "extractionState" : "manual", "localizations" : { @@ -3084,4 +3107,4 @@ } }, "version" : "1.0" -} +} \ No newline at end of file diff --git a/Common/Client.swift b/Common/Client.swift index 45d09b7..daf866b 100644 --- a/Common/Client.swift +++ b/Common/Client.swift @@ -36,16 +36,6 @@ class Client: NSObject { } } - let appVersion: String = { - var version = "0.0.0" - if let infoDict = Bundle.main.infoDictionary { - if let appVersion = infoDict["CFBundleVersion"] as? String { - version = appVersion - } - } - return version - }() - enum ClienState: Int, Codable { case ok case unRegister diff --git a/View/MessageSettingFooter.swift b/View/MessageSettingFooter.swift index bc1c8cf..b5b097c 100644 --- a/View/MessageSettingFooter.swift +++ b/View/MessageSettingFooter.swift @@ -20,7 +20,7 @@ class MessageSettingFooter: UITextView, UITextViewDelegate { // build号 let buildVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "" - let attr = NSMutableAttributedString(string: "Version \(appVersion) (Build \(buildVersion))\n", attributes: [.font: UIFont.preferredFont(ofSize: 12), .foregroundColor: BKColor.grey.darken1]) + let attr = NSMutableAttributedString(string: "\(NSLocalizedString("version")) \(appVersion) (\(buildVersion))\n", attributes: [.font: UIFont.preferredFont(ofSize: 12), .foregroundColor: BKColor.grey.darken1]) attr.append(NSAttributedString(string: NSLocalizedString("privacyPolicy"), attributes: [.link: "privacyPolicy"])) attr.append(NSAttributedString(string: " · ")) attr.append(NSAttributedString(string: NSLocalizedString("userAgreement"), attributes: [.link: "userAgreement"])) @@ -32,7 +32,7 @@ class MessageSettingFooter: UITextView, UITextViewDelegate { attr.addAttribute(.paragraphStyle, value: style, range: NSRange(location: 0, length: attr.length)) self.attributedText = attr - self.linkTextAttributes = [.foregroundColor: BKColor.grey.darken1, .underlineStyle: NSUnderlineStyle.single.rawValue] + self.linkTextAttributes = [.foregroundColor: BKColor.grey.darken1, .underlineStyle: NSUnderlineStyle.single.rawValue, .font: UIFont.preferredFont(ofSize: 12)] self.textAlignment = .center }