diff --git a/Sources/AgentBar/Localization/I18n.swift b/Sources/AgentBar/Localization/I18n.swift index 2088fdf..d620e4f 100644 --- a/Sources/AgentBar/Localization/I18n.swift +++ b/Sources/AgentBar/Localization/I18n.swift @@ -18,6 +18,7 @@ enum I18n { let aboutUs: String let quit: String let recentWeek: String + let shortWeek: String let resetTimeUnavailable: String let resetSoon: String let refreshAtSuffix: String @@ -242,6 +243,7 @@ enum I18n { aboutUs: "About us", quit: "Quit", recentWeek: "Past 1 week", + shortWeek: "Weekly", resetTimeUnavailable: "Reset time unavailable", resetSoon: "Reset soon", refreshAtSuffix: " refresh", @@ -287,6 +289,7 @@ enum I18n { aboutUs: "关于我们", quit: "退出", recentWeek: "近 1 周", + shortWeek: "周剩", resetTimeUnavailable: "刷新时间不可用", resetSoon: "即将刷新", refreshAtSuffix: "刷新", diff --git a/Sources/AgentBar/Services/CodexRateLimitService.swift b/Sources/AgentBar/Services/CodexRateLimitService.swift index 5d3dc5f..50ff0f1 100644 --- a/Sources/AgentBar/Services/CodexRateLimitService.swift +++ b/Sources/AgentBar/Services/CodexRateLimitService.swift @@ -214,7 +214,7 @@ struct CodexRateLimitService { switch durationMins { case 10080: - return "1w" + return I18n.current.shortWeek case ..<1440: return "\(max(1, durationMins / 60))h" default: diff --git a/Sources/AgentBar/UI/MenuBarQuotaView.swift b/Sources/AgentBar/UI/MenuBarQuotaView.swift index c750c89..d529d7a 100644 --- a/Sources/AgentBar/UI/MenuBarQuotaView.swift +++ b/Sources/AgentBar/UI/MenuBarQuotaView.swift @@ -2,7 +2,7 @@ import AppKit final class MenuBarQuotaView: NSControl { private let iconView = NSImageView() - private let weekPrefixLabel = NSTextField(labelWithString: "1w") + private let weekPrefixLabel = NSTextField(labelWithString: I18n.current.shortWeek) private let weekPercentLabel = NSTextField(labelWithString: "--") override init(frame frameRect: NSRect) { @@ -19,7 +19,7 @@ final class MenuBarQuotaView: NSControl { toolTip = statusMessage guard let snapshot else { - weekPrefixLabel.stringValue = "1w" + weekPrefixLabel.stringValue = I18n.current.shortWeek weekPercentLabel.stringValue = "--" weekPercentLabel.textColor = .secondaryLabelColor return