Skip to content

CodexBar 是一个 macOS 菜单栏应用,用于查看本机 Codex 账号状态、额度、Token 用量、详细统计信息

feat: 增加英文界面支持

Bobc2df8366dca9
diff --git a/CodexBar.xcodeproj/project.pbxproj b/CodexBar.xcodeproj/project.pbxproj
index 59ffc9b..2170975 100644
--- a/CodexBar.xcodeproj/project.pbxproj
+++ b/CodexBar.xcodeproj/project.pbxproj
@@ -202,10 +202,11 @@
};
};
buildConfigurationList = C4A0FD902FD9302E000263A7 /* Build configuration list for PBXProject "CodexBar" */;
- developmentRegion = en;
+ developmentRegion = "zh-Hans";
hasScannedForEncodings = 0;
knownRegions = (
en,
+ "zh-Hans",
Base,
);
mainGroup = C4A0FD8C2FD9302E000263A7;
diff --git a/CodexBar/App/CodexBarApp.swift b/CodexBar/App/CodexBarApp.swift
index ab4f49d..7f9cb65 100644
--- a/CodexBar/App/CodexBarApp.swift
+++ b/CodexBar/App/CodexBarApp.swift
@@ -23,7 +23,7 @@ struct CodexBarApp: App {
}
.commands {
CommandGroup(replacing: .appSettings) {
- Button("设置...") {
+ Button(.appCommandSettings) {
appDelegate.openSettingsFromCommand()
}
.keyboardShortcut(",", modifiers: .command)
diff --git a/CodexBar/Controllers/LogWindowController.swift b/CodexBar/Controllers/LogWindowController.swift
index 2174c9d..644ca52 100644
--- a/CodexBar/Controllers/LogWindowController.swift
+++ b/CodexBar/Controllers/LogWindowController.swift
@@ -18,7 +18,7 @@ final class LogWindowController: HostingWindowController {
let hostingController = NSHostingController(rootView: LogView(store: store))
let window = AuxiliaryHostingWindow(contentViewController: hostingController)
- window.title = "CodexBar 日志"
+ window.title = String(localized: "CodexBar 日志")
window.styleMask = [.titled, .closable, .miniaturizable, .resizable]
window.contentMinSize = Metrics.minimumContentSize
window.setContentSize(Metrics.defaultContentSize)
diff --git a/CodexBar/Controllers/SettingsWindowController.swift b/CodexBar/Controllers/SettingsWindowController.swift
index a2a60ec..c4f6f70 100644
--- a/CodexBar/Controllers/SettingsWindowController.swift
+++ b/CodexBar/Controllers/SettingsWindowController.swift
@@ -83,7 +83,7 @@ final class SettingsWindowController: HostingWindowController {
hostingController.sizingOptions = []
let window = AuxiliaryHostingWindow(contentViewController: hostingController)
- window.title = "CodexBar 设置"
+ window.title = String(localized: "CodexBar 设置")
window.styleMask = [.titled, .closable, .miniaturizable]
window.contentMinSize = Metrics.minimumContentSize
window.setContentSize(Metrics.initialContentSize)
diff --git a/CodexBar/Controllers/StatusItemController.swift b/CodexBar/Controllers/StatusItemController.swift
index 58e5e66..330f055 100644
--- a/CodexBar/Controllers/StatusItemController.swift
+++ b/CodexBar/Controllers/StatusItemController.swift
@@ -435,14 +435,16 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
func toolTip(at now: Date) -> String? {
var lines: [String] = []
if usesErrorImage {
- lines.append("Codex 账号异常")
+ lines.append(String(localized: "Codex 账号异常"))
}
if let activityText = activityToolTip(at: now) {
lines.append(activityText)
}
if activity.activeCount > 1 {
- lines.append("等待 \(activity.waitingCount) • 运行 \(activity.runningCount)")
+ lines.append(
+ String(localized: "等待 \(activity.waitingCount) • 运行 \(activity.runningCount)")
+ )
}
if let progress {
lines.append(progress.toolTip)
@@ -453,7 +455,7 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
private func activityToolTip(at now: Date) -> String? {
switch activity.primaryActivity {
case let .waiting(task):
- var text = "Codex 等待批准"
+ var text = String(localized: "Codex 等待批准")
if let projectName = task.projectName {
text += " • \(projectName)"
}
@@ -463,7 +465,7 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
text += " • \(CodexActivityDisplayFormat.waitingDurationFragment(since: task.stateChangedAt, now: now))"
return text
case let .running(task):
- var text = "Codex 正在运行"
+ var text = String(localized: "Codex 正在运行")
if let projectName = task.projectName {
text += " • \(projectName)"
}
@@ -472,7 +474,7 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
}
return text
case .completed(let completion, highlighted: true):
- var text = "Codex 刚刚完成"
+ var text = String(localized: "Codex 刚刚完成")
if let projectName = completion.projectName {
text += " • \(projectName)"
}
@@ -513,7 +515,8 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
let isStale: Bool
var toolTip: String {
- "\(label) 剩余 \(percent)%"
+ let percentText = CodexPercentageFormat.string(from: percent)
+ return String(localized: "\(label) 剩余 \(percentText)")
}
init?(snapshot: CodexQuotaSnapshot?, selection: MenuBarQuotaSelection) {
@@ -769,10 +772,10 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
private func hotKeyConflictMessage(for shortcut: GlobalHotKeyShortcut) -> String {
if shortcut == .default {
- return "默认快捷键 \(shortcut.label) 已被占用"
+ return String(localized: "默认快捷键 \(shortcut.label) 已被占用")
}
- return "快捷键已被占用"
+ return String(localized: "快捷键已被占用")
}
// MARK: - 菜单栏图标
@@ -1096,13 +1099,13 @@ private final class StatusItemController: NSObject, NSMenuDelegate {
}
private func menuItem(
- title: String,
+ title: LocalizedStringResource,
action: Selector,
keyEquivalent: String,
symbolName: String
) -> NSMenuItem {
let item = NSMenuItem(
- title: title,
+ title: String(localized: title),
action: action,
keyEquivalent: keyEquivalent
)
diff --git a/CodexBar/Models/CodexActivityModels.swift b/CodexBar/Models/CodexActivityModels.swift
index 01f5cab..bcb34d2 100644
--- a/CodexBar/Models/CodexActivityModels.swift
+++ b/CodexBar/Models/CodexActivityModels.swift
@@ -144,18 +144,32 @@ nonisolated enum CodexActivityTransition: Equatable {
case completed(CodexActivityCompletion)
}
-nonisolated enum CodexActivityDurationFormat {
- static func text(for interval: TimeInterval) -> String {
+nonisolated enum CodexDurationFormat {
+ static func activityText(for interval: TimeInterval) -> String {
let totalSeconds = max(0, Int(interval.rounded()))
- let minutes = totalSeconds / 60
- let seconds = totalSeconds % 60
- if minutes >= 60 {
- return "\(minutes / 60) 小时 \(minutes % 60) 分"
- }
- if minutes > 0 {
- return "\(minutes) 分 \(seconds) 秒"
+ let duration = Duration.seconds(Double(totalSeconds))
+ let allowedUnits: Set<Duration.UnitsFormatStyle.Unit> = if totalSeconds >= 3600 {
+ [.hours, .minutes]
+ } else if totalSeconds >= 60 {
+ [.minutes, .seconds]
+ } else {
+ [.seconds]
}
- return "\(seconds) 秒"
+ return abbreviated(duration, allowedUnits: allowedUnits)
+ }
+
+ static func abbreviated(
+ _ duration: Duration,
+ allowedUnits: Set<Duration.UnitsFormatStyle.Unit>
+ ) -> String {
+ duration.formatted(
+ .units(
+ allowed: allowedUnits,
+ width: .abbreviated,
+ zeroValueUnits: .show(length: 1),
+ fractionalPart: .hide(rounded: .down)
+ )
+ )
}
}
@@ -168,43 +182,48 @@ nonisolated enum CodexActivityDisplayFormat {
static func eventText(for task: CodexActivityTaskSnapshot) -> String {
switch task.latestEvent {
case .promptSubmitted:
- "正在思考"
+ String(localized: "正在思考")
case .toolStarted:
- task.toolName.map { "调用工具 \($0)" } ?? "调用工具"
+ task.toolName.map { String(localized: "调用工具 \($0)") }
+ ?? String(localized: "调用工具")
case .toolFinished:
- task.toolName.map { "调用工具 \($0) 完成" } ?? "调用工具完成"
+ task.toolName.map { String(localized: "调用工具 \($0) 完成") }
+ ?? String(localized: "调用工具完成")
case .compactionStarted:
- "压缩上下文"
+ String(localized: "压缩上下文")
case .compactionFinished:
- "上下文压缩完成"
+ String(localized: "上下文压缩完成")
case .subagentStarted:
- "启动子智能体"
+ String(localized: "启动子智能体")
case .subagentFinished:
- "子智能体完成"
+ String(localized: "子智能体完成")
case .approvalRequested:
- "等待批准"
+ String(localized: "等待批准")
}
}
static func completionRelativeText(_ completedAt: Date, now: Date) -> String {
- relativeText(since: completedAt, now: now, action: "完成")
+ relativeText(since: completedAt, now: now, action: .completed)
}
static func terminationRelativeText(_ terminatedAt: Date, now: Date) -> String {
- relativeText(since: terminatedAt, now: now, action: "终止")
+ relativeText(since: terminatedAt, now: now, action: .terminated)
}
/// 活动卡片, 任务中心, 菜单栏 tooltip 和系统通知共用的时长片段
static func waitingDurationFragment(since stateChangedAt: Date, now: Date) -> String {
- "已等待 \(CodexActivityDurationFormat.text(for: now.timeIntervalSince(stateChangedAt)))"
+ let duration = CodexDurationFormat.activityText(for: now.timeIntervalSince(stateChangedAt))
+ return String(localized: "已等待 \(duration)")
}
static func runningDurationFragment(since startedAt: Date, now: Date) -> String {
- "已运行 \(CodexActivityDurationFormat.text(for: now.timeIntervalSince(startedAt)))"
+ let duration = CodexDurationFormat.activityText(for: now.timeIntervalSince(startedAt))
+ return String(localized: "已运行 \(duration)")
}
static func elapsedDurationFragment(for duration: TimeInterval) -> String {
- "耗时 \(CodexActivityDurationFormat.text(for: duration))"
+ let durationText = CodexDurationFormat.activityText(for: duration)
+ return String(localized: "耗时 \(durationText)")
}
/// 活动卡片和任务中心共用同一份文案片段
@@ -213,7 +232,7 @@ nonisolated enum CodexActivityDisplayFormat {
now: Date
) -> [String] {
[
- task.toolName ?? "等待下一步操作",
+ task.toolName ?? String(localized: "等待下一步操作"),
waitingDurationFragment(since: task.stateChangedAt, now: now)
]
}
@@ -225,7 +244,7 @@ nonisolated enum CodexActivityDisplayFormat {
let duration = if task.showsPreciseDuration, let startedAt = task.startedAt {
runningDurationFragment(since: startedAt, now: now)
} else {
- "正在运行"
+ String(localized: "正在运行")
}
return [duration, eventText(for: task)]
}
@@ -242,15 +261,22 @@ nonisolated enum CodexActivityDisplayFormat {
return components
}
- private static func relativeText(since date: Date, now: Date, action: String) -> String {
+ private static func relativeText(since date: Date, now: Date, action: RelativeAction) -> String {
let seconds = max(0, Int(now.timeIntervalSince(date)))
- if seconds < 10 {
- return "刚刚\(action)"
+ switch (action, seconds) {
+ case (.completed, ..<10):
+ return String(localized: "刚刚完成")
+ case (.terminated, ..<10):
+ return String(localized: "刚刚终止")
+ case (.completed, ..<60):
+ return String(localized: "\(seconds) 秒前完成")
+ case (.terminated, ..<60):
+ return String(localized: "\(seconds) 秒前终止")
+ case (.completed, _):
+ return String(localized: "\(seconds / 60) 分钟前完成")
+ case (.terminated, _):
+ return String(localized: "\(seconds / 60) 分钟前终止")
}
- if seconds < 60 {
- return "\(seconds) 秒前\(action)"
- }
- return "\(seconds / 60) 分钟前\(action)"
}
private static func normalizedText(_ value: String?) -> String? {
@@ -260,4 +286,9 @@ nonisolated enum CodexActivityDisplayFormat {
let trimmedValue = value.trimmingCharacters(in: .whitespacesAndNewlines)
return trimmedValue.isEmpty ? nil : trimmedValue
}
+
+ private enum RelativeAction {
+ case completed
+ case terminated
+ }
}
diff --git a/CodexBar/Models/CodexQuotaModels.swift b/CodexBar/Models/CodexQuotaModels.swift
index 315fb56..cbbf57b 100644
--- a/CodexBar/Models/CodexQuotaModels.swift
+++ b/CodexBar/Models/CodexQuotaModels.swift
@@ -1,5 +1,16 @@
import Foundation
+nonisolated enum CodexPercentageFormat {
+ static func string(from percent: Int) -> String {
+ percent.formatted(
+ .percent
+ .scale(1)
+ .precision(.fractionLength(0))
+ .locale(.autoupdatingCurrent)
+ )
+ }
+}
+
/// 由 account/rateLimits/usage 三路 app-server 响应合成的菜单面板快照
nonisolated struct CodexQuotaSnapshot: Equatable {
let account: CodexAccount
@@ -109,7 +120,7 @@ nonisolated struct QuotaWindow: Equatable, Identifiable {
private static func windowLabel(for minutes: Int?) -> String {
guard let minutes, minutes > 0 else {
- return "额度"
+ return String(localized: "quota.window.fallback", defaultValue: "额度")
}
if minutes.isMultiple(of: 1440) {
diff --git a/CodexBar/Models/CodexStatusError.swift b/CodexBar/Models/CodexStatusError.swift
index 00169ce..15219b0 100644
--- a/CodexBar/Models/CodexStatusError.swift
+++ b/CodexBar/Models/CodexStatusError.swift
@@ -13,19 +13,37 @@ nonisolated enum CodexStatusError: LocalizedError {
var errorDescription: String? {
switch self {
case .executableNotFound:
- "找不到 Codex CLI 或 Codex APP"
+ String(
+ localized: "codex-status.error.executable-not-found",
+ defaultValue: "找不到 Codex CLI 或 Codex APP"
+ )
case .serverTimeout:
- "Codex app-server 等待响应超时"
+ String(
+ localized: "codex-status.error.server-timeout",
+ defaultValue: "Codex app-server 等待响应超时"
+ )
case .serverConnectionClosed:
- "Codex app-server 连接已经断开"
+ String(
+ localized: "codex-status.error.connection-closed",
+ defaultValue: "Codex app-server 连接已经断开"
+ )
case .invalidServerResponse:
- "Codex app-server 无法解析响应"
+ String(
+ localized: "codex-status.error.invalid-response",
+ defaultValue: "Codex app-server 无法解析响应"
+ )
case let .serverError(message):
message
case .unsupportedMethod:
- "Codex app-server 不支持该接口"
+ String(
+ localized: "codex-status.error.unsupported-method",
+ defaultValue: "Codex app-server 不支持该接口"
+ )
case .notLoggedIn:
- "Codex 未登录"
+ String(
+ localized: "codex-status.error.not-logged-in",
+ defaultValue: "Codex 未登录"
+ )
}
}
diff --git a/CodexBar/Models/DateFormatter.swift b/CodexBar/Models/DateFormatter.swift
index aa590ba..abc286b 100644
--- a/CodexBar/Models/DateFormatter.swift
+++ b/CodexBar/Models/DateFormatter.swift
@@ -58,6 +58,11 @@ nonisolated enum CodexDateFormat {
localDisplayFormatter.string(from: date)
}
+ /// yyyy-MM-dd, 日期选择器和日期范围只展示日期部分
+ static func localDayDisplayString(from date: Date) -> String {
+ dayString(from: date)
+ }
+
/// ISO8601 internet date-time, 带或不带小数秒均可解析
static func iso8601Date(from string: String) -> Date? {
try? Date(string, strategy: .iso8601)
diff --git a/CodexBar/Models/GlobalHotKeyShortcut.swift b/CodexBar/Models/GlobalHotKeyShortcut.swift
index 75d2eab..525e5c7 100644
--- a/CodexBar/Models/GlobalHotKeyShortcut.swift
+++ b/CodexBar/Models/GlobalHotKeyShortcut.swift
@@ -39,11 +39,17 @@ nonisolated struct GlobalHotKeyShortcut: Codable, Equatable {
var validationError: String? {
if modifierCount < 2 {
- return "至少需要两个修饰键"
+ return String(
+ localized: "hotkey.validation.minimum-modifiers",
+ defaultValue: "至少需要两个修饰键"
+ )
}
if isReservedSystemShortcut {
- return "不可使用系统快捷键"
+ return String(
+ localized: "hotkey.validation.system-reserved",
+ defaultValue: "不可使用系统快捷键"
+ )
}
return nil
diff --git a/CodexBar/Resources/Localizable.xcstrings b/CodexBar/Resources/Localizable.xcstrings
new file mode 100644
index 0000000..58dea51
--- /dev/null
+++ b/CodexBar/Resources/Localizable.xcstrings
@@ -0,0 +1,4347 @@
+{
+ "sourceLanguage" : "zh-Hans",
+ "strings" : {
+ " 等" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : ", etc."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : " 等"
+ }
+ }
+ }
+ },
+ ", 开启 CodexBar Hook 后会自动重试" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : ", will retry automatically after CodexBar Hook is enabled"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : ", 开启 CodexBar Hook 后会自动重试"
+ }
+ }
+ }
+ },
+ ", 稍后会自动重试" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : ", will retry automatically"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : ", 稍后会自动重试"
+ }
+ }
+ }
+ },
+ ", 跳过 %lld 条无效数据" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; invalid events skipped: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : ", 跳过 %lld 条无效数据"
+ }
+ }
+ }
+ },
+ "; %lld 天未完成 (%@)" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; dates not rebuilt (%1$lld): %2$@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; %1$lld 天未完成 (%2$@)"
+ }
+ }
+ }
+ },
+ "; 云端替换将在同步可用后继续" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; cloud data will be replaced when sync becomes available"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; 云端替换将在同步可用后继续"
+ }
+ }
+ }
+ },
+ "%@ ~" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ –"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ ~"
+ }
+ }
+ }
+ },
+ "%@ ~ %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ – %2$@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ ~ %2$@"
+ }
+ }
+ }
+ },
+ "%@ 剩余 %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@: %2$@ remaining"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ 剩余 %2$@"
+ }
+ }
+ }
+ },
+ "%lld 个子 Agent" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Subagents: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 个子 Agent"
+ }
+ }
+ }
+ },
+ "%lld 分钟" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld min"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 分钟"
+ }
+ }
+ }
+ },
+ "%lld 分钟前完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Completed %lld min ago"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 分钟前完成"
+ }
+ }
+ }
+ },
+ "%lld 分钟前终止" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stopped %lld min ago"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 分钟前终止"
+ }
+ }
+ }
+ },
+ "%lld 秒" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld sec"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 秒"
+ }
+ }
+ }
+ },
+ "%lld 秒前完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Completed %lld sec ago"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 秒前完成"
+ }
+ }
+ }
+ },
+ "%lld 秒前终止" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stopped %lld sec ago"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 秒前终止"
+ }
+ }
+ }
+ },
+ "%lld天" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lldd"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld天"
+ }
+ }
+ }
+ },
+ "APP 快捷键" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "App Shortcut"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "APP 快捷键"
+ }
+ }
+ }
+ },
+ "app.command.settings" : {
+ "extractionState" : "manual",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "设置..."
+ }
+ }
+ }
+ },
+ "Codex app-server 日志" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex app-server Log"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex app-server 日志"
+ }
+ }
+ }
+ },
+ "Codex TUI 通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex TUI Notifications"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex TUI 通知"
+ }
+ }
+ }
+ },
+ "Codex TUI 通知, 独立于 CodexBar 通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Separate from CodexBar notifications"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex TUI 通知, 独立于 CodexBar 通知"
+ }
+ }
+ }
+ },
+ "Codex TUI 通知状态与设置不一致" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex TUI notification status does not match the setting"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex TUI 通知状态与设置不一致"
+ }
+ }
+ }
+ },
+ "Codex 任务已完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex task completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 任务已完成"
+ }
+ }
+ }
+ },
+ "Codex 任务已终止" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex task stopped"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 任务已终止"
+ }
+ }
+ }
+ },
+ "Codex 刚刚完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex just completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 刚刚完成"
+ }
+ }
+ }
+ },
+ "Codex 正在运行" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex is running"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 正在运行"
+ }
+ }
+ }
+ },
+ "Codex 没有返回任何结果" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex returned no results"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 没有返回任何结果"
+ }
+ }
+ }
+ },
+ "Codex 版本" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex Versions"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 版本"
+ }
+ }
+ }
+ },
+ "Codex 等待批准" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex is waiting for approval"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 等待批准"
+ }
+ }
+ }
+ },
+ "Codex 账号异常" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex account unavailable"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 账号异常"
+ }
+ }
+ }
+ },
+ "Codex 返回警告" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex returned a warning"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 返回警告"
+ }
+ }
+ }
+ },
+ "Codex 返回错误" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex returned an error"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 返回错误"
+ }
+ }
+ }
+ },
+ "Codex 配置已禁用 Hook" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Hooks are disabled in the Codex configuration"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 配置已禁用 Hook"
+ }
+ }
+ }
+ },
+ "codex-cli.version.launch-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Failed to launch"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "启动失败"
+ }
+ }
+ }
+ },
+ "codex-cli.version.not-found" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ not found"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未找到 %@"
+ }
+ }
+ }
+ },
+ "codex-cli.version.parse-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Version not recognized"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "版本未知"
+ }
+ }
+ }
+ },
+ "codex-cli.version.read-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Failed to read version"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "读取失败"
+ }
+ }
+ }
+ },
+ "codex-cli.version.read-timeout" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Version check timed out"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "读取超时"
+ }
+ }
+ }
+ },
+ "codex-cli.version.unknown" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Unknown version"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未知版本"
+ }
+ }
+ }
+ },
+ "codex-status.error.connection-closed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "The Codex app-server connection closed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex app-server 连接已经断开"
+ }
+ }
+ }
+ },
+ "codex-status.error.executable-not-found" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex CLI or Codex app not found"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "找不到 Codex CLI 或 Codex APP"
+ }
+ }
+ }
+ },
+ "codex-status.error.invalid-response" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not parse the Codex app-server response"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex app-server 无法解析响应"
+ }
+ }
+ }
+ },
+ "codex-status.error.not-logged-in" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex is not signed in"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 未登录"
+ }
+ }
+ }
+ },
+ "codex-status.error.server-timeout" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Timed out waiting for a Codex app-server response"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex app-server 等待响应超时"
+ }
+ }
+ }
+ },
+ "codex-status.error.unsupported-method" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "This operation is not supported by the Codex app-server"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex app-server 不支持该接口"
+ }
+ }
+ }
+ },
+ "CodexBar Hook" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook"
+ }
+ }
+ }
+ },
+ "CodexBar Hook 已不完整" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook is incomplete"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook 已不完整"
+ }
+ }
+ }
+ },
+ "CodexBar Hook 已被禁用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook is disabled"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook 已被禁用"
+ }
+ }
+ }
+ },
+ "CodexBar Hook 意外来源" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook comes from an unexpected source"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook 意外来源"
+ }
+ }
+ }
+ },
+ "CodexBar Hook 未生效" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook is not working"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook 未生效"
+ }
+ }
+ }
+ },
+ "CodexBar Hook 未被信任" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook is not trusted"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook 未被信任"
+ }
+ }
+ }
+ },
+ "CodexBar 日志" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Log"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar 日志"
+ }
+ }
+ }
+ },
+ "CodexBar 版本" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Version"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar 版本"
+ }
+ }
+ }
+ },
+ "CodexBar 设置" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar 设置"
+ }
+ }
+ }
+ },
+ "CodexBarHelper 尚未注册" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBarHelper is not registered"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBarHelper 尚未注册"
+ }
+ }
+ }
+ },
+ "hooks.json 文件格式错误" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Invalid hooks.json format"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "hooks.json 文件格式错误"
+ }
+ }
+ }
+ },
+ "hotkey.validation.minimum-modifiers" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Use at least two modifier keys"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "至少需要两个修饰键"
+ }
+ }
+ }
+ },
+ "hotkey.validation.system-reserved" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "This system shortcut cannot be used"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "不可使用系统快捷键"
+ }
+ }
+ }
+ },
+ "keep-alive.duration.hours" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld hr"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld 小时"
+ }
+ }
+ }
+ },
+ "keep-alive.duration.unlimited" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Unlimited"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "无限制"
+ }
+ }
+ }
+ },
+ "keep-alive.error.connection-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not connect to the service"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "连接服务失败"
+ }
+ }
+ }
+ },
+ "keep-alive.error.connection-interrupted" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "The service connection was interrupted"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "服务连接中断"
+ }
+ }
+ }
+ },
+ "keep-alive.error.helper-assets-missing" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Service unavailable; reinstall CodexBar"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "服务异常, 请重新安装 CodexBar"
+ }
+ }
+ }
+ },
+ "keep-alive.error.invalid-helper-interface" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Invalid service interface"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "服务接口无效"
+ }
+ }
+ }
+ },
+ "keep-alive.error.no-response" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "The service is not responding"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "服务无响应"
+ }
+ }
+ }
+ },
+ "keep-alive.error.prevent-idle-sleep-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not prevent idle sleep"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "防止空闲睡眠失败"
+ }
+ }
+ }
+ },
+ "keep-alive.error.registration-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not register the service"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "注册服务失败"
+ }
+ }
+ }
+ },
+ "keep-alive.error.request-system-sleep-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not request system sleep"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "请求系统睡眠失败"
+ }
+ }
+ }
+ },
+ "keep-alive.error.restore-idle-sleep-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not restore the idle sleep policy"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "恢复空闲睡眠策略失败"
+ }
+ }
+ }
+ },
+ "keep-alive.error.retry-limit-reached" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep-awake failed repeatedly; retries stopped"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "防睡眠多次失败, 已停止重试"
+ }
+ }
+ }
+ },
+ "keep-alive.error.toggle-sleep-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not change the system sleep state"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "切换睡眠状态失败"
+ }
+ }
+ }
+ },
+ "keep-alive.error.update-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not update the service"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "更新服务失败"
+ }
+ }
+ }
+ },
+ "keep-alive.low-battery.off" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Off"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "关闭"
+ }
+ }
+ }
+ },
+ "menu-bar-quota.selection.off" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Off"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "关闭"
+ }
+ }
+ }
+ },
+ "menu-bar-quota.selection.primary" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Primary"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "主额度"
+ }
+ }
+ }
+ },
+ "menu-bar-quota.selection.secondary" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Secondary"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "次额度"
+ }
+ }
+ }
+ },
+ "notification.credit-expiry.body" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Reset credits expiring on %2$@: %1$lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "有 %1$lld 个重置次数将于 %2$@ 过期"
+ }
+ }
+ }
+ },
+ "notification.credit-expiry.title" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Reset Credits Expiring Soon"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "重置即将过期"
+ }
+ }
+ }
+ },
+ "notification.keep-alive-ended.duration-limit" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep-awake stopped after %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已达防睡眠上限 %@, 已停止防睡眠"
+ }
+ }
+ }
+ },
+ "notification.keep-alive-ended.low-battery" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Battery at %@; keep-awake stopped"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "电量剩余 %@, 已停止防睡眠"
+ }
+ }
+ }
+ },
+ "notification.keep-alive-ended.title" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "System Sleep Restored"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已恢复系统睡眠"
+ }
+ }
+ }
+ },
+ "notification.low-quota.body" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ %2$@: less than %3$@ remaining"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ %2$@ 剩余额度已低于 %3$@"
+ }
+ }
+ }
+ },
+ "notification.low-quota.title" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex Quota Is Low"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 额度不足"
+ }
+ }
+ }
+ },
+ "notification.quota-reset.body" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ %2$@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%1$@ %2$@"
+ }
+ }
+ }
+ },
+ "notification.quota-reset.title" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quota Reset"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "额度已重置"
+ }
+ }
+ }
+ },
+ "notification.sound.default" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Default"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "默认"
+ }
+ }
+ }
+ },
+ "notification.sound.silent" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "None"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "静音"
+ }
+ }
+ }
+ },
+ "notification.task-completed.body.codex" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex task completed • %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 任务完成, %@"
+ }
+ }
+ }
+ },
+ "notification.task-completed.body.project" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Task completed in “%1$@” • %2$@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%1$@」任务完成, %2$@"
+ }
+ }
+ }
+ },
+ "notification.task-completed.title" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex Task Completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 任务完成"
+ }
+ }
+ }
+ },
+ "notification.task-waiting.body.codex" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex is waiting for approval to continue"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 正在等待批准下一步操作"
+ }
+ }
+ }
+ },
+ "notification.task-waiting.body.codex-tool" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex is waiting for approval to use %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 正在等待批准 %@ 操作"
+ }
+ }
+ }
+ },
+ "notification.task-waiting.body.project" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "A task in “%@” is waiting for approval to continue"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%@」正在等待批准下一步操作"
+ }
+ }
+ }
+ },
+ "notification.task-waiting.body.project-tool" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "A task in “%1$@” is waiting for approval to use %2$@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%1$@」正在等待批准 %2$@ 操作"
+ }
+ }
+ }
+ },
+ "notification.task-waiting.title" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex Is Waiting for Approval"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex 等待批准"
+ }
+ }
+ }
+ },
+ "quota.window.fallback" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quota"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "额度"
+ }
+ }
+ }
+ },
+ "request-log.error.exit-timeout-killed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "app-server did not exit in time and was force-quit"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "app-server 退出超时, 已强制结束"
+ }
+ }
+ }
+ },
+ "request-log.error.exit-timeout-running" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "app-server did not exit in time and may still be running"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "app-server 退出超时, 可能仍在后台运行"
+ }
+ }
+ }
+ },
+ "request-log.error.initialization-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Failed to initialize the app-server session: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "app-server 会话初始化失败: %@"
+ }
+ }
+ }
+ },
+ "request-log.error.launch-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Failed to launch app-server: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "app-server 启动失败: %@"
+ }
+ }
+ }
+ },
+ "request-log.error.response-connection-closed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Connection closed while waiting for a response"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "连接已断开, 等待响应失败"
+ }
+ }
+ }
+ },
+ "request-log.error.response-timeout" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Response timed out"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待响应超时"
+ }
+ }
+ }
+ },
+ "request-log.error.write-connection-closed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Connection closed; the request could not be sent"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "连接已断开, 无法发送请求"
+ }
+ }
+ }
+ },
+ "updater.status.check-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not check for updates"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "检查更新失败"
+ }
+ }
+ }
+ },
+ "updater.status.checking" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Checking for updates"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "正在检查更新"
+ }
+ }
+ }
+ },
+ "updater.status.missing-configuration" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Update source is not configured"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未配置更新资源"
+ }
+ }
+ }
+ },
+ "updater.status.up-to-date" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar is up to date"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "没有可用更新"
+ }
+ }
+ }
+ },
+ "updater.status.update-available" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Version %@ is available"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "发现新版本: v%@"
+ }
+ }
+ }
+ },
+ "workflow.metric.tool-calls" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tool calls"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "调用工具"
+ }
+ }
+ }
+ },
+ "workflow.rebuild.error.source-changed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Local data changed; try again"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "本地数据发生变化, 请重试"
+ }
+ }
+ }
+ },
+ "workflow.rebuild.error.source-unavailable" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No local data is available to rebuild"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "没有可重建的本地数据"
+ }
+ }
+ }
+ },
+ "workflow.rebuild.summary.sync-replacement-marking-failed" : {
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; cloud replacement could not be completed; rebuild these dates later"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "; 云端替换未能完成, 请稍后重新重建这些数据"
+ }
+ }
+ }
+ },
+ "上下文压缩" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Compactions"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "上下文压缩"
+ }
+ }
+ }
+ },
+ "上下文压缩完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Context compacted"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "上下文压缩完成"
+ }
+ }
+ }
+ },
+ "上个月" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Previous Month"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "上个月"
+ }
+ }
+ }
+ },
+ "下个月" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Next Month"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "下个月"
+ }
+ }
+ }
+ },
+ "主面板任务中心" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Show Task Center in Menu"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "主面板任务中心"
+ }
+ }
+ }
+ },
+ "仅在使用电池供电时生效, 充电时自动恢复" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Battery only; resumes when charging"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "仅在使用电池供电时生效, 充电时自动恢复"
+ }
+ }
+ }
+ },
+ "任务中心" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Task Center"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务中心"
+ }
+ }
+ }
+ },
+ "任务完成或等待批准时触发触摸板震动" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Vibrate when tasks finish or await approval"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务完成或等待批准时触发触摸板震动"
+ }
+ }
+ }
+ },
+ "任务完成通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Task Completion"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务完成通知"
+ }
+ }
+ }
+ },
+ "任务时长" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Task Duration"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务时长"
+ }
+ }
+ }
+ },
+ "任务等待批准期间继续防止系统睡眠" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Prevent sleep while a task awaits approval"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务等待批准期间继续防止系统睡眠"
+ }
+ }
+ }
+ },
+ "任务等待通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Approval Requests"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务等待通知"
+ }
+ }
+ }
+ },
+ "任务触觉反馈" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Task Haptics"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "任务触觉反馈"
+ }
+ }
+ }
+ },
+ "会话总数" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sessions"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "会话总数"
+ }
+ }
+ }
+ },
+ "低电量保护" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Low Battery Cutoff"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "低电量保护"
+ }
+ }
+ }
+ },
+ "低电量保护通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Low Battery Alert"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "低电量保护通知"
+ }
+ }
+ }
+ },
+ "低额度阈值" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Low Quota Threshold"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "低额度阈值"
+ }
+ }
+ }
+ },
+ "保持屏幕常亮" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep Display Awake"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "保持屏幕常亮"
+ }
+ }
+ }
+ },
+ "全时累计" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Lifetime tokens"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "全时累计"
+ }
+ }
+ }
+ },
+ "关于" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "About"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "关于"
+ }
+ }
+ }
+ },
+ "关闭" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Close"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "关闭"
+ }
+ }
+ }
+ },
+ "最热模型" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Top model"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最热模型"
+ }
+ }
+ }
+ },
+ "最近同步" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Last Sync"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最近同步"
+ }
+ }
+ }
+ },
+ "最近同步: %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Last sync: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最近同步: %@"
+ }
+ }
+ }
+ },
+ "最近完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Recent Completions"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最近完成"
+ }
+ }
+ }
+ },
+ "最近完成 %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Completed: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最近完成 %lld"
+ }
+ }
+ }
+ },
+ "最近终止" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Recently Stopped"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最近终止"
+ }
+ }
+ }
+ },
+ "最近终止 %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Stopped: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最近终止 %lld"
+ }
+ }
+ }
+ },
+ "最长任务" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Longest chat"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最长任务"
+ }
+ }
+ }
+ },
+ "最长连胜" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Longest streak"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最长连胜"
+ }
+ }
+ }
+ },
+ "最长防睡眠时间" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep-Awake Limit"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "最长防睡眠时间"
+ }
+ }
+ }
+ },
+ "写入 Codex TUI 通知设置失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not update Codex TUI notification settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "写入 Codex TUI 通知设置失败"
+ }
+ }
+ }
+ },
+ "刚刚完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Just completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "刚刚完成"
+ }
+ }
+ }
+ },
+ "刚刚终止" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Just stopped"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "刚刚终止"
+ }
+ }
+ }
+ },
+ "初始化失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Initialization failed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "初始化失败"
+ }
+ }
+ }
+ },
+ "单日峰值" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peak tokens"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "单日峰值"
+ }
+ }
+ }
+ },
+ "压缩上下文" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Compacting context"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "压缩上下文"
+ }
+ }
+ }
+ },
+ "取消" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Cancel"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "取消"
+ }
+ }
+ }
+ },
+ "另有 %lld 个任务" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Other tasks: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "另有 %lld 个任务"
+ }
+ }
+ }
+ },
+ "可用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Available"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "可用"
+ }
+ }
+ }
+ },
+ "可用: %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%lld left"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "可用: %lld"
+ }
+ }
+ }
+ },
+ "同时阻止屏幕保护与自动锁屏" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Also prevent the screen saver and auto-lock"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "同时阻止屏幕保护与自动锁屏"
+ }
+ }
+ }
+ },
+ "同步不可用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sync unavailable"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "同步不可用"
+ }
+ }
+ }
+ },
+ "同步失败, 请稍后重试" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sync failed; try again later"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "同步失败, 请稍后重试"
+ }
+ }
+ }
+ },
+ "同步未开启" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sync is off"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "同步未开启"
+ }
+ }
+ }
+ },
+ "启动子智能体" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Starting subagent"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "启动子智能体"
+ }
+ }
+ }
+ },
+ "响应" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Response"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "响应"
+ }
+ }
+ }
+ },
+ "复制" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Copy"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "复制"
+ }
+ }
+ }
+ },
+ "复制完整%@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Copy Full %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "复制完整%@"
+ }
+ }
+ }
+ },
+ "子智能体" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Subagents"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "子智能体"
+ }
+ }
+ }
+ },
+ "子智能体完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Subagent completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "子智能体完成"
+ }
+ }
+ }
+ },
+ "完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "完成"
+ }
+ }
+ }
+ },
+ "对话轮次" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Turns"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "对话轮次"
+ }
+ }
+ }
+ },
+ "将从本机原始 Hook 事件重新统计 %@\n并在下次同步时替换当前设备对应日期的云端聚合" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Recalculate %@ from local Hook events.\nReplace this device's cloud data for those dates during the next sync."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "将从本机原始 Hook 事件重新统计 %@\n并在下次同步时替换当前设备对应日期的云端聚合"
+ }
+ }
+ }
+ },
+ "已关闭 Codex Hook, 清理信任状态失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Codex Hook was disabled, but its trust state could not be cleared"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已关闭 Codex Hook, 清理信任状态失败"
+ }
+ }
+ }
+ },
+ "已复制" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Copied"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已复制"
+ }
+ }
+ }
+ },
+ "已更新至 %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Updated to %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已更新至 %@"
+ }
+ }
+ }
+ },
+ "已等待 %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting for %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已等待 %@"
+ }
+ }
+ }
+ },
+ "已达到防睡眠时间上限 (%@)" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep-awake limit reached (%@)"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已达到防睡眠时间上限 (%@)"
+ }
+ }
+ }
+ },
+ "已运行 %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Running for %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已运行 %@"
+ }
+ }
+ }
+ },
+ "已选择 %lld 天" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Selected dates: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已选择 %lld 天"
+ }
+ }
+ }
+ },
+ "已重建 %lld 天, 包含 %lld 条数据" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rebuilt dates: %1$lld; events: %2$lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已重建 %1$lld 天, 包含 %2$lld 条数据"
+ }
+ }
+ }
+ },
+ "已防止系统睡眠" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "System sleep is prevented"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已防止系统睡眠"
+ }
+ }
+ }
+ },
+ "开机自动启动" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Launch at Login"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "开机自动启动"
+ }
+ }
+ }
+ },
+ "当前使用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In Use"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "当前使用"
+ }
+ }
+ }
+ },
+ "当前连胜" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Current streak"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "当前连胜"
+ }
+ }
+ }
+ },
+ "当有 Codex 任务运行时防止系统睡眠, 任务结束后自动恢复" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Prevent sleep while Codex tasks run; restore it when they finish"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "当有 Codex 任务运行时防止系统睡眠, 任务结束后自动恢复"
+ }
+ }
+ }
+ },
+ "快捷键已被占用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Shortcut is already in use"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "快捷键已被占用"
+ }
+ }
+ }
+ },
+ "恢复默认" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Restore Default"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "恢复默认"
+ }
+ }
+ }
+ },
+ "打开系统设置" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Open System Settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "打开系统设置"
+ }
+ }
+ }
+ },
+ "批量重建 %lld 天的数据?" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rebuild selected dates (%lld)?"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "批量重建 %lld 天的数据?"
+ }
+ }
+ }
+ },
+ "数据更新时间" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Updated"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "数据更新时间"
+ }
+ }
+ }
+ },
+ "无法识别该快捷键" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Shortcut not recognized"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "无法识别该快捷键"
+ }
+ }
+ }
+ },
+ "无法验证 Codex Hook: %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not verify Codex Hook: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "无法验证 Codex Hook: %@"
+ }
+ }
+ }
+ },
+ "无限" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Unlimited"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "无限"
+ }
+ }
+ }
+ },
+ "日志" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Log"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "日志"
+ }
+ }
+ }
+ },
+ "暂无 Codex 活动" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No Codex activity"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "暂无 Codex 活动"
+ }
+ }
+ }
+ },
+ "暂无同步记录" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No sync history"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "暂无同步记录"
+ }
+ }
+ }
+ },
+ "暂无数据" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No data"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "暂无数据"
+ }
+ }
+ }
+ },
+ "暂无日志" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No log entries"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "暂无日志"
+ }
+ }
+ }
+ },
+ "服务暂时不可用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Service temporarily unavailable"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "服务暂时不可用"
+ }
+ }
+ }
+ },
+ "未登录" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Not signed in"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未登录"
+ }
+ }
+ }
+ },
+ "未知过期时间" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Expiration time unavailable"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未知过期时间"
+ }
+ }
+ }
+ },
+ "未设置" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Not set"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未设置"
+ }
+ }
+ }
+ },
+ "未选择重建日期范围" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "No date range selected"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "未选择重建日期范围"
+ }
+ }
+ }
+ },
+ "权限请求" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Approvals"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "权限请求"
+ }
+ }
+ }
+ },
+ "检查更新" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Check for Updates"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "检查更新"
+ }
+ }
+ }
+ },
+ "正在同步" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Syncing"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "正在同步"
+ }
+ }
+ }
+ },
+ "正在思考" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Thinking"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "正在思考"
+ }
+ }
+ }
+ },
+ "正在运行" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Running"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "正在运行"
+ }
+ }
+ }
+ },
+ "清空" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Clear"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "清空"
+ }
+ }
+ }
+ },
+ "清除 APP 快捷键" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Clear App Shortcut"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "清除 APP 快捷键"
+ }
+ }
+ }
+ },
+ "点击复制" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Click to Copy"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "点击复制"
+ }
+ }
+ }
+ },
+ "用量强度" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Intensity"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "用量强度"
+ }
+ }
+ }
+ },
+ "电量过低, 已恢复系统睡眠" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Low battery; system sleep restored"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "电量过低, 已恢复系统睡眠"
+ }
+ }
+ }
+ },
+ "积分: %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Credits: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "积分: %@"
+ }
+ }
+ }
+ },
+ "立即更新" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Update Now"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "立即更新"
+ }
+ }
+ }
+ },
+ "等待 %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待 %lld"
+ }
+ }
+ }
+ },
+ "等待 %lld • 运行 %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting: %1$lld • Running: %2$lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待 %1$lld • 运行 %2$lld"
+ }
+ }
+ }
+ },
+ "等待下一步操作" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting for the next action"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待下一步操作"
+ }
+ }
+ }
+ },
+ "等待响应" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting for response"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待响应"
+ }
+ }
+ }
+ },
+ "等待批准" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting for approval"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待批准"
+ }
+ }
+ }
+ },
+ "等待批准时保持" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep Awake While Waiting"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待批准时保持"
+ }
+ }
+ }
+ },
+ "等待确认" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Waiting for Approval"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "等待确认"
+ }
+ }
+ }
+ },
+ "系统通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "System Notifications"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "系统通知"
+ }
+ }
+ }
+ },
+ "系统通知权限未开启" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Notifications are disabled in System Settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "系统通知权限未开启"
+ }
+ }
+ }
+ },
+ "网络不可用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Network unavailable"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "网络不可用"
+ }
+ }
+ }
+ },
+ "耗时 %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Duration: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "耗时 %@"
+ }
+ }
+ }
+ },
+ "自动检查更新" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Automatically Check for Updates"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "自动检查更新"
+ }
+ }
+ }
+ },
+ "菜单栏额度指示" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Menu Bar Quota Indicator"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "菜单栏额度指示"
+ }
+ }
+ }
+ },
+ "设置" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "设置"
+ }
+ }
+ }
+ },
+ "设置 Codex Hook 失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not configure Codex Hook"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "设置 Codex Hook 失败"
+ }
+ }
+ }
+ },
+ "设置开机启动失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not update the Launch at Login setting"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "设置开机启动失败"
+ }
+ }
+ }
+ },
+ "详情" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Details"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "详情"
+ }
+ }
+ }
+ },
+ "请求" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Request"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "请求"
+ }
+ }
+ }
+ },
+ "请设置快捷键" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Set Shortcut"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "请设置快捷键"
+ }
+ }
+ }
+ },
+ "读取 Codex Hook 配置失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not read the Codex Hook configuration"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "读取 Codex Hook 配置失败"
+ }
+ }
+ }
+ },
+ "读取 Codex TUI 通知设置失败" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Could not read Codex TUI notification settings"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "读取 Codex TUI 通知设置失败"
+ }
+ }
+ }
+ },
+ "调用工具" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Using tool"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "调用工具"
+ }
+ }
+ }
+ },
+ "调用工具 %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Using %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "调用工具 %@"
+ }
+ }
+ }
+ },
+ "调用工具 %@ 完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Finished using %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "调用工具 %@ 完成"
+ }
+ }
+ }
+ },
+ "调用工具完成" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tool call completed"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "调用工具完成"
+ }
+ }
+ }
+ },
+ "账号不可用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Account unavailable"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "账号不可用"
+ }
+ }
+ }
+ },
+ "跨设备同步" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sync Across Devices"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "跨设备同步"
+ }
+ }
+ }
+ },
+ "过期时间" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Expires"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "过期时间"
+ }
+ }
+ }
+ },
+ "运行 %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Running: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "运行 %lld"
+ }
+ }
+ }
+ },
+ "运行中" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Running"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "运行中"
+ }
+ }
+ }
+ },
+ "近 %lld 周" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Past %lld wk"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "近 %lld 周"
+ }
+ }
+ }
+ },
+ "进行" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In Progress"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "进行"
+ }
+ }
+ }
+ },
+ "退出" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quit"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "退出"
+ }
+ }
+ }
+ },
+ "退出 CodexBar" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quit CodexBar"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "退出 CodexBar"
+ }
+ }
+ }
+ },
+ "选择开始日期" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Select a start date"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "选择开始日期"
+ }
+ }
+ }
+ },
+ "选择日期范围" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Select Date Range"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "选择日期范围"
+ }
+ }
+ }
+ },
+ "选择结束日期" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Select an end date"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "选择结束日期"
+ }
+ }
+ }
+ },
+ "通用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "General"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "通用"
+ }
+ }
+ }
+ },
+ "通知音效" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Sound"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "通知音效"
+ }
+ }
+ }
+ },
+ "重建" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rebuild"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "重建"
+ }
+ }
+ }
+ },
+ "重建失败: %@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rebuild failed: %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "重建失败: %@"
+ }
+ }
+ }
+ },
+ "重建数据" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rebuild Data"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "重建数据"
+ }
+ }
+ }
+ },
+ "重置临期通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Expiring Reset Credits"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "重置临期通知"
+ }
+ }
+ }
+ },
+ "重置次数: %lld" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Reset credits: %lld"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "重置次数: %lld"
+ }
+ }
+ }
+ },
+ "错误" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Error"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "错误"
+ }
+ }
+ }
+ },
+ "防止系统睡眠" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Prevent System Sleep"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "防止系统睡眠"
+ }
+ }
+ }
+ },
+ "防睡眠上限通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep-Awake Limit"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "防睡眠上限通知"
+ }
+ }
+ }
+ },
+ "防睡眠时长超过阈值后自动恢复系统睡眠" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Re-enable sleep when the limit is reached"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "防睡眠时长超过阈值后自动恢复系统睡眠"
+ }
+ }
+ }
+ },
+ "需要启用 CodexBar Hook" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "CodexBar Hook must be enabled"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "需要启用 CodexBar Hook"
+ }
+ }
+ }
+ },
+ "需要授权允许 CodexBar 后台运行" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Allow CodexBar to run in the background"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "需要授权允许 CodexBar 后台运行"
+ }
+ }
+ }
+ },
+ "预览" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Preview"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "预览"
+ }
+ }
+ }
+ },
+ "预览完整%@" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Preview Full %@"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "预览完整%@"
+ }
+ }
+ }
+ },
+ "额度窗口" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quota Window"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "额度窗口"
+ }
+ }
+ }
+ },
+ "额度重置通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Quota Reset"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "额度重置通知"
+ }
+ }
+ }
+ },
+ "额度预警通知" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Low Quota"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "额度预警通知"
+ }
+ }
+ }
+ },
+ "高级" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Advanced"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "高级"
+ }
+ }
+ }
+ },
+ "默认快捷键 %@ 已被占用" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Default shortcut %@ is already in use"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "默认快捷键 %@ 已被占用"
+ }
+ }
+ }
+ }
+ },
+ "version" : "1.0"
+}
diff --git a/CodexBar/Services/CodexCLI/CodexCLIVersionService.swift b/CodexBar/Services/CodexCLI/CodexCLIVersionService.swift
index c57c417..55bd880 100644
--- a/CodexBar/Services/CodexCLI/CodexCLIVersionService.swift
+++ b/CodexBar/Services/CodexCLI/CodexCLIVersionService.swift
@@ -41,10 +41,16 @@ nonisolated struct CodexCLIVersionItem: Equatable, Identifiable {
var displayVersion: String {
if path == nil {
- return "未找到 \(source.displayName)"
+ return String(
+ localized: "codex-cli.version.not-found",
+ defaultValue: "未找到 \(source.displayName)"
+ )
}
- return version ?? errorMessage ?? "未知版本"
+ return version ?? errorMessage ?? String(
+ localized: "codex-cli.version.unknown",
+ defaultValue: "未知版本"
+ )
}
}
@@ -185,7 +191,7 @@ actor CodexCLIVersionService {
AppLog.codexCLI.error(
"版本检测失败: source=\(source.rawValue, privacy: .public); stage=launch; detail=\(error.localizedDescription, privacy: .public)"
)
- return CodexCLIVersionItem(source: source, path: path, errorMessage: "启动失败")
+ return failedVersionItem(source: source, path: path, failure: .launch)
}
defer {
process.terminationHandler = nil
@@ -198,7 +204,7 @@ actor CodexCLIVersionService {
errorCollector: errorCollector
)
AppLog.codexCLI.error("版本检测失败: source=\(source.rawValue, privacy: .public); stage=timeout")
- return CodexCLIVersionItem(source: source, path: path, errorMessage: "读取超时")
+ return failedVersionItem(source: source, path: path, failure: .timeout)
}
let output = collectedText(from: outputCollector, deadline: deadline)
@@ -208,12 +214,12 @@ actor CodexCLIVersionService {
AppLog.codexCLI.error(
"版本检测失败: source=\(source.rawValue, privacy: .public); stage=exit; exit=\(process.terminationStatus)"
)
- return CodexCLIVersionItem(source: source, path: path, errorMessage: "读取失败")
+ return failedVersionItem(source: source, path: path, failure: .read)
}
guard let version = firstLine(in: output) ?? firstLine(in: errorOutput) else {
AppLog.codexCLI.error("版本检测失败: source=\(source.rawValue, privacy: .public); stage=parse")
- return CodexCLIVersionItem(source: source, path: path, errorMessage: "版本未知")
+ return failedVersionItem(source: source, path: path, failure: .parse)
}
let displayVersion = CodexCLIVersionReader.displayVersion(from: version)
@@ -240,6 +246,14 @@ actor CodexCLIVersionService {
stopCollectors(outputCollector: outputCollector, errorCollector: errorCollector)
}
+ private static func failedVersionItem(
+ source: CodexCLIExecutableSource,
+ path: String,
+ failure: VersionProbeFailure
+ ) -> CodexCLIVersionItem {
+ CodexCLIVersionItem(source: source, path: path, errorMessage: failure.message)
+ }
+
private static func stopCollectors(outputCollector: PipeReadBuffer, errorCollector: PipeReadBuffer) {
_ = outputCollector.stopAndRead()
_ = errorCollector.stopAndRead()
@@ -257,6 +271,26 @@ actor CodexCLIVersionService {
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
.first { !$0.isEmpty }
}
+
+ private enum VersionProbeFailure {
+ case launch
+ case timeout
+ case read
+ case parse
+
+ var message: String {
+ switch self {
+ case .launch:
+ String(localized: "codex-cli.version.launch-failed", defaultValue: "启动失败")
+ case .timeout:
+ String(localized: "codex-cli.version.read-timeout", defaultValue: "读取超时")
+ case .read:
+ String(localized: "codex-cli.version.read-failed", defaultValue: "读取失败")
+ case .parse:
+ String(localized: "codex-cli.version.parse-failed", defaultValue: "版本未知")
+ }
+ }
+ }
}
/// 将 Process.terminationHandler 桥接成可超时等待的 async 结果
diff --git a/CodexBar/Services/CodexStatus/AppServerSession.swift b/CodexBar/Services/CodexStatus/AppServerSession.swift
index 06da35b..194554b 100644
--- a/CodexBar/Services/CodexStatus/AppServerSession.swift
+++ b/CodexBar/Services/CodexStatus/AppServerSession.swift
@@ -8,9 +8,18 @@ final nonisolated class AppServerSession {
private typealias EncodedMessage = (data: Data, text: String)
private typealias ResponseLine = (text: String, data: Data)
- private static let writeFailureMessage = "连接已断开, 无法发送请求"
- private static let responseConnectionClosedMessage = "连接已断开, 等待响应失败"
- private static let responseTimeoutMessage = "等待响应超时"
+ private static let writeFailureMessage = String(
+ localized: "request-log.error.write-connection-closed",
+ defaultValue: "连接已断开, 无法发送请求"
+ )
+ private static let responseConnectionClosedMessage = String(
+ localized: "request-log.error.response-connection-closed",
+ defaultValue: "连接已断开, 等待响应失败"
+ )
+ private static let responseTimeoutMessage = String(
+ localized: "request-log.error.response-timeout",
+ defaultValue: "等待响应超时"
+ )
private static let closeGracefulTimeout: TimeInterval = 1.0
private static let closeKillTimeout: TimeInterval = 0.5
@@ -49,9 +58,19 @@ final nonisolated class AppServerSession {
case .alreadyExited, .terminated:
break
case .killed:
- RequestLogStorage.shared.recordFailure(message: "app-server 退出超时, 已强制结束")
+ RequestLogStorage.shared.recordFailure(
+ message: String(
+ localized: "request-log.error.exit-timeout-killed",
+ defaultValue: "app-server 退出超时, 已强制结束"
+ )
+ )
case .stillRunning:
- RequestLogStorage.shared.recordFailure(message: "app-server 退出超时, 可能仍在后台运行")
+ RequestLogStorage.shared.recordFailure(
+ message: String(
+ localized: "request-log.error.exit-timeout-running",
+ defaultValue: "app-server 退出超时, 可能仍在后台运行"
+ )
+ )
}
}
}
diff --git a/CodexBar/Services/CodexStatus/CodexStatusService.swift b/CodexBar/Services/CodexStatus/CodexStatusService.swift
index 310be90..22f6c9b 100644
--- a/CodexBar/Services/CodexStatus/CodexStatusService.swift
+++ b/CodexBar/Services/CodexStatus/CodexStatusService.swift
@@ -552,7 +552,12 @@ actor CodexStatusService {
do {
try process.run()
} catch {
- RequestLogStorage.shared.recordFailure(message: "app-server 启动失败: \(error.localizedDescription)")
+ RequestLogStorage.shared.recordFailure(
+ message: String(
+ localized: "request-log.error.launch-failed",
+ defaultValue: "app-server 启动失败: \(error.localizedDescription)"
+ )
+ )
return .initializationFailed
}
let openedAt = Date()
@@ -609,7 +614,10 @@ actor CodexStatusService {
} catch {
// app-server 链路的细节按既有分工进日志窗口, 不重复写系统日志
RequestLogStorage.shared.recordFailure(
- message: "app-server 会话初始化失败: \(error.localizedDescription)"
+ message: String(
+ localized: "request-log.error.initialization-failed",
+ defaultValue: "app-server 会话初始化失败: \(error.localizedDescription)"
+ )
)
session.close()
return .initializationFailed
diff --git a/CodexBar/Services/KeepAlive/KeepAliveController.swift b/CodexBar/Services/KeepAlive/KeepAliveController.swift
index 7ca9fdb..5d3ab45 100644
--- a/CodexBar/Services/KeepAlive/KeepAliveController.swift
+++ b/CodexBar/Services/KeepAlive/KeepAliveController.swift
@@ -511,7 +511,7 @@ final class KeepAliveController: ObservableObject {
return
case .notRegistered, .notFound:
guard Self.helperAssetsArePresent else {
- registrationErrorMessage = "服务异常, 请重新安装 CodexBar"
+ registrationErrorMessage = KeepAliveLocalizedMessage.helperAssetsMissing
return
}
}
@@ -525,7 +525,7 @@ final class KeepAliveController: ObservableObject {
AppLog.keepAlive.error(
"Helper 注册失败: detail=\(error.localizedDescription, privacy: .public)"
)
- registrationErrorMessage = "注册服务失败"
+ registrationErrorMessage = KeepAliveLocalizedMessage.registrationFailed
}
}
@@ -578,7 +578,7 @@ final class KeepAliveController: ObservableObject {
AppLog.keepAlive.error(
"Helper 注册更新失败: detail=\(registrationError.localizedDescription, privacy: .public)"
)
- registrationErrorMessage = "更新服务失败"
+ registrationErrorMessage = KeepAliveLocalizedMessage.updateFailed
}
assign(false, to: \.isRefreshingHelper)
@@ -773,7 +773,7 @@ final class KeepAliveController: ObservableObject {
let result = systemSleepService.beginPreventingIdleSleep()
guard result == kIOReturnSuccess else {
AppLog.keepAlive.error("空闲断言建立失败: code=\(result)")
- operationErrorMessage = "防止空闲睡眠失败"
+ operationErrorMessage = KeepAliveLocalizedMessage.preventIdleSleepFailed
scheduleRetryIfNeeded(for: true)
return
}
@@ -819,7 +819,7 @@ final class KeepAliveController: ObservableObject {
// invalidateConnection 会连同 assertion 一起收
self.invalidateConnection()
AppLog.keepAlive.error("系统睡眠切换失败: generation=\(generation); exit=\(exitCode)")
- self.operationErrorMessage = "切换睡眠状态失败"
+ self.operationErrorMessage = KeepAliveLocalizedMessage.toggleSleepFailed
self.scheduleRetryIfNeeded(for: disabled)
return
}
@@ -864,7 +864,7 @@ final class KeepAliveController: ObservableObject {
let idleSleepResult = systemSleepService.endPreventingIdleSleep()
if idleSleepResult != kIOReturnSuccess {
AppLog.keepAlive.error("空闲断言释放失败: code=\(idleSleepResult)")
- operationErrorMessage = "恢复空闲睡眠策略失败"
+ operationErrorMessage = KeepAliveLocalizedMessage.restoreIdleSleepFailed
}
let sleepDisabled = sleepDisabledAfterOperation ? 1 : 0
@@ -902,7 +902,7 @@ final class KeepAliveController: ObservableObject {
let result = SystemSleepService.requestSystemSleep()
if result != kIOReturnSuccess {
AppLog.keepAlive.error("睡眠补发失败: code=\(result)")
- operationErrorMessage = "请求系统睡眠失败"
+ operationErrorMessage = KeepAliveLocalizedMessage.requestSystemSleepFailed
}
}
@@ -948,7 +948,7 @@ final class KeepAliveController: ObservableObject {
AppLog.keepAlive.error(
"Helper XPC 连接失败: detail=\(error.localizedDescription, privacy: .public)"
)
- operationErrorMessage = "连接服务失败"
+ operationErrorMessage = KeepAliveLocalizedMessage.connectionFailed
if shouldRetry {
scheduleRetryIfNeeded(for: desiredSleepDisabled)
}
@@ -972,7 +972,7 @@ final class KeepAliveController: ObservableObject {
)
// 连接已经不可信, 收掉它再走既有的重试阶梯, 与切换失败同一条路径
invalidateConnection()
- operationErrorMessage = "服务无响应"
+ operationErrorMessage = KeepAliveLocalizedMessage.noResponse
scheduleRetryIfNeeded(for: disabled)
}
}
@@ -1075,7 +1075,7 @@ final class KeepAliveController: ObservableObject {
AppLog.keepAlive.error(
"KeepAlive 切换重试已放弃: attempts=\(Self.sleepToggleRetryDelays.count)"
)
- operationErrorMessage = "防睡眠多次失败, 已停止重试"
+ operationErrorMessage = KeepAliveLocalizedMessage.retryLimitReached
return
}
@@ -1239,16 +1239,67 @@ final class KeepAliveController: ObservableObject {
}
}
-private enum KeepAliveError: LocalizedError {
+private nonisolated enum KeepAliveLocalizedMessage {
+ static let helperAssetsMissing = String(
+ localized: "keep-alive.error.helper-assets-missing",
+ defaultValue: "服务异常, 请重新安装 CodexBar"
+ )
+ static let registrationFailed = String(
+ localized: "keep-alive.error.registration-failed",
+ defaultValue: "注册服务失败"
+ )
+ static let updateFailed = String(
+ localized: "keep-alive.error.update-failed",
+ defaultValue: "更新服务失败"
+ )
+ static let preventIdleSleepFailed = String(
+ localized: "keep-alive.error.prevent-idle-sleep-failed",
+ defaultValue: "防止空闲睡眠失败"
+ )
+ static let toggleSleepFailed = String(
+ localized: "keep-alive.error.toggle-sleep-failed",
+ defaultValue: "切换睡眠状态失败"
+ )
+ static let restoreIdleSleepFailed = String(
+ localized: "keep-alive.error.restore-idle-sleep-failed",
+ defaultValue: "恢复空闲睡眠策略失败"
+ )
+ static let requestSystemSleepFailed = String(
+ localized: "keep-alive.error.request-system-sleep-failed",
+ defaultValue: "请求系统睡眠失败"
+ )
+ static let connectionFailed = String(
+ localized: "keep-alive.error.connection-failed",
+ defaultValue: "连接服务失败"
+ )
+ static let noResponse = String(
+ localized: "keep-alive.error.no-response",
+ defaultValue: "服务无响应"
+ )
+ static let retryLimitReached = String(
+ localized: "keep-alive.error.retry-limit-reached",
+ defaultValue: "防睡眠多次失败, 已停止重试"
+ )
+ static let invalidHelperInterface = String(
+ localized: "keep-alive.error.invalid-helper-interface",
+ defaultValue: "服务接口无效"
+ )
+ static let connectionInterrupted = String(
+ localized: "keep-alive.error.connection-interrupted",
+ defaultValue: "服务连接中断"
+ )
+}
+
+private nonisolated enum KeepAliveError: LocalizedError {
case invalidHelperProxy
case connectionInterrupted
var errorDescription: String? {
switch self {
case .invalidHelperProxy:
- "服务接口无效"
+ KeepAliveLocalizedMessage.invalidHelperInterface
case .connectionInterrupted:
- "服务连接中断"
+ KeepAliveLocalizedMessage.connectionInterrupted
}
}
}
diff --git a/CodexBar/Services/KeepAlive/KeepAliveModels.swift b/CodexBar/Services/KeepAlive/KeepAliveModels.swift
index 7f661de..0a7eca9 100644
--- a/CodexBar/Services/KeepAlive/KeepAliveModels.swift
+++ b/CodexBar/Services/KeepAlive/KeepAliveModels.swift
@@ -16,7 +16,9 @@ extension KeepAliveController {
}
var title: String {
- self == .off ? "关闭" : "\(rawValue)%"
+ self == .off
+ ? String(localized: "keep-alive.low-battery.off", defaultValue: "关闭")
+ : CodexPercentageFormat.string(from: rawValue)
}
/// nil 表示不启用保护
@@ -39,22 +41,18 @@ extension KeepAliveController {
}
var title: String {
- switch self {
- case .oneHour:
- "1 小时"
- case .twoHours:
- "2 小时"
- case .fourHours:
- "4 小时"
- case .eightHours:
- "8 小时"
- case .twelveHours:
- "12 小时"
- case .twentyFourHours:
- "24 小时"
- case .unlimited:
- "无限制"
+ guard self != .unlimited else {
+ return String(
+ localized: "keep-alive.duration.unlimited",
+ defaultValue: "无限制"
+ )
}
+
+ let hours = rawValue / 3600
+ return String(
+ localized: "keep-alive.duration.hours",
+ defaultValue: "\(hours) 小时"
+ )
}
/// 日志用的小时数, 与 LowBatteryThreshold 的百分比同一种可读形式, 无限制同样记 -1
diff --git a/CodexBar/Services/Notifications/CodexNotificationService.swift b/CodexBar/Services/Notifications/CodexNotificationService.swift
index 71c28fa..2511345 100644
--- a/CodexBar/Services/Notifications/CodexNotificationService.swift
+++ b/CodexBar/Services/Notifications/CodexNotificationService.swift
@@ -655,10 +655,17 @@ nonisolated struct CodexNotificationContent: Equatable {
windowLabel: String,
thresholdPercent: Int
) -> CodexNotificationContent {
- CodexNotificationContent(
+ let thresholdText = CodexPercentageFormat.string(from: thresholdPercent)
+ return CodexNotificationContent(
kind: "lowQuota",
- title: "Codex 额度不足",
- body: "\(limitTitle) \(windowLabel) 剩余额度已低于 \(thresholdPercent)%"
+ title: String(
+ localized: "notification.low-quota.title",
+ defaultValue: "Codex 额度不足"
+ ),
+ body: String(
+ localized: "notification.low-quota.body",
+ defaultValue: "\(limitTitle) \(windowLabel) 剩余额度已低于 \(thresholdText)"
+ )
)
}
@@ -668,51 +675,116 @@ nonisolated struct CodexNotificationContent: Equatable {
) -> CodexNotificationContent {
CodexNotificationContent(
kind: "quotaReset",
- title: "额度已重置",
- body: "\(limitTitle) \(windowLabel)"
+ title: String(
+ localized: "notification.quota-reset.title",
+ defaultValue: "额度已重置"
+ ),
+ body: String(
+ localized: "notification.quota-reset.body",
+ defaultValue: "\(limitTitle) \(windowLabel)"
+ )
)
}
static func taskCompleted(project: String?, duration: TimeInterval) -> CodexNotificationContent {
- let projectText = project.map { "「\($0)」" } ?? "Codex"
+ let durationText = CodexActivityDisplayFormat.elapsedDurationFragment(for: duration)
+ let body = if let project {
+ String(
+ localized: "notification.task-completed.body.project",
+ defaultValue: "「\(project)」任务完成, \(durationText)"
+ )
+ } else {
+ String(
+ localized: "notification.task-completed.body.codex",
+ defaultValue: "Codex 任务完成, \(durationText)"
+ )
+ }
+
return CodexNotificationContent(
kind: "longTask",
- title: "Codex 任务完成",
- body: "\(projectText) 任务完成, \(CodexActivityDisplayFormat.elapsedDurationFragment(for: duration))"
+ title: String(
+ localized: "notification.task-completed.title",
+ defaultValue: "Codex 任务完成"
+ ),
+ body: body
)
}
static func taskWaiting(project: String?, toolName: String?) -> CodexNotificationContent {
- let subject = project.map { "「\($0)」" } ?? "Codex"
- let action = toolName.map { "\($0) 操作" } ?? "下一步操作"
+ let body = switch (project, toolName) {
+ case let (project?, toolName?):
+ String(
+ localized: "notification.task-waiting.body.project-tool",
+ defaultValue: "「\(project)」正在等待批准 \(toolName) 操作"
+ )
+ case let (project?, nil):
+ String(
+ localized: "notification.task-waiting.body.project",
+ defaultValue: "「\(project)」正在等待批准下一步操作"
+ )
+ case let (nil, toolName?):
+ String(
+ localized: "notification.task-waiting.body.codex-tool",
+ defaultValue: "Codex 正在等待批准 \(toolName) 操作"
+ )
+ case (nil, nil):
+ String(
+ localized: "notification.task-waiting.body.codex",
+ defaultValue: "Codex 正在等待批准下一步操作"
+ )
+ }
+
return CodexNotificationContent(
kind: "taskWaiting",
- title: "Codex 等待批准",
- body: "\(subject) 正在等待批准 \(action)"
+ title: String(
+ localized: "notification.task-waiting.title",
+ defaultValue: "Codex 等待批准"
+ ),
+ body: body
)
}
static func creditExpiry(count: Int, expirationDate: Date) -> CodexNotificationContent {
- CodexNotificationContent(
+ let expirationText = CodexDateFormat.localDisplayString(from: expirationDate)
+ return CodexNotificationContent(
kind: "creditExpiry",
- title: "重置即将过期",
- body: "有 \(count) 个重置次数将于 \(CodexDateFormat.localDisplayString(from: expirationDate)) 过期"
+ title: String(
+ localized: "notification.credit-expiry.title",
+ defaultValue: "重置即将过期"
+ ),
+ body: String(
+ localized: "notification.credit-expiry.body",
+ defaultValue: "有 \(count) 个重置次数将于 \(expirationText) 过期"
+ )
)
}
static func lowBattery(percent: Int) -> CodexNotificationContent {
- CodexNotificationContent(
+ let percentText = CodexPercentageFormat.string(from: percent)
+ return CodexNotificationContent(
kind: "lowBattery",
- title: "已恢复系统睡眠",
- body: "电量剩余 \(percent)%, 已停止防睡眠"
+ title: String(
+ localized: "notification.keep-alive-ended.title",
+ defaultValue: "已恢复系统睡眠"
+ ),
+ body: String(
+ localized: "notification.keep-alive-ended.low-battery",
+ defaultValue: "电量剩余 \(percentText), 已停止防睡眠"
+ )
)
}
static func keepAliveLimit(durationText: String) -> CodexNotificationContent {
CodexNotificationContent(
kind: "keepAliveLimit",
- title: "已恢复系统睡眠",
- body: "已达防睡眠上限 \(durationText), 已停止防睡眠"
+ title: String(
+ localized: "notification.keep-alive-ended.title",
+ defaultValue: "已恢复系统睡眠"
+ ),
+ body: String(
+ localized: "notification.keep-alive-ended.duration-limit",
+ defaultValue: "已达防睡眠上限 \(durationText), 已停止防睡眠"
+ )
)
}
}
diff --git a/CodexBar/Services/Notifications/NotificationSoundOption.swift b/CodexBar/Services/Notifications/NotificationSoundOption.swift
index 8e3a5be..9074f2f 100644
--- a/CodexBar/Services/Notifications/NotificationSoundOption.swift
+++ b/CodexBar/Services/Notifications/NotificationSoundOption.swift
@@ -10,6 +10,17 @@ struct NotificationSoundOption: Identifiable, Hashable {
let title: String
private let source: SoundSource
+ var localizedTitle: String {
+ switch source {
+ case .silent:
+ String(localized: "notification.sound.silent", defaultValue: "静音")
+ case .systemDefault:
+ String(localized: "notification.sound.default", defaultValue: "默认")
+ case .system, .bundled:
+ title
+ }
+ }
+
static let silent = NotificationSoundOption(id: "silent", title: "静音", source: .silent)
static let systemDefault = NotificationSoundOption(
id: "systemDefault",
diff --git a/CodexBar/Services/Settings/CodexCLINotificationSettings.swift b/CodexBar/Services/Settings/CodexCLINotificationSettings.swift
index 6b7d1d1..bdf3368 100644
--- a/CodexBar/Services/Settings/CodexCLINotificationSettings.swift
+++ b/CodexBar/Services/Settings/CodexCLINotificationSettings.swift
@@ -68,8 +68,8 @@ final class CodexCLINotificationSettings: ObservableObject {
var errorPrefix: String {
switch self {
- case .read: "读取 Codex TUI 通知设置失败"
- case .write: "写入 Codex TUI 通知设置失败"
+ case .read: String(localized: "读取 Codex TUI 通知设置失败")
+ case .write: String(localized: "写入 Codex TUI 通知设置失败")
}
}
@@ -143,7 +143,7 @@ final class CodexCLINotificationSettings: ObservableObject {
case verificationFailed
var errorDescription: String? {
- "Codex TUI 通知状态与设置不一致"
+ String(localized: "Codex TUI 通知状态与设置不一致")
}
}
diff --git a/CodexBar/Services/Settings/CodexHookSettings.swift b/CodexBar/Services/Settings/CodexHookSettings.swift
index bd491c5..f45a0f0 100644
--- a/CodexBar/Services/Settings/CodexHookSettings.swift
+++ b/CodexBar/Services/Settings/CodexHookSettings.swift
@@ -78,7 +78,7 @@ final class CodexHookSettings: ObservableObject {
AppLog.hooks.error(
"Hook 读取失败: detail=\(error.localizedDescription, privacy: .public); action=keepLastKnown"
)
- readErrorMessage = "读取 Codex Hook 配置失败"
+ readErrorMessage = String(localized: "读取 Codex Hook 配置失败")
}
}
@@ -162,7 +162,7 @@ final class CodexHookSettings: ObservableObject {
}
// 这一支是"验不了"而不是"确认不通", isVerified 保留上次的值
- operationErrorMessage = "无法验证 Codex Hook: \(error.localizedDescription)"
+ operationErrorMessage = String(localized: "无法验证 Codex Hook: \(error.localizedDescription)")
}
}
@@ -245,7 +245,7 @@ final class CodexHookSettings: ObservableObject {
"Hook 写入失败: detail=\(error.localizedDescription, privacy: .public)"
)
refresh()
- operationErrorMessage = "设置 Codex Hook 失败"
+ operationErrorMessage = String(localized: "设置 Codex Hook 失败")
}
}
}
@@ -293,9 +293,9 @@ private extension CodexHookSettings {
var errorDescription: String? {
switch self {
case .invalidFormat:
- "hooks.json 文件格式错误"
+ String(localized: "hooks.json 文件格式错误")
case .hooksGloballyDisabled:
- "Codex 配置已禁用 Hook"
+ String(localized: "Codex 配置已禁用 Hook")
case let .hookValidationFailed(message):
message
}
@@ -423,7 +423,7 @@ private extension CodexHookSettings {
AppLog.hooks.error(
"Hook 信任清理失败: stage=discovery; detail=\(discoveryError.localizedDescription, privacy: .public)"
)
- operationErrorMessage = "已关闭 Codex Hook, 清理信任状态失败"
+ operationErrorMessage = String(localized: "已关闭 Codex Hook, 清理信任状态失败")
} else {
operationErrorMessage = nil
}
@@ -437,7 +437,7 @@ private extension CodexHookSettings {
AppLog.hooks.error(
"Hook 信任清理失败: stage=remove; detail=\(error.localizedDescription, privacy: .public)"
)
- operationErrorMessage = "已关闭 Codex Hook, 清理信任状态失败"
+ operationErrorMessage = String(localized: "已关闭 Codex Hook, 清理信任状态失败")
}
}
@@ -598,7 +598,7 @@ private extension CodexHookSettings {
hooksURL: URL
) -> String? {
guard !response.data.isEmpty else {
- return "Codex 没有返回任何结果"
+ return String(localized: "Codex 没有返回任何结果")
}
let entries = response.data
@@ -628,22 +628,22 @@ private extension CodexHookSettings {
}
if !errors.isEmpty {
- return "Codex 返回错误"
+ return String(localized: "Codex 返回错误")
}
if hasDisabledHook {
- return "CodexBar Hook 已被禁用"
+ return String(localized: "CodexBar Hook 已被禁用")
}
if hasUntrustedHook {
- return "CodexBar Hook 未被信任"
+ return String(localized: "CodexBar Hook 未被信任")
}
if hasMissingEvent {
- return "CodexBar Hook 已不完整"
+ return String(localized: "CodexBar Hook 已不完整")
}
if hasUnexpectedSource {
- return "CodexBar Hook 意外来源"
+ return String(localized: "CodexBar Hook 意外来源")
}
if !warnings.isEmpty {
- return "Codex 返回警告"
+ return String(localized: "Codex 返回警告")
}
return nil
diff --git a/CodexBar/Services/Settings/LoginItemSettings.swift b/CodexBar/Services/Settings/LoginItemSettings.swift
index 7802703..9df1534 100644
--- a/CodexBar/Services/Settings/LoginItemSettings.swift
+++ b/CodexBar/Services/Settings/LoginItemSettings.swift
@@ -30,7 +30,7 @@ final class LoginItemSettings: ObservableObject {
"开机自动启动失败: enabled=\(enabled ? 1 : 0); detail=\(error.localizedDescription, privacy: .public)"
)
refresh()
- errorMessage = "设置开机启动失败"
+ errorMessage = String(localized: "设置开机启动失败")
}
}
}
diff --git a/CodexBar/Services/Settings/MenuBarQuotaSettings.swift b/CodexBar/Services/Settings/MenuBarQuotaSettings.swift
index cda228b..ba64c24 100644
--- a/CodexBar/Services/Settings/MenuBarQuotaSettings.swift
+++ b/CodexBar/Services/Settings/MenuBarQuotaSettings.swift
@@ -136,7 +136,14 @@ nonisolated enum MenuBarQuotaSelection: String, Identifiable {
}
var fallbackTitle: String {
- rawValue
+ switch self {
+ case .off:
+ String(localized: "menu-bar-quota.selection.off", defaultValue: "关闭")
+ case .primary:
+ String(localized: "menu-bar-quota.selection.primary", defaultValue: "主额度")
+ case .secondary:
+ String(localized: "menu-bar-quota.selection.secondary", defaultValue: "次额度")
+ }
}
var windowKind: QuotaWindowKind? {
diff --git a/CodexBar/Services/Settings/WorkflowSyncSettings.swift b/CodexBar/Services/Settings/WorkflowSyncSettings.swift
index 671c905..108d5cb 100644
--- a/CodexBar/Services/Settings/WorkflowSyncSettings.swift
+++ b/CodexBar/Services/Settings/WorkflowSyncSettings.swift
@@ -93,7 +93,7 @@ final class WorkflowSyncSettings: ObservableObject {
}
var unavailableMessage: String? {
- syncAvailability.isUnavailable ? "同步不可用" : nil
+ syncAvailability.isUnavailable ? String(localized: "同步不可用") : nil
}
var lastUploadAtText: String? {
@@ -284,13 +284,13 @@ nonisolated enum WorkflowSyncFailureReason: String {
var message: String {
switch self {
case .networkUnavailable:
- "网络不可用"
+ String(localized: "网络不可用")
case .accountUnavailable:
- "账号不可用"
+ String(localized: "账号不可用")
case .serviceUnavailable:
- "服务暂时不可用"
+ String(localized: "服务暂时不可用")
case .retryLater:
- "同步失败, 请稍后重试"
+ String(localized: "同步失败, 请稍后重试")
}
}
}
diff --git a/CodexBar/Services/Updates/AppUpdater.swift b/CodexBar/Services/Updates/AppUpdater.swift
index b2907d1..ed6e4e5 100644
--- a/CodexBar/Services/Updates/AppUpdater.swift
+++ b/CodexBar/Services/Updates/AppUpdater.swift
@@ -21,7 +21,10 @@ final class AppUpdater: NSObject, ObservableObject {
private var isManualCheckInProgress = false
private var manualCheckTimeoutTask: Task<Void, Never>?
- private static let missingUpdateConfigurationMessage = "未配置更新资源"
+ private static let missingUpdateConfigurationMessage = String(
+ localized: "updater.status.missing-configuration",
+ defaultValue: "未配置更新资源"
+ )
/// Sparkle 可能既不回调 didFindValidUpdate / didNotFindUpdate 也不回调 didAbortWithError
/// (后台检查已在进行, 或 feed 请求被放弃), 超时复位避免永久停留在手动检查态
private static let manualCheckTimeout = Duration.seconds(30)
@@ -57,7 +60,9 @@ final class AppUpdater: NSObject, ObservableObject {
AppLog.app.notice("更新检查开始: trigger=\(LogTrigger.manual.rawValue, privacy: .public)")
beginManualCheck()
- showSettingsStatusMessage("正在检查更新")
+ showSettingsStatusMessage(
+ String(localized: "updater.status.checking", defaultValue: "正在检查更新")
+ )
updaterController.updater.checkForUpdateInformation()
}
@@ -145,10 +150,13 @@ final class AppUpdater: NSObject, ObservableObject {
extension AppUpdater: SPUUpdaterDelegate {
func updater(_: SPUUpdater, didFindValidUpdate item: SUAppcastItem) {
- let message = "发现新版本: v\(item.displayVersionString)"
+ let version = item.displayVersionString
+ let message = String(
+ localized: "updater.status.update-available",
+ defaultValue: "发现新版本: v\(version)"
+ )
availableUpdateMessage = message
let trigger = checkTrigger.rawValue
- let version = item.displayVersionString
AppLog.app.notice(
"更新检查完成: trigger=\(trigger, privacy: .public); result=available; version=\(version, privacy: .public)"
)
@@ -171,7 +179,10 @@ extension AppUpdater: SPUUpdaterDelegate {
)
if isManualCheckInProgress {
- showSettingsStatusMessage("没有可用更新", autoDismissDelay: .milliseconds(1000))
+ showSettingsStatusMessage(
+ String(localized: "updater.status.up-to-date", defaultValue: "没有可用更新"),
+ autoDismissDelay: .milliseconds(1000)
+ )
}
finishManualCheck()
@@ -191,7 +202,9 @@ extension AppUpdater: SPUUpdaterDelegate {
return
}
- showSettingsStatusMessage("检查更新失败")
+ showSettingsStatusMessage(
+ String(localized: "updater.status.check-failed", defaultValue: "检查更新失败")
+ )
finishManualCheck()
}
}
diff --git a/CodexBar/Services/Workflow/WorkflowService.swift b/CodexBar/Services/Workflow/WorkflowService.swift
index 7bd888c..5a83ed7 100644
--- a/CodexBar/Services/Workflow/WorkflowService.swift
+++ b/CodexBar/Services/Workflow/WorkflowService.swift
@@ -1370,9 +1370,15 @@ private nonisolated enum WorkflowDataRebuildError: LocalizedError {
var errorDescription: String? {
switch self {
case .sourceUnavailable:
- "没有可重建的本地数据"
+ String(
+ localized: "workflow.rebuild.error.source-unavailable",
+ defaultValue: "没有可重建的本地数据"
+ )
case .sourceChanged:
- "本地数据发生变化, 请重试"
+ String(
+ localized: "workflow.rebuild.error.source-changed",
+ defaultValue: "本地数据发生变化, 请重试"
+ )
}
}
}
diff --git a/CodexBar/Views/Log/LogView.swift b/CodexBar/Views/Log/LogView.swift
index 7fc43bc..4fc581f 100644
--- a/CodexBar/Views/Log/LogView.swift
+++ b/CodexBar/Views/Log/LogView.swift
@@ -29,7 +29,7 @@ struct LogView: View {
Text("Codex app-server 日志")
.font(.headline)
- Text("\(entries.count)")
+ Text(verbatim: "\(entries.count)")
.font(.caption.monospacedDigit())
.foregroundStyle(.secondary)
.padding(.horizontal, 7)
@@ -97,7 +97,12 @@ private struct LogRow: View {
if isExpanded {
VStack(alignment: .leading, spacing: 8) {
if let request = entry.request {
- payloadBlock(caption: "请求", time: entry.requestedAt, text: request, color: .primary)
+ payloadBlock(
+ caption: "请求",
+ time: entry.requestedAt,
+ text: request,
+ color: .primary
+ )
}
if let detail = entry.detail {
@@ -108,7 +113,7 @@ private struct LogRow: View {
color: entry.kind == .failure ? .red : .primary
)
} else if entry.kind == .pending {
- Text("等待响应…")
+ Text("等待响应")
.font(.caption.monospaced())
.foregroundStyle(.secondary)
}
@@ -166,7 +171,13 @@ private struct LogRow: View {
.contentShape(Rectangle())
}
- private func payloadBlock(caption: String, time: Date?, text: String, color: Color) -> some View {
+ private func payloadBlock(
+ caption: LocalizedStringResource,
+ time: Date?,
+ text: String,
+ color: Color
+ ) -> some View {
+ let caption = String(localized: caption)
let hasText = !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
let displayText = RequestLogEntry.singleLinePreview(
text,
@@ -189,7 +200,7 @@ private struct LogRow: View {
LogHeaderActionButton(
title: "预览",
systemImage: "doc.text.magnifyingglass",
- help: "预览完整\(caption)"
+ help: String(localized: "预览完整\(caption)")
) {
fullTextItem = FullLogTextItem(title: caption, text: text)
}
@@ -197,7 +208,7 @@ private struct LogRow: View {
LogHeaderActionButton(
title: "复制",
systemImage: "doc.on.doc",
- help: "复制完整\(caption)"
+ help: String(localized: "复制完整\(caption)")
) {
PasteboardWriter.copy(text)
}
@@ -216,7 +227,7 @@ private struct LogRow: View {
}
}
- private var detailCaption: String {
+ private var detailCaption: LocalizedStringResource {
switch entry.kind {
case .response, .emptyResponse:
"响应"
@@ -246,7 +257,7 @@ private struct FullLogTextItem: Identifiable {
/// 复制/预览按钮的统一样式入口
private struct LogHeaderActionButton: View {
- let title: String
+ let title: LocalizedStringResource
let systemImage: String
let help: String
let action: () -> Void
@@ -276,7 +287,7 @@ private struct FullLogTextView: View {
Text(item.title)
.font(.headline)
- Text("\(item.text.count)")
+ Text(verbatim: "\(item.text.count)")
.font(.caption.monospacedDigit())
.foregroundStyle(.secondary)
@@ -514,7 +525,7 @@ private struct LogCodePreviewView: NSViewRepresentable {
}
private extension RequestLogEntry.Kind {
- var label: String {
+ var label: LocalizedStringResource {
switch self {
case .pending:
"进行"
diff --git a/CodexBar/Views/Menu/CodexActivityCard.swift b/CodexBar/Views/Menu/CodexActivityCard.swift
index 383d4e8..543ee1c 100644
--- a/CodexBar/Views/Menu/CodexActivityCard.swift
+++ b/CodexBar/Views/Menu/CodexActivityCard.swift
@@ -86,7 +86,7 @@ struct CodexActivityCard: View {
}
if content.otherTaskCount > 0 {
- Text("+\(content.otherTaskCount)")
+ Text(verbatim: "+\(content.otherTaskCount)")
.font(.caption2.monospacedDigit().weight(.semibold))
// 必须是具体 Color, 层级样式在 numericText 的过渡层里会被重新解析成别的层级
.foregroundStyle(Color.codexSecondaryLabel)
@@ -191,7 +191,9 @@ struct CodexActivityCard: View {
return ActivityCardContent(
symbolName: "moon.zzz.fill",
tint: .secondary,
- title: showsUnavailableState ? "暂无数据" : "暂无 Codex 活动",
+ title: showsUnavailableState
+ ? String(localized: "暂无数据")
+ : String(localized: "暂无 Codex 活动"),
detail: nil,
otherTaskCount: 0
)
@@ -202,14 +204,14 @@ struct CodexActivityCard: View {
modelName: String?,
effort: String?,
projectName: String?,
- fallback: String
+ fallback: LocalizedStringResource
) -> String {
[
CodexActivityDisplayFormat.modelMetadata(
modelName: modelName,
effort: effort
),
- projectName ?? fallback
+ projectName ?? String(localized: fallback)
]
.compactMap(\.self)
.joined(separator: " • ")
@@ -223,7 +225,7 @@ struct CodexActivityCard: View {
return components
}
var result = components
- result.insert("\(count) 个子 Agent", at: min(1, result.count))
+ result.insert(String(localized: "\(count) 个子 Agent"), at: min(1, result.count))
return result
}
diff --git a/CodexBar/Views/Menu/CodexActivityCenterView.swift b/CodexBar/Views/Menu/CodexActivityCenterView.swift
index f1d6ae1..cd8ee5a 100644
--- a/CodexBar/Views/Menu/CodexActivityCenterView.swift
+++ b/CodexBar/Views/Menu/CodexActivityCenterView.swift
@@ -156,17 +156,21 @@ struct CodexActivityCenterView: View {
let snapshot = activityMonitor.snapshot
var components = [String]()
if snapshot.waitingCount > 0 {
- components.append("等待 \(snapshot.waitingCount)")
+ components.append(String(localized: "等待 \(snapshot.waitingCount)"))
}
if snapshot.runningCount > 0 {
- components.append("运行 \(snapshot.runningCount)")
+ components.append(String(localized: "运行 \(snapshot.runningCount)"))
}
if snapshot.activeCount == 0 {
if !snapshot.recentCompletions.isEmpty {
- components.append("最近完成 \(snapshot.recentCompletions.count)")
+ components.append(
+ String(localized: "最近完成 \(snapshot.recentCompletions.count)")
+ )
}
if !snapshot.recentTerminations.isEmpty {
- components.append("最近终止 \(snapshot.recentTerminations.count)")
+ components.append(
+ String(localized: "最近终止 \(snapshot.recentTerminations.count)")
+ )
}
}
return components.joined(separator: " • ")
@@ -175,7 +179,7 @@ struct CodexActivityCenterView: View {
// MARK: - 分区与行
private func taskSection(
- title: String,
+ title: LocalizedStringResource,
symbolName: String,
tint: Color,
tasks: [CodexActivityTaskSnapshot],
@@ -196,7 +200,10 @@ struct CodexActivityCenterView: View {
}
private func completionSection(now: Date) -> some View {
- section(title: "最近完成", count: activityMonitor.snapshot.recentCompletions.count) {
+ section(
+ title: "最近完成",
+ count: activityMonitor.snapshot.recentCompletions.count
+ ) {
ForEach(activityMonitor.snapshot.recentCompletions) { completion in
completionRow(completion, now: now)
}
@@ -204,7 +211,10 @@ struct CodexActivityCenterView: View {
}
private func terminationSection(now: Date) -> some View {
- section(title: "最近终止", count: activityMonitor.snapshot.recentTerminations.count) {
+ section(
+ title: "最近终止",
+ count: activityMonitor.snapshot.recentTerminations.count
+ ) {
ForEach(activityMonitor.snapshot.recentTerminations) { termination in
terminationRow(termination, now: now)
}
@@ -212,7 +222,7 @@ struct CodexActivityCenterView: View {
}
private func section(
- title: String,
+ title: LocalizedStringResource,
count: Int,
@ViewBuilder content: () -> some View
) -> some View {
@@ -222,7 +232,7 @@ struct CodexActivityCenterView: View {
.font(.caption2.weight(.semibold))
.foregroundStyle(.secondary)
- Text("\(count)")
+ Text(verbatim: "\(count)")
.font(.caption2.monospacedDigit())
.foregroundStyle(.tertiary)
}
diff --git a/CodexBar/Views/Menu/CodexStatusMenuSections.swift b/CodexBar/Views/Menu/CodexStatusMenuSections.swift
index c15b1cc..a4d004e 100644
--- a/CodexBar/Views/Menu/CodexStatusMenuSections.swift
+++ b/CodexBar/Views/Menu/CodexStatusMenuSections.swift
@@ -111,7 +111,7 @@ struct StatusAccountCard: View {
.liquidGlassSurface(cornerRadius: MenuMetrics.panelCornerRadius)
}
- private var statusDisplay: (text: String?, color: Color) {
+ private var statusDisplay: (text: LocalizedStringResource?, color: Color) {
switch loadState {
case .notLoggedIn:
("未登录", .orange)
@@ -194,7 +194,7 @@ struct QuotaLimitsSection: View {
@ViewBuilder
private func creditsBalance(value: String, credits: RateLimitCreditsSnapshot) -> some View {
- let capsule = metadataCapsule("积分: \(value)")
+ let capsule = metadataCapsule(String(localized: "积分: \(value)"))
if let helpText = creditsHelpText(value: value, credits: credits) {
capsule.help(helpText)
@@ -205,14 +205,14 @@ struct QuotaLimitsSection: View {
private func creditsDisplayValue(_ credits: RateLimitCreditsSnapshot) -> String? {
if credits.unlimited {
- return "无限"
+ return String(localized: "无限")
}
if let balance = normalizedCreditsBalance(credits.balance) {
return compactCreditsBalance(balance)
}
- return credits.hasCredits ? "可用" : nil
+ return credits.hasCredits ? String(localized: "可用") : nil
}
private func creditsHelpText(value: String, credits: RateLimitCreditsSnapshot) -> String? {
@@ -270,7 +270,7 @@ struct QuotaLimitsSection: View {
)
)
} label: {
- metadataCapsule("重置次数: \(count)")
+ metadataCapsule(String(localized: "重置次数: \(count)"))
}
.buttonStyle(.plain)
}
@@ -363,8 +363,10 @@ struct UpdatedAtRow: View {
private static let timeFormatter: DateFormatter = {
let formatter = DateFormatter()
- formatter.locale = Locale(identifier: "zh_CN")
- formatter.dateFormat = "HH:mm:ss"
+ formatter.locale = .autoupdatingCurrent
+ formatter.timeZone = .autoupdatingCurrent
+ formatter.dateStyle = .none
+ formatter.timeStyle = .medium
return formatter
}()
@@ -410,20 +412,21 @@ struct WorkflowSyncDisplayState: Equatable {
WorkflowSyncDisplayState(
symbolName: "icloud",
tint: .codexSecondaryLabel,
- helpText: lastSyncText.map { "最近同步: \($0)" } ?? "暂无同步记录"
+ helpText: lastSyncText.map { String(localized: "最近同步: \($0)") }
+ ?? String(localized: "暂无同步记录")
)
}
private static let disabled = WorkflowSyncDisplayState(
symbolName: "icloud.slash",
tint: .codexSecondaryLabel,
- helpText: "同步未开启"
+ helpText: String(localized: "同步未开启")
)
private static let syncing = WorkflowSyncDisplayState(
symbolName: "arrow.trianglehead.clockwise.icloud",
tint: .blue,
- helpText: "正在同步"
+ helpText: String(localized: "正在同步")
)
private static func failed(message: String?) -> WorkflowSyncDisplayState {
diff --git a/CodexBar/Views/Menu/QuotaRow.swift b/CodexBar/Views/Menu/QuotaRow.swift
index 2646bf7..9deb512 100644
--- a/CodexBar/Views/Menu/QuotaRow.swift
+++ b/CodexBar/Views/Menu/QuotaRow.swift
@@ -29,6 +29,8 @@ struct QuotaRow: View {
.font(.caption2.monospacedDigit())
.foregroundStyle(.secondary)
.lineLimit(1)
+ .minimumScaleFactor(0.75)
+ .allowsTightening(true)
.frame(width: Metrics.resetWidth, alignment: .trailing)
}
.frame(maxWidth: .infinity, alignment: .leading)
@@ -59,7 +61,7 @@ private extension QuotaRow {
return "--"
}
- return "\(remainingPercent)%"
+ return CodexPercentageFormat.string(from: remainingPercent)
}
var remainingPercent: Int? {
@@ -76,8 +78,9 @@ private extension QuotaRow {
static let resetFormatter: DateFormatter = {
let formatter = DateFormatter()
- formatter.locale = Locale(identifier: "zh_CN")
- formatter.dateFormat = "MM-dd HH:mm"
+ formatter.locale = .autoupdatingCurrent
+ formatter.timeZone = .autoupdatingCurrent
+ formatter.setLocalizedDateFormatFromTemplate("MMddjmm")
return formatter
}()
}
diff --git a/CodexBar/Views/Menu/ResetCreditsPanelView.swift b/CodexBar/Views/Menu/ResetCreditsPanelView.swift
index a4cd031..8091e05 100644
--- a/CodexBar/Views/Menu/ResetCreditsPanelView.swift
+++ b/CodexBar/Views/Menu/ResetCreditsPanelView.swift
@@ -141,7 +141,7 @@ struct ResetCreditsPanelView: View {
expirationText(group.expirationText)
.hidden()
.overlay {
- HStack(alignment: .center, spacing: 8) {
+ HStack(alignment: .center, spacing: 0) {
Text("过期时间")
.font(.caption2.weight(.medium))
.foregroundStyle(.secondary)
diff --git a/CodexBar/Views/Menu/TokenCountText.swift b/CodexBar/Views/Menu/TokenCountText.swift
index 421e41c..7f6ee59 100644
--- a/CodexBar/Views/Menu/TokenCountText.swift
+++ b/CodexBar/Views/Menu/TokenCountText.swift
@@ -86,7 +86,7 @@ private enum TokenCountFormatter {
private static let formatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
- formatter.locale = Locale(identifier: "en_US_POSIX")
+ formatter.locale = .autoupdatingCurrent
formatter.minimumFractionDigits = 0
formatter.maximumFractionDigits = 2
return formatter
diff --git a/CodexBar/Views/Menu/UsageHeatmap.swift b/CodexBar/Views/Menu/UsageHeatmap.swift
index 9f12de6..09d8dfc 100644
--- a/CodexBar/Views/Menu/UsageHeatmap.swift
+++ b/CodexBar/Views/Menu/UsageHeatmap.swift
@@ -95,19 +95,28 @@ struct UsageSummaryView: View {
HStack(alignment: .firstTextBaseline, spacing: Metrics.metricSpacing) {
tokenMetric(label: "全时累计", value: usage.summary.lifetimeTokens)
tokenMetric(label: "单日峰值", value: usage.summary.peakDailyTokens)
- textMetric(label: "当前连胜", value: Self.dayText(usage.summary.currentStreakDays))
- textMetric(label: "最长连胜", value: Self.dayText(usage.summary.longestStreakDays))
- textMetric(label: "最长任务", value: Self.durationText(seconds: usage.summary.longestRunningTurnSec))
+ textMetric(
+ label: "当前连胜",
+ value: Self.dayText(usage.summary.currentStreakDays)
+ )
+ textMetric(
+ label: "最长连胜",
+ value: Self.dayText(usage.summary.longestStreakDays)
+ )
+ textMetric(
+ label: "最长任务",
+ value: Self.durationText(seconds: usage.summary.longestRunningTurnSec)
+ )
}
}
- private func tokenMetric(label: String, value: Int) -> some View {
+ private func tokenMetric(label: LocalizedStringResource, value: Int) -> some View {
metric(label: label) {
TokenCountText(tokens: value)
}
}
- private func textMetric(label: String, value: String) -> some View {
+ private func textMetric(label: LocalizedStringResource, value: String) -> some View {
metric(label: label) {
Text(value)
.font(.caption.monospacedDigit().weight(.semibold))
@@ -117,7 +126,7 @@ struct UsageSummaryView: View {
}
private func metric(
- label: String,
+ label: LocalizedStringResource,
@ViewBuilder value: () -> some View
) -> some View {
VStack(alignment: .leading, spacing: 2) {
@@ -137,7 +146,7 @@ struct UsageSummaryView: View {
return "--"
}
- return "\(max(days, 0))天"
+ return String(localized: "\(max(days, 0))天")
}
private static func durationText(seconds: Int?) -> String {
@@ -145,25 +154,18 @@ struct UsageSummaryView: View {
return "--"
}
- let duration = max(seconds, 0)
- let days = duration / 86400
- let hours = duration % 86400 / 3600
- let minutes = duration % 3600 / 60
- let remainingSeconds = duration % 60
-
- if days > 0 {
- return "\(days) 天 \(hours) 时 \(minutes) 分 \(remainingSeconds) 秒"
- }
-
- if hours > 0 {
- return "\(hours) 时 \(minutes) 分 \(remainingSeconds) 秒"
- }
-
- if minutes > 0 {
- return "\(minutes) 分 \(remainingSeconds) 秒"
+ let totalSeconds = max(seconds, 0)
+ let duration = Duration.seconds(Double(totalSeconds))
+ let allowedUnits: Set<Duration.UnitsFormatStyle.Unit> = if totalSeconds >= 86400 {
+ [.days, .hours, .minutes, .seconds]
+ } else if totalSeconds >= 3600 {
+ [.hours, .minutes, .seconds]
+ } else if totalSeconds >= 60 {
+ [.minutes, .seconds]
+ } else {
+ [.seconds]
}
-
- return "\(remainingSeconds) 秒"
+ return CodexDurationFormat.abbreviated(duration, allowedUnits: allowedUnits)
}
private enum Metrics {
@@ -327,7 +329,16 @@ struct UsageHeatmap: View {
return nil
}
- return "\(firstDate) ~ \(lastDate)"
+ let firstText = localDayText(firstDate)
+ let lastText = localDayText(lastDate)
+ return String(localized: "\(firstText) ~ \(lastText)")
+ }
+
+ private func localDayText(_ dayKey: String) -> String {
+ guard let date = CodexDateFormat.dayDate(from: dayKey) else {
+ return dayKey
+ }
+ return CodexDateFormat.localDayDisplayString(from: date)
}
private func updatePointerLocation(_ point: CGPoint) {
@@ -627,12 +638,39 @@ struct UsageHeatmapDayDetailView: View {
private var workflowMetricRows: [WorkflowMetricRow] {
[
- WorkflowMetricRow(label: "会话总数", value: context.day.workflow.sessionCount, tint: .green),
- WorkflowMetricRow(label: "对话轮次", value: context.day.workflow.turnCount, tint: .teal),
- WorkflowMetricRow(label: "子智能体", value: context.day.workflow.subagentCount, tint: .indigo),
- WorkflowMetricRow(label: "调用工具", value: context.day.workflow.toolCallCount, tint: .orange),
- WorkflowMetricRow(label: "权限请求", value: context.day.workflow.permissionRequestCount, tint: .red),
- WorkflowMetricRow(label: "上下文压缩", value: context.day.workflow.contextCompactionCount, tint: .purple)
+ WorkflowMetricRow(
+ label: String(localized: "会话总数"),
+ value: context.day.workflow.sessionCount,
+ tint: .green
+ ),
+ WorkflowMetricRow(
+ label: String(localized: "对话轮次"),
+ value: context.day.workflow.turnCount,
+ tint: .teal
+ ),
+ WorkflowMetricRow(
+ label: String(localized: "子智能体"),
+ value: context.day.workflow.subagentCount,
+ tint: .indigo
+ ),
+ WorkflowMetricRow(
+ label: String(
+ localized: "workflow.metric.tool-calls",
+ defaultValue: "调用工具"
+ ),
+ value: context.day.workflow.toolCallCount,
+ tint: .orange
+ ),
+ WorkflowMetricRow(
+ label: String(localized: "权限请求"),
+ value: context.day.workflow.permissionRequestCount,
+ tint: .red
+ ),
+ WorkflowMetricRow(
+ label: String(localized: "上下文压缩"),
+ value: context.day.workflow.contextCompactionCount,
+ tint: .purple
+ )
]
}
@@ -816,7 +854,7 @@ private struct HeatmapTokenText: View {
)
.foregroundStyle(Color.codexLabel)
} else {
- Text("--")
+ Text(verbatim: "--")
.font(font)
.foregroundStyle(Color.codexLabel)
}
@@ -875,7 +913,7 @@ private struct HeatmapTokenText: View {
}
}
-/// 日期拆成三段以获得更自然的数字滚动过渡
+/// 日期拆成三段以固定 yyyy-MM-dd 格式并保留自然的数字滚动过渡
private struct AnimatedDateText: View {
let startDate: String
let font: Font
@@ -883,16 +921,16 @@ private struct AnimatedDateText: View {
var body: some View {
if let components {
HStack(spacing: 0) {
- Text(components.year)
- Text("-")
- Text(components.month)
- Text("-")
- Text(components.day)
+ Text(verbatim: components.year)
+ Text(verbatim: "-")
+ Text(verbatim: components.month)
+ Text(verbatim: "-")
+ Text(verbatim: components.day)
}
.font(font)
.numericRollTransition(value: dateValue(components))
} else {
- Text(startDate)
+ Text(verbatim: startDate)
.font(font)
.contentTransition(.numericText())
}
diff --git a/CodexBar/Views/Settings/AppSettingsView.swift b/CodexBar/Views/Settings/AppSettingsView.swift
index beabfbb..cbeb4f9 100644
--- a/CodexBar/Views/Settings/AppSettingsView.swift
+++ b/CodexBar/Views/Settings/AppSettingsView.swift
@@ -484,15 +484,17 @@ private extension AppSettingsView {
return KeepAliveCaption(message: errorMessage, isError: true)
}
guard codexHookSettings.isEnabled else {
- return KeepAliveCaption(message: "需要启用 CodexBar Hook")
+ return KeepAliveCaption(message: String(localized: "需要启用 CodexBar Hook"))
}
// 装着但校验不通过时不能说"需要启用", 那句会让用户去开一个已经开着的开关
// 具体是全局禁用还是不被信任, 由上面 Hook 那一行的说明给出, 这里只说结果
guard codexHookSettings.isVerified else {
- return KeepAliveCaption(message: "CodexBar Hook 未生效")
+ return KeepAliveCaption(message: String(localized: "CodexBar Hook 未生效"))
}
guard keepAliveController.isEnabled else {
- return KeepAliveCaption(message: "当有 Codex 任务运行时防止系统睡眠, 任务结束后自动恢复")
+ return KeepAliveCaption(
+ message: String(localized: "当有 Codex 任务运行时防止系统睡眠, 任务结束后自动恢复")
+ )
}
// 低电量拦下时开关开着却不防睡眠, 不留一句无从解释
@@ -500,24 +502,25 @@ private extension AppSettingsView {
// 它成立即意味着 helper 已就绪, 所以排在下面那个 switch 之前不影响 helper 类问题的呈现
// 不写具体阈值: 滞回让保护一直持续到阈值加 5, 说死数字会与用户看到的电量对不上
if keepAliveController.isLowBatteryBlocking {
- return KeepAliveCaption(message: "电量过低, 已恢复系统睡眠")
+ return KeepAliveCaption(message: String(localized: "电量过低, 已恢复系统睡眠"))
}
switch keepAliveController.helperStatus {
case .requiresApproval:
return KeepAliveCaption(
- message: "需要授权允许 CodexBar 后台运行",
+ message: String(localized: "需要授权允许 CodexBar 后台运行"),
showsSystemSettingsButton: true
)
case .notRegistered, .notFound:
- return KeepAliveCaption(message: "CodexBarHelper 尚未注册")
+ return KeepAliveCaption(message: String(localized: "CodexBarHelper 尚未注册"))
case .enabled:
// 上限之外的运行态都收起; 达到上限要留一句, 否则开关开着却没生效无从解释
guard keepAliveController.hasReachedMaximumDuration else {
return nil
}
+ let duration = keepAliveController.maximumDuration.title
return KeepAliveCaption(
- message: "已达到防睡眠时间上限 (\(keepAliveController.maximumDuration.title))"
+ message: String(localized: "已达到防睡眠时间上限 (\(duration))")
)
}
}
@@ -625,13 +628,13 @@ private extension AppSettingsView {
if isRebuildingWorkflowData {
ProgressView()
.controlSize(.small)
- .frame(width: RebuildLayoutMetrics.actionWidth)
+ .frame(minWidth: RebuildLayoutMetrics.actionMinimumWidth)
} else {
Button("重建") {
isShowingRebuildConfirmation = true
}
.controlSize(.small)
- .frame(width: RebuildLayoutMetrics.actionWidth)
+ .frame(minWidth: RebuildLayoutMetrics.actionMinimumWidth)
.disabled(selectedRebuildDateKeys.isEmpty)
}
}
@@ -650,16 +653,22 @@ private extension AppSettingsView {
return rebuildStatus
}
guard let selectedRebuildRange else {
- return RebuildStatus(message: "未选择重建日期范围", isError: false)
+ return RebuildStatus(message: String(localized: "未选择重建日期范围"), isError: false)
}
guard selectedRebuildRange.isComplete else {
- return RebuildStatus(message: "选择结束日期", isError: false)
+ return RebuildStatus(message: String(localized: "选择结束日期"), isError: false)
}
if selectedRebuildDateKeys.isEmpty {
- return RebuildStatus(message: "没有可重建的本地数据", isError: true)
+ return RebuildStatus(
+ message: String(
+ localized: "workflow.rebuild.error.source-unavailable",
+ defaultValue: "没有可重建的本地数据"
+ ),
+ isError: true
+ )
}
return RebuildStatus(
- message: "已选择 \(selectedRebuildRange.dayCount) 天",
+ message: String(localized: "已选择 \(selectedRebuildRange.dayCount) 天"),
isError: false
)
}
@@ -712,7 +721,7 @@ private extension AppSettingsView {
}
rebuildStatus = RebuildStatus(
- message: "重建失败: \(error.localizedDescription)",
+ message: String(localized: "重建失败: \(error.localizedDescription)"),
isError: true
)
}
@@ -727,25 +736,32 @@ private extension AppSettingsView {
for summary: WorkflowDataRebuildSummary,
autoRetryAvailable: Bool
) -> String {
- var message = "已重建 \(summary.rebuiltDateCount) 天, 包含 \(summary.eventCount) 条数据"
+ var message = String(
+ localized: "已重建 \(summary.rebuiltDateCount) 天, 包含 \(summary.eventCount) 条数据"
+ )
if summary.corruptLineCount > 0 {
- message += ", 跳过 \(summary.corruptLineCount) 条无效数据"
+ message += String(localized: ", 跳过 \(summary.corruptLineCount) 条无效数据")
}
if !summary.failedDateKeys.isEmpty {
let listed = summary.failedDateKeys.prefix(rebuildFailedDateListLimit)
var dates = listed.joined(separator: ", ")
if summary.failedDateKeys.count > listed.count {
- dates += " 等"
+ dates += String(localized: " 等")
}
- message += "; \(summary.failedDateKeys.count) 天未完成 (\(dates))"
- message += autoRetryAvailable ? ", 稍后会自动重试" : ", 开启 CodexBar Hook 后会自动重试"
+ message += String(localized: "; \(summary.failedDateKeys.count) 天未完成 (\(dates))")
+ message += autoRetryAvailable
+ ? String(localized: ", 稍后会自动重试")
+ : String(localized: ", 开启 CodexBar Hook 后会自动重试")
}
if summary.didFailSyncReplacementMarking {
- message += "; 云端替换未能登记, 请稍后重新重建这些日期"
+ message += String(
+ localized: "workflow.rebuild.summary.sync-replacement-marking-failed",
+ defaultValue: "; 云端替换未能完成, 请稍后重新重建这些数据"
+ )
} else if summary.isSyncReplacementPending {
- message += "; 云端替换将在同步可用后继续"
+ message += String(localized: "; 云端替换将在同步可用后继续")
}
return message
@@ -906,7 +922,7 @@ private extension AppSettingsView {
private enum RebuildLayoutMetrics {
static let pickerWidth: CGFloat = 190
static let controlHeight: CGFloat = 26
- static let actionWidth: CGFloat = 42
+ static let actionMinimumWidth: CGFloat = 42
}
private struct RebuildDatePicker: View {
@@ -929,8 +945,6 @@ private struct RebuildDatePicker: View {
repeating: GridItem(.fixed(Metrics.daySize), spacing: Metrics.columnSpacing),
count: 7
)
- private static let weekdaySymbols = ["一", "二", "三", "四", "五", "六", "日"]
-
var body: some View {
Button {
let focusedDateKey = selection?.endDateKey ?? selection?.startDateKey
@@ -945,11 +959,17 @@ private struct RebuildDatePicker: View {
.font(.system(size: 11, weight: .medium))
.foregroundStyle(.tint)
- Text(selection?.displayText ?? "选择日期范围")
- .font(.caption.monospacedDigit().weight(.medium))
- .foregroundStyle(.primary)
- .lineLimit(1)
- .minimumScaleFactor(0.9)
+ Group {
+ if let selection {
+ Text(verbatim: selection.displayText)
+ } else {
+ Text("选择日期范围")
+ }
+ }
+ .font(.caption.monospacedDigit().weight(.medium))
+ .foregroundStyle(.primary)
+ .lineLimit(1)
+ .minimumScaleFactor(0.9)
Spacer(minLength: 0)
@@ -981,7 +1001,9 @@ private struct RebuildDatePicker: View {
}
private var calendarPopover: some View {
- VStack(spacing: 10) {
+ let weekdaySymbols = weekdaySymbols
+
+ return VStack(spacing: 10) {
HStack(spacing: 8) {
monthNavigationButton(
systemImage: "chevron.left",
@@ -1005,8 +1027,8 @@ private struct RebuildDatePicker: View {
}
LazyVGrid(columns: Self.columns, spacing: 5) {
- ForEach(Self.weekdaySymbols, id: \.self) { symbol in
- Text(symbol)
+ ForEach(weekdaySymbols.indices, id: \.self) { index in
+ Text(verbatim: weekdaySymbols[index])
.font(.system(size: 10, weight: .medium))
.foregroundStyle(.secondary)
.frame(width: Metrics.daySize, height: 18)
@@ -1017,11 +1039,17 @@ private struct RebuildDatePicker: View {
}
}
- Text(selection?.isComplete == false ? "选择结束日期" : "选择开始日期")
- .font(.caption2)
- .foregroundStyle(.secondary)
- .lineLimit(1)
- .frame(height: 14)
+ Group {
+ if selection?.isComplete == false {
+ Text("选择结束日期")
+ } else {
+ Text("选择开始日期")
+ }
+ }
+ .font(.caption2)
+ .foregroundStyle(.secondary)
+ .lineLimit(1)
+ .frame(height: 14)
}
.padding(12)
.frame(width: Metrics.popoverWidth, height: Metrics.popoverHeight)
@@ -1029,7 +1057,7 @@ private struct RebuildDatePicker: View {
private func monthNavigationButton(
systemImage: String,
- help: String,
+ help: LocalizedStringResource,
offset: Int
) -> some View {
Button {
@@ -1100,11 +1128,7 @@ private struct RebuildDatePicker: View {
}
private var monthTitle: String {
- let components = calendar.dateComponents([.year, .month], from: displayedMonth)
- guard let year = components.year, let month = components.month else {
- return ""
- }
- return String(format: "%04d-%02d", year, month)
+ Self.monthFormatter.string(from: displayedMonth)
}
private var monthDates: [Date] {
@@ -1120,7 +1144,7 @@ private struct RebuildDatePicker: View {
return []
}
- let visibleDayCount = Self.weekdaySymbols.count * Metrics.visibleWeekCount
+ let visibleDayCount = Self.columns.count * Metrics.visibleWeekCount
return (0 ..< visibleDayCount).compactMap { dayOffset in
calendar.date(byAdding: .day, value: dayOffset, to: gridStart)
}
@@ -1128,12 +1152,27 @@ private struct RebuildDatePicker: View {
private var calendar: Calendar {
var calendar = Calendar(identifier: .gregorian)
- calendar.locale = Locale(identifier: "zh_CN")
+ calendar.locale = .autoupdatingCurrent
calendar.timeZone = .autoupdatingCurrent
- calendar.firstWeekday = 2
return calendar
}
+ private var weekdaySymbols: [String] {
+ let symbols = calendar.veryShortStandaloneWeekdaySymbols
+
+ let firstIndex = max(0, min(symbols.count - 1, calendar.firstWeekday - 1))
+ return Array(symbols[firstIndex...] + symbols[..<firstIndex])
+ }
+
+ private static let monthFormatter: DateFormatter = {
+ let formatter = DateFormatter()
+ formatter.locale = .autoupdatingCurrent
+ formatter.calendar = Calendar(identifier: .gregorian)
+ formatter.timeZone = .autoupdatingCurrent
+ formatter.setLocalizedDateFormatFromTemplate("yyyyMMMM")
+ return formatter
+ }()
+
private var selectableDateRange: ClosedRange<Date> {
let today = calendar.startOfDay(for: Date())
let cutoff = WorkflowStorage.retentionCutoffDate(today: today, calendar: calendar)
@@ -1219,12 +1258,19 @@ private struct RebuildDateRange: Equatable {
}
var displayText: String {
+ guard let startDate = CodexDateFormat.dayDate(from: startDateKey) else {
+ return startDateKey
+ }
+ let startText = CodexDateFormat.localDayDisplayString(from: startDate)
guard let endDateKey else {
- return "\(startDateKey) ~"
+ return String(localized: "\(startText) ~")
+ }
+ guard startDateKey != endDateKey,
+ let endDate = CodexDateFormat.dayDate(from: endDateKey) else {
+ return startText
}
- return startDateKey == endDateKey
- ? startDateKey
- : "\(startDateKey) ~ \(endDateKey)"
+ let endText = CodexDateFormat.localDayDisplayString(from: endDate)
+ return String(localized: "\(startText) ~ \(endText)")
}
func completing(with dateKey: String) -> RebuildDateRange {
@@ -1262,7 +1308,7 @@ private enum SettingsTab: CaseIterable, Identifiable {
self
}
- var title: String {
+ var title: LocalizedStringResource {
switch self {
case .general:
"通用"
diff --git a/CodexBar/Views/Settings/HotKeyRecorderRow.swift b/CodexBar/Views/Settings/HotKeyRecorderRow.swift
index 21a0b92..ce18a1d 100644
--- a/CodexBar/Views/Settings/HotKeyRecorderRow.swift
+++ b/CodexBar/Views/Settings/HotKeyRecorderRow.swift
@@ -73,10 +73,10 @@ struct HotKeyRecorderRow: View {
private var shortcutLabel: String {
if isRecording {
- return "请设置快捷键"
+ return String(localized: "请设置快捷键")
}
- return settings.shortcut?.label ?? "未设置"
+ return settings.shortcut?.label ?? String(localized: "未设置")
}
private var canStartRecording: Bool {
@@ -119,7 +119,7 @@ struct HotKeyRecorderRow: View {
}
guard let shortcut = GlobalHotKeyShortcut(event: event) else {
- settings.setRegistrationError("无法识别该快捷键")
+ settings.setRegistrationError(String(localized: "无法识别该快捷键"))
stopRecording()
return
}
@@ -130,7 +130,7 @@ struct HotKeyRecorderRow: View {
private func iconButton(
systemName: String,
- help: String,
+ help: LocalizedStringResource,
isDisabled: Bool,
action: @escaping () -> Void
) -> some View {
diff --git a/CodexBar/Views/Settings/KeepAliveOptionsView.swift b/CodexBar/Views/Settings/KeepAliveOptionsView.swift
index 4005477..923aec4 100644
--- a/CodexBar/Views/Settings/KeepAliveOptionsView.swift
+++ b/CodexBar/Views/Settings/KeepAliveOptionsView.swift
@@ -83,8 +83,8 @@ struct KeepAliveOptionsView: View {
}
private func pickerRow<Option: Hashable>(
- title: String,
- caption: String,
+ title: LocalizedStringResource,
+ caption: LocalizedStringResource,
selection: Binding<Option>,
options: [Option],
label: KeyPath<Option, String>
@@ -103,8 +103,8 @@ struct KeepAliveOptionsView: View {
/// 开关的修饰链与通知子面板的 optionRow 保持一致, 两个面板才是同一套控件
private func toggleRow(
- title: String,
- caption: String,
+ title: LocalizedStringResource,
+ caption: LocalizedStringResource,
isOn: Binding<Bool>
) -> some View {
row(title: title, caption: caption) {
@@ -117,8 +117,8 @@ struct KeepAliveOptionsView: View {
/// 面板里每一行都是控件行加一句固定说明, 说明那行与通知子面板的音效子行同一套字号和层级
private func row(
- title: String,
- caption: String,
+ title: LocalizedStringResource,
+ caption: LocalizedStringResource,
@ViewBuilder control: () -> some View
) -> some View {
VStack(spacing: 0) {
diff --git a/CodexBar/Views/Settings/NotificationOptionsView.swift b/CodexBar/Views/Settings/NotificationOptionsView.swift
index ad496c5..161a176 100644
--- a/CodexBar/Views/Settings/NotificationOptionsView.swift
+++ b/CodexBar/Views/Settings/NotificationOptionsView.swift
@@ -60,7 +60,7 @@ struct NotificationOptionsView: View {
set: { notificationSettings.setLowQuotaThresholdPercent($0) }
),
options: NotificationSettings.lowQuotaThresholdOptions,
- label: { "\($0)%" }
+ label: { CodexPercentageFormat.string(from: $0) }
)
}
}
@@ -228,7 +228,7 @@ struct NotificationOptionsView: View {
// MARK: - 行构建器
private func optionRow(
- title: String,
+ title: LocalizedStringResource,
isOn: Binding<Bool>,
isEnabled: Bool = true
) -> some View {
@@ -238,7 +238,7 @@ struct NotificationOptionsView: View {
}
private func optionRow(
- title: String,
+ title: LocalizedStringResource,
isOn: Binding<Bool>,
isEnabled: Bool = true,
@ViewBuilder accessory: () -> some View
@@ -261,7 +261,7 @@ struct NotificationOptionsView: View {
.frame(height: Metrics.rowHeight)
}
- private func captionRow(_ caption: String) -> some View {
+ private func captionRow(_ caption: LocalizedStringResource) -> some View {
HStack(spacing: 0) {
Text(caption)
.font(.caption2)
@@ -273,7 +273,7 @@ struct NotificationOptionsView: View {
}
private func notificationOptionRow(
- title: String,
+ title: LocalizedStringResource,
isOn: Binding<Bool>,
isEnabled: Bool = true,
sound: Binding<NotificationSoundOption>
@@ -289,7 +289,7 @@ struct NotificationOptionsView: View {
}
private func notificationOptionRow(
- title: String,
+ title: LocalizedStringResource,
isOn: Binding<Bool>,
isEnabled: Bool = true,
sound: Binding<NotificationSoundOption>,
@@ -349,7 +349,7 @@ struct NotificationOptionsView: View {
}
private func optionPicker(
- title: String,
+ title: LocalizedStringResource,
selection: Binding<Int>,
options: [Int],
label: @escaping (Int) -> String
@@ -380,7 +380,7 @@ struct NotificationOptionsView: View {
}
}
} label: {
- Text(selection.wrappedValue.title)
+ Text(selection.wrappedValue.localizedTitle)
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(1)
@@ -401,9 +401,9 @@ struct NotificationOptionsView: View {
playPreview(for: sound)
} label: {
if sound == selection.wrappedValue {
- Label(sound.title, systemImage: "checkmark")
+ Label(sound.localizedTitle, systemImage: "checkmark")
} else {
- Text(sound.title)
+ Text(sound.localizedTitle)
}
}
}
@@ -425,7 +425,9 @@ struct NotificationOptionsView: View {
}
private static func longTaskOptionLabel(_ seconds: Int) -> String {
- seconds < 60 ? "\(seconds) 秒" : "\(seconds / 60) 分钟"
+ seconds < 60
+ ? String(localized: "\(seconds) 秒")
+ : String(localized: "\(seconds / 60) 分钟")
}
private enum Metrics {
diff --git a/CodexBar/Views/Settings/SettingsToggleRow.swift b/CodexBar/Views/Settings/SettingsToggleRow.swift
index 14e576b..1677525 100644
--- a/CodexBar/Views/Settings/SettingsToggleRow.swift
+++ b/CodexBar/Views/Settings/SettingsToggleRow.swift
@@ -22,7 +22,7 @@ enum SettingsOptionsPanelMetrics {
/// 两个子选项面板共用的下拉选择器
/// 只有宽度和对齐各自定义, 其余样式必须同源, 否则两个面板看起来就不是同一套控件
struct SettingsOptionsPicker<Option: Hashable>: View {
- let title: String
+ let title: LocalizedStringResource
@Binding var selection: Option
let options: [Option]
let label: (Option) -> String
@@ -45,14 +45,14 @@ struct SettingsOptionsPicker<Option: Hashable>: View {
/// 设置页通用开关行, accessory 插入在开关左侧
struct SettingsToggleRow<Accessory: View>: View {
let icon: String
- let title: String
+ let title: LocalizedStringResource
let isOn: Binding<Bool>
let isEnabled: Bool
private let accessory: Accessory
init(
icon: String,
- title: String,
+ title: LocalizedStringResource,
isOn: Binding<Bool>,
isEnabled: Bool = true,
@ViewBuilder accessory: () -> Accessory
@@ -88,7 +88,7 @@ struct SettingsToggleRow<Accessory: View>: View {
extension SettingsToggleRow where Accessory == EmptyView {
init(
icon: String,
- title: String,
+ title: LocalizedStringResource,
isOn: Binding<Bool>,
isEnabled: Bool = true
) {
diff --git a/Config/Version.xcconfig b/Config/Version.xcconfig
index 65b6e5c..00bb681 100644
--- a/Config/Version.xcconfig
+++ b/Config/Version.xcconfig
@@ -1,2 +1,2 @@
-MARKETING_VERSION = 3.5.10
-CURRENT_PROJECT_VERSION = 64
+MARKETING_VERSION = 3.5.11
+CURRENT_PROJECT_VERSION = 65
diff --git a/README.md b/README.md
index f8cfca1..02add0c 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@
[![Downloads](https://img.shields.io/github/downloads/bob-zebedy/CodexBar/total?color=2EA043)](https://github.com/bob-zebedy/CodexBar/releases)
[![License](https://img.shields.io/github/license/bob-zebedy/CodexBar?color=8957E5)](LICENSE)
-[安装](#安装) | [使用](#使用) | [隐私](#隐私) | [实现](#实现)
+[安装](#安装) | [使用](#使用) | [语言](#语言) | [隐私](#隐私) | [实现](#实现)
<img src="Images/preview.gif" width="640" alt="CodexBar 预览">
@@ -20,7 +20,7 @@
---
-CodexBar 把 Codex 的运行状态收进菜单栏: 账户信息, 剩余额度, 任务状态, 重置时间, Token 用量, 使用详细信息等
+CodexBar 把 Codex 的运行状态收进菜单栏: 账户信息, 剩余额度, 任务状态, 重置时间, Token 用量, 使用详细信息等, 并提供简体中文和英文界面
## 特性
@@ -69,6 +69,7 @@ CodexBar 把 Codex 的运行状态收进菜单栏: 账户信息, 剩余额度,
### 系统集成
+- 简体中文和英文界面, 日期 时间 时长和百分比按当前语言与地区格式显示
- 全局快捷键唤起
- 内置日志窗口保留最近 500 条 app-server 请求记录
@@ -102,6 +103,12 @@ brew install --cask bob-zebedy/tap/codexbar
| `⌘,` | 打开设置窗口 |
| `⌘L` | 主面板打开时, 打开日志窗口 |
+### 语言
+
+CodexBar 提供简体中文和英文界面, 默认跟随 macOS 的 App 语言偏好
+
+需要单独切换时, 可在 macOS 系统设置的语言与地区中为 CodexBar 指定 App 语言. 日期 时间 时长和百分比会继续按照当前地区格式显示
+
### 关于 Hook
实时任务展示, 热力图统计数据与防睡眠都依赖 CodexBar Hook
diff --git a/Scripts/dmg.sh b/Scripts/dmg.sh
index bcfb344..c9acd93 100755
--- a/Scripts/dmg.sh
+++ b/Scripts/dmg.sh
@@ -4,6 +4,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
BUILD_DIR="${BUILD_DIR:-${PROJECT_DIR}/Build}"
+VERSION_CONFIG="${PROJECT_DIR}/Config/Version.xcconfig"
APP_PATH="${1:-}"
OUTPUT_PATH="${2:-}"
@@ -47,51 +48,19 @@ if [[ ! -d "${APP_PATH}" || "${APP_PATH}" != *.app ]]; then
fi
APP_NAME="$(basename "${APP_PATH}" .app)"
-PLIST_PATH="${APP_PATH}/Contents/Info.plist"
-XCODE_PROJECT="${XCODE_PROJECT:-}"
-XCODE_SCHEME="${XCODE_SCHEME:-${APP_NAME}}"
-VERSION=""
-
-if [[ -z "${XCODE_PROJECT}" ]]; then
- while IFS= read -r project; do
- XCODE_PROJECT="${project}"
- break
- done < <(find "${PROJECT_DIR}" -maxdepth 1 -type d -name "*.xcodeproj" | sort)
-elif [[ "${XCODE_PROJECT}" != /* ]]; then
- XCODE_PROJECT="${PROJECT_DIR}/${XCODE_PROJECT}"
-fi
-
-if [[ -n "${XCODE_PROJECT}" && -d "${XCODE_PROJECT}" ]]; then
- VERSION="$(
- xcodebuild \
- -project "${XCODE_PROJECT}" \
- -scheme "${XCODE_SCHEME}" \
- -configuration Release \
- -showBuildSettings 2>/dev/null |
- awk -F= '/MARKETING_VERSION/ {gsub(/[[:space:]]/, "", $2); print $2; exit}' ||
- true
- )"
-fi
-
-if [[ -z "${VERSION}" && -n "${XCODE_PROJECT}" && -d "${XCODE_PROJECT}" ]]; then
- VERSION="$(
- awk -F= '
- /MARKETING_VERSION/ {
+VERSION="$(
+ awk -F= '
+ $1 ~ /^[[:space:]]*MARKETING_VERSION[[:space:]]*$/ {
value = $2
- gsub(/[[:space:];]/, "", value)
+ gsub(/^[[:space:]]+|[[:space:];]+$/, "", value)
print value
exit
}
- ' "${XCODE_PROJECT}/project.pbxproj" 2>/dev/null || true
- )"
-fi
-
-if [[ -z "${VERSION}" && -f "${PLIST_PATH}" ]]; then
- VERSION="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "${PLIST_PATH}" 2>/dev/null || true)"
-fi
+ ' "${VERSION_CONFIG}" 2>/dev/null || true
+)"
if [[ -z "${VERSION}" ]]; then
- echo "error: 无法从 Xcode 或 Info.plist 读取版本号" >&2
+ echo "error: 无法从 Config/Version.xcconfig 读取 MARKETING_VERSION" >&2
exit 1
fi
diff --git a/appcast.xml b/appcast.xml
index 558b811..08a1920 100644
--- a/appcast.xml
+++ b/appcast.xml
@@ -7,6 +7,15 @@
<link>https://codexbar.zabrian.app/appcast.xml</link>
<description>CodexBar appcast feed</description>
<language>zh-CN</language>
+ <item>
+ <title>CodexBar.app 3.5.11</title>
+ <sparkle:version>65</sparkle:version>
+ <sparkle:shortVersionString>3.5.11</sparkle:shortVersionString>
+ <sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
+ <sparkle:releaseNotesLink>https://codexbar.zabrian.app/notes#3.5.11</sparkle:releaseNotesLink>
+ <pubDate>Mon, 03 Aug 2026 22:42:26 +0800</pubDate>
+ <enclosure url="https://codexbar.zabrian.app/download/CodexBar-v3.5.11.dmg" sparkle:edSignature="j636O60LYYTXHiHyjktsFCSIhjIWVPraCavWdFwTbYLpTQg8mSg1BSNsTkQJm2V0HoioRRUxViNgmNQtnYd3BA==" length="6652072" type="application/octet-stream"/>
+ </item>
<item>
<title>CodexBar.app 3.5.10</title>
<sparkle:version>64</sparkle:version>