调整版本号样式

This commit is contained in:
Fin 2024-11-15 11:03:55 +08:00
parent 35580694fb
commit 1933a0cfdc
3 changed files with 26 additions and 13 deletions

View File

@ -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" : { "viewAllSounds" : {
"extractionState" : "manual", "extractionState" : "manual",
"localizations" : { "localizations" : {
@ -3084,4 +3107,4 @@
} }
}, },
"version" : "1.0" "version" : "1.0"
} }

View File

@ -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 { enum ClienState: Int, Codable {
case ok case ok
case unRegister case unRegister

View File

@ -20,7 +20,7 @@ class MessageSettingFooter: UITextView, UITextViewDelegate {
// build // build
let buildVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "" 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: NSLocalizedString("privacyPolicy"), attributes: [.link: "privacyPolicy"]))
attr.append(NSAttributedString(string: " · ")) attr.append(NSAttributedString(string: " · "))
attr.append(NSAttributedString(string: NSLocalizedString("userAgreement"), attributes: [.link: "userAgreement"])) 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)) attr.addAttribute(.paragraphStyle, value: style, range: NSRange(location: 0, length: attr.length))
self.attributedText = attr 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 self.textAlignment = .center
} }