UpdateSputnik // Implement cross-distro upgrade.
This commit is contained in:
parent
deee89e575
commit
00da1266f1
|
@ -9,6 +9,7 @@
|
|||
import AppKit
|
||||
|
||||
public class UpdateSputnik {
|
||||
public static let isMainStreamRelease = true
|
||||
public static let shared: UpdateSputnik = .init()
|
||||
public let kUpdateInfoPageURLKey: String = {
|
||||
if #available(macOS 13, *) {
|
||||
|
@ -125,8 +126,11 @@ public class UpdateSputnik {
|
|||
let intCurrentVersion = Int(dicMainBundle[kCFBundleVersionKey as String] as? String ?? ""),
|
||||
let strCurrentVersionShortened = dicMainBundle["CFBundleShortVersionString"] as? String
|
||||
else { return } // Shouldn't happen.
|
||||
if intRemoteVersion <= intCurrentVersion {
|
||||
let isRemoteMainStreamDistro: Bool = dicMainBundle["IsMainStreamDistro"] as? Bool ?? true
|
||||
let crossDistroNotification = Self.isMainStreamRelease != isRemoteMainStreamDistro
|
||||
versionCheck: if intRemoteVersion <= intCurrentVersion {
|
||||
guard isCurrentCheckForced else { return }
|
||||
if intRemoteVersion == intCurrentVersion, crossDistroNotification { break versionCheck }
|
||||
let alert = NSAlert()
|
||||
alert.messageText = NSLocalizedString("Update Check Completed", comment: "")
|
||||
alert.informativeText = NSLocalizedString("You are already using the latest version.", comment: "")
|
||||
|
@ -136,7 +140,7 @@ public class UpdateSputnik {
|
|||
return
|
||||
}
|
||||
|
||||
let content = String(
|
||||
var content = String(
|
||||
format: NSLocalizedString(
|
||||
"You're currently using vChewing %@ (%@), a new version %@ (%@) is now available. Do you want to visit vChewing's website to download the version?",
|
||||
comment: ""
|
||||
|
@ -146,6 +150,15 @@ public class UpdateSputnik {
|
|||
strRemoteVersionShortened,
|
||||
intRemoteVersion.description
|
||||
)
|
||||
if crossDistroNotification {
|
||||
content.append("\n\n")
|
||||
content.append(
|
||||
NSLocalizedString(
|
||||
"This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version).",
|
||||
comment: ""
|
||||
)
|
||||
)
|
||||
}
|
||||
let alert = NSAlert()
|
||||
alert.informativeText = content
|
||||
alert.messageText = NSLocalizedString("New Version Available", comment: "")
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"vChewing" = "vChewing";
|
||||
"This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version)." = "This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version).";
|
||||
"Where's IMK Candidate Window?" = "Where's IMK Candidate Window?";
|
||||
"The End of Support for IMK Candidate Window" = "The End of Support for IMK Candidate Window";
|
||||
"1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023)." = "1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023).";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"vChewing" = "vChewing";
|
||||
"This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version)." = "This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version).";
|
||||
"Where's IMK Candidate Window?" = "Where's IMK Candidate Window?";
|
||||
"The End of Support for IMK Candidate Window" = "The End of Support for IMK Candidate Window";
|
||||
"1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023)." = "1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023).";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"vChewing" = "威注音入力アプリ";
|
||||
"This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version)." = "これで今のこのアプリを Aqua 特別版から主流発行版と置き換えます。主流発行版は今の時代の macOS のために最適化したものであり、おすすめです。";
|
||||
"Where's IMK Candidate Window?" = "IMK 文字候補ウィンドウはどこに?";
|
||||
"The End of Support for IMK Candidate Window" = "IMK 文字候補ウィンドウのサポート中止のお知らせ";
|
||||
"1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023)." = "1) IMKCandidates は macOS だけで利用可能のシステム構成部品であり、ObjC Bridging Header にて特殊の内部 API を使う必要があるため、本アプリの「他のシステムへの移植計画」に妨げています。\n\n2) IMKCandidates には数多くのバグがあり、そして Apple 社に修復される可能性はほぼゼロだと見込めます。さらに、Apple 社の IMKCandidates 開発参与者たちはそれについての一切内容を Apple 社以外の人と話すのは、会社の規則によって禁則事項です。従って、IMKCandidates をこのまま使い続くのは、本当にうんざりです。況してや、これからも、Apple 社が IMKCandidates に何か内部変化を導入して、新たなる互換性支障が生ずる恐れがあると見込めます。Apple の公式の InputMethodKit サンプルプロジェクトに、IMKCandidates が使われていなかった理由はこれこそだと推測できます(2023年8月までの話)。";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"vChewing" = "威注音输入法";
|
||||
"This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version)." = "该更新会将您当前的输入法由 Aqua 特别版置换为针对当前系统设计的主流发行版。";
|
||||
"Where's IMK Candidate Window?" = "IMK 选字窗去哪里了?";
|
||||
"The End of Support for IMK Candidate Window" = "关于 IMK 选字窗不再受支援的通知";
|
||||
"1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023)." = "1) 只有 macOS 才有 IMKCandidates 可用。该元件依赖特制的 ObjC Bridging Header 才能工作,这妨碍了威注音输入法的跨平台模组化。\n\n2) IMKCandidates 浑身是 Bug,且 Apple 不太可能修复之。甚至 InputMethodKit 的开发人员们都不被允许与任何非 Apple 员工讨论这些内容。于是 IMKCandidates 基本上用不下去了,更遑论 IMKCandidates 未来可能发生的会导致相容性问题的内部改动。这很可能也是 Apple 官方 InputMethodKit 示范专案当中没有用到 IMKCandidates 的原因之一(截至 2023 年 8 月)。";
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
"vChewing" = "威注音輸入法";
|
||||
"This update will upgrade vChewing from Aqua Special Edition to Mainstream Release (recommended for your current OS version)." = "該更新會將您當前的輸入法由 Aqua 特別版置換為針對當前系統設計的主流發行版。";
|
||||
"Where's IMK Candidate Window?" = "IMK 選字窗去哪裡了?";
|
||||
"The End of Support for IMK Candidate Window" = "關於 IMK 選字窗不再受支援的通知";
|
||||
"1) Only macOS has IMKCandidates. Since it relies on a dedicated ObjC Bridging Header to expose necessary internal APIs to work, it hinders vChewing from completely modularized for multi-platform support.\n\n2) IMKCandidates is buggy. It is not likely to be completely fixed by Apple, and its devs are not allowed to talk about it to non-Apple individuals. That's why we have had enough with IMKCandidates. It is likely the reason why Apple had never used IMKCandidates in their official InputMethodKit sample projects (as of August 2023)." = "1) 只有 macOS 才有 IMKCandidates 可用。該元件依賴特製的 ObjC Bridging Header 才能工作,這妨礙了威注音輸入法的跨平台模組化。\n\n2) IMKCandidates 渾身是 Bug,且 Apple 不太可能修復之。甚至 InputMethodKit 的開發人員們都不被允許與任何非 Apple 員工討論這些內容。於是 IMKCandidates 基本上用不下去了,更遑論 IMKCandidates 未來可能發生的會導致相容性問題的內部改動。這很可能也是 Apple 官方 InputMethodKit 示範專案當中沒有用到 IMKCandidates 的原因之一(截至 2023 年 8 月)。";
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
<string>3.5.5</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>3505</string>
|
||||
<key>IsMainStreamDistro</key>
|
||||
<true/>
|
||||
<key>UpdateInfoEndpoint</key>
|
||||
<string>https://gitee.com/vchewing/vChewing-macOS/raw/main/Update-Info.plist</string>
|
||||
<key>UpdateInfoEndpointLegacy</key>
|
||||
|
|
Loading…
Reference in New Issue