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 }