Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Sources/AgentBar/Localization/I18n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -287,6 +289,7 @@ enum I18n {
aboutUs: "关于我们",
quit: "退出",
recentWeek: "近 1 周",
shortWeek: "周剩",
resetTimeUnavailable: "刷新时间不可用",
resetSoon: "即将刷新",
refreshAtSuffix: "刷新",
Expand Down
2 changes: 1 addition & 1 deletion Sources/AgentBar/Services/CodexRateLimitService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Sources/AgentBar/UI/MenuBarQuotaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down