Show the desktop shell in Chinese under zh_CN

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 21:29:39 -04:00
1 parent e590f22de6
commit e236713d9f
55 files changed
+867 -331

No files matched your search

+56 -56
View File
@@ -338,9 +338,9 @@ Panel {
// A few ways into making Omarchy your own, handed to the default agent.
readonly property var starterPrompts: [
{ glyph: "󰏘", label: "Theme", prompt: "Make me a new Omarchy theme. Ask me what look or inspiration I have in mind, then build it following the Omarchy skill's theming guide and switch to it." },
{ glyph: "󰐱", label: "Plugin", prompt: "Make me a new Omarchy shell plugin. Ask me what I'd like it to do, then build it following the Omarchy skill's plugin guide and enable it." },
{ glyph: "󰣆", label: "App", prompt: "Make me a new app for my Omarchy desktop. Ask me what it should do, then build it following the omarchy-app skill and install it so it shows up in the app launcher." }
{ glyph: "󰏘", label: I18n.tr("Theme"), prompt: "Make me a new Omarchy theme. Ask me what look or inspiration I have in mind, then build it following the Omarchy skill's theming guide and switch to it." },
{ glyph: "󰐱", label: I18n.tr("Plugin"), prompt: "Make me a new Omarchy shell plugin. Ask me what I'd like it to do, then build it following the Omarchy skill's plugin guide and enable it." },
{ glyph: "󰣆", label: I18n.tr("App"), prompt: "Make me a new app for my Omarchy desktop. Ask me what it should do, then build it following the omarchy-app skill and install it so it shows up in the app launcher." }
]
function startPrompt(prompt) {
@@ -406,7 +406,7 @@ Panel {
var parts = []
if (String(account.plan || "") !== "") parts.push(account.plan)
if (account.resetCredits && Number(account.resetCredits.available) > 0)
parts.push(account.resetCredits.available + " free reset" + (Number(account.resetCredits.available) === 1 ? "" : "s"))
parts.push(I18n.tr(Number(account.resetCredits.available) === 1 ? "%1 free reset" : "%1 free resets", account.resetCredits.available))
return parts.join(" · ")
}
@@ -491,11 +491,11 @@ Panel {
function windowTitle(label) {
var text = String(label || "").toLowerCase()
if (text.indexOf("month") >= 0) return "Monthly"
if (windowIsLong(text)) return "Weekly"
if (text.indexOf("session") >= 0 || windowSpanMs(label) > 0) return "Session"
if (text.indexOf("month") >= 0) return I18n.tr("Monthly")
if (windowIsLong(text)) return I18n.tr("Weekly")
if (text.indexOf("session") >= 0 || windowSpanMs(label) > 0) return I18n.tr("Session")
var plain = String(label || "").replace(/\s*\(.*\)\s*/, "").trim()
return plain === "" ? "Limit" : plain
return plain === "" ? I18n.tr("Limit") : plain
}
// A collector that already knows which window a limit belongs to says so,
@@ -575,13 +575,13 @@ Panel {
}
function formatDuration(ms) {
if (!(ms > 0)) return "now"
if (!(ms > 0)) return I18n.tr("now")
var minutes = Math.floor(ms / 60000)
var hours = Math.floor(minutes / 60)
var days = Math.floor(hours / 24)
if (days > 0) return days + "d " + (hours % 24) + "h"
if (hours > 0) return hours + "h " + (minutes % 60) + "m"
return Math.max(1, minutes) + "m"
if (days > 0) return I18n.tr("%1d %2h", days, hours % 24)
if (hours > 0) return I18n.tr("%1h %2m", hours, minutes % 60)
return I18n.tr("%1m", Math.max(1, minutes))
}
// ---------------------------------------------------------------- balance
@@ -611,8 +611,8 @@ Panel {
function balanceDetailText(b) {
if (!b || !(b.funded > 0)) return ""
var text = formatMoney(b.spent, b.currency) + " spent of " + formatMoney(b.funded, b.currency) + " funded"
if (b.estimated) text += " · estimated"
var text = I18n.tr("%1 spent of %2 funded", formatMoney(b.spent, b.currency), formatMoney(b.funded, b.currency))
if (b.estimated) text += " · " + I18n.tr("estimated")
return text
}
@@ -653,16 +653,16 @@ Panel {
}
var phrases = []
if (week > 0) phrases.push(usage.formatTokenCount(week) + " tokens this week")
if (today > 0) phrases.push(usage.formatTokenCount(today) + " tokens today")
if (week > 0) phrases.push(I18n.tr("%1 tokens this week", usage.formatTokenCount(week)))
if (today > 0) phrases.push(I18n.tr("%1 tokens today", usage.formatTokenCount(today)))
var topModel = ""
for (var model in byModel) if (topModel === "" || byModel[model] > byModel[topModel]) topModel = model
if (topModel !== "" && byModel[topModel] > 0) phrases.push("Mostly " + topModel)
if (topModel !== "" && byModel[topModel] > 0) phrases.push(I18n.tr("Mostly %1", topModel))
var busiest = ""
for (var date in byDay) if (busiest === "" || byDay[date] > byDay[busiest]) busiest = date
if (busiest !== "" && byDay[busiest] > 0) phrases.push("Busiest day: " + dayName(busiest))
if (prompts > 0) phrases.push(prompts + " prompt" + (prompts === 1 ? "" : "s") + " today")
if (sessions > 0) phrases.push(sessions + " session" + (sessions === 1 ? "" : "s") + " today")
if (busiest !== "" && byDay[busiest] > 0) phrases.push(I18n.tr("Busiest day: %1", dayName(busiest)))
if (prompts > 0) phrases.push(I18n.tr(prompts === 1 ? "%1 prompt today" : "%1 prompts today", prompts))
if (sessions > 0) phrases.push(I18n.tr(sessions === 1 ? "%1 session today" : "%1 sessions today", sessions))
return phrases
}
property int phraseIndex: 0
@@ -672,7 +672,7 @@ Panel {
property string shownPhrase: ""
readonly property string heroPhrase: addStage !== "" || blankSlate
? addHeading
: (shownPhrase !== "" ? shownPhrase : "Subscriptions")
: (shownPhrase !== "" ? shownPhrase : I18n.tr("Subscriptions"))
function showPhrase() {
var n = summaryPhrases.length
@@ -684,7 +684,7 @@ Panel {
function dayName(date) {
var parsed = new Date(String(date || "") + "T00:00:00")
if (isNaN(parsed.getTime())) return String(date || "")
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][parsed.getDay()]
return I18n.tr(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][parsed.getDay()])
}
// Only speaks up when the numbers cover more than this machine.
@@ -693,7 +693,7 @@ Panel {
for (var i = 0; i < providers.length; i++) {
var count = Number(providers[i].syncDeviceCount || 0)
if (providers[i].syncEnabled && count > 0)
return "Merged from " + count + " device" + (count === 1 ? "" : "s")
return I18n.tr(count === 1 ? "Merged from %1 device" : "Merged from %1 devices", count)
}
return ""
}
@@ -743,8 +743,8 @@ Panel {
// Adding takes over the hero's line, and the cursor starts over.
readonly property string addHeading: picking || addProvider === ""
? "Add an account"
: "Add " + (/^[AEIOU]/.test(addProviderName(addProvider)) ? "an " : "a ") + addProviderName(addProvider) + " account"
? I18n.tr("Add an account")
: I18n.tr(/^[AEIOU]/.test(addProviderName(addProvider)) ? "Add an %1 account" : "Add a %1 account", addProviderName(addProvider))
onAddStageChanged: {
phraseSwap.stop()
hero.metaOpacity = 1.0
@@ -803,7 +803,7 @@ Panel {
stdout: SplitParser { onRead: function(line) { root.handleAddLine(line) } }
onExited: {
if (root.addStage === "running") {
root.addResult = "The sign-in didn't finish."
root.addResult = I18n.tr("The sign-in didn't finish.")
root.addStage = "error"
}
}
@@ -938,7 +938,7 @@ Panel {
PanelHero {
id: hero
width: parent.width
title: "Agents"
title: I18n.tr("Agents")
meta: root.heroPhrase
foreground: root.foreground
fontFamily: root.fontFamily
@@ -964,7 +964,7 @@ Panel {
onHovered: root.pointAt("add")
readonly property bool adding: root.addStage !== ""
glyph: adding ? "󰅖" : "󰐕"
tooltip: adding ? "Back to the limits" : "Add a subscription"
tooltip: adding ? I18n.tr("Back to the limits") : I18n.tr("Add a subscription")
onClicked: adding ? root.cancelAdd() : root.addAccount()
}
@@ -973,7 +973,7 @@ Panel {
hasCursor: root.hasKey("launch")
onHovered: root.pointAt("launch")
glyph: "󰞷"
tooltip: "Start the default agent"
tooltip: I18n.tr("Start the default agent")
onClicked: root.launchAgent()
}
}
@@ -1010,7 +1010,7 @@ Panel {
spacing: Style.space(12)
PanelSectionHeader {
text: "MAKE SOMETHING COOL"
text: I18n.tr("MAKE SOMETHING COOL")
foreground: root.foreground
fontFamily: root.fontFamily
}
@@ -1064,7 +1064,7 @@ Panel {
Text {
visible: root.blankSlate && root.picking
width: parent.width
text: "Sign in to an AI coding subscription, and this panel keeps track of how much of it you have left."
text: I18n.tr("Sign in to an AI coding subscription, and this panel keeps track of how much of it you have left.")
color: root.dim
font.family: root.fontFamily
font.pixelSize: Style.font.caption
@@ -1136,7 +1136,7 @@ Panel {
Text {
width: parent.width
text: "Name this account. It signs in through a private window, so your browser's current account isn't picked up."
text: I18n.tr("Name this account. It signs in through a private window, so your browser's current account isn't picked up.")
color: root.dim
font.family: root.fontFamily
font.pixelSize: Style.font.caption
@@ -1146,7 +1146,7 @@ Panel {
TextField {
id: addNameField
width: parent.width
placeholderText: "Work"
placeholderText: I18n.tr("Work")
foreground: root.foreground
font.family: root.fontFamily
font.pixelSize: Style.font.body
@@ -1178,7 +1178,7 @@ Panel {
spacing: Style.space(4)
Text {
text: "Confirm this code in your browser"
text: I18n.tr("Confirm this code in your browser")
color: root.dim
font.family: root.fontFamily
font.pixelSize: Style.font.caption
@@ -1202,7 +1202,7 @@ Panel {
Text {
width: parent.width
text: "If the page shows a code instead of finishing, paste it here."
text: I18n.tr("If the page shows a code instead of finishing, paste it here.")
color: root.dim
font.family: root.fontFamily
font.pixelSize: Style.font.caption
@@ -1212,7 +1212,7 @@ Panel {
TextField {
id: pasteField
width: parent.width
placeholderText: "Code"
placeholderText: I18n.tr("Code")
foreground: root.foreground
font.family: root.fontFamily
font.pixelSize: Style.font.body
@@ -1223,7 +1223,7 @@ Panel {
TextLink {
visible: root.addUrl !== ""
text: "Open the sign-in page again"
text: I18n.tr("Open the sign-in page again")
onClicked: root.reopenSignIn()
}
}
@@ -1329,9 +1329,9 @@ Panel {
TextLink {
visible: !section.multi && root.needsSignIn(section.provider)
picked: root.hasKey("providerSignin", section.providerIndex)
text: "Sign-in required"
text: I18n.tr("Sign-in required")
idleColor: root.urgent
tooltip: "Sign in to " + (section.provider ? section.provider.providerName : "") + " again"
tooltip: I18n.tr("Sign in to %1 again", section.provider ? section.provider.providerName : "")
onClicked: root.signInAgain(section.provider, null)
}
@@ -1397,7 +1397,7 @@ Panel {
textFormat: Text.PlainText
width: parent.width * 0.3
anchors.verticalCenter: parent.verticalCenter
text: "Balance"
text: I18n.tr("Balance")
color: root.foreground
font.family: root.fontFamily
font.pixelSize: Style.font.caption
@@ -1567,7 +1567,7 @@ Panel {
PanelToolTip {
visible: tileMouse.containsMouse
text: "Start your default agent on a new " + tile.title.toLowerCase()
text: I18n.tr("Start your default agent on a new %1", tile.title.toLowerCase())
}
}
@@ -1771,9 +1771,9 @@ Panel {
id: signInLink
visible: root.needsSignIn(head.account)
picked: head.pickedKind === "signin"
text: "Sign-in required"
text: I18n.tr("Sign-in required")
idleColor: root.urgent
tooltip: "Sign in to this account again"
tooltip: I18n.tr("Sign in to this account again")
onClicked: root.signInAgain(head.owner, head.account)
}
}
@@ -1809,7 +1809,7 @@ Panel {
id: headActive
visible: head.isActive
anchors.right: parent.right
text: "ACTIVE"
text: I18n.tr("ACTIVE")
color: Color.accent
font.family: root.fontFamily
font.pixelSize: Style.font.caption
@@ -1828,19 +1828,19 @@ Panel {
TextLink {
visible: head.autoOn || useHover.hovered || head.picked
text: head.pickedKind === "autoswitch" ? "Autoswitch ⏎" : "Autoswitch"
text: I18n.tr("Autoswitch") + (head.pickedKind === "autoswitch" ? " ⏎" : "")
picked: head.pickedKind === "autoswitch"
current: head.autoOn
tooltip: head.autoOn
? "Stop switching automatically"
: "Switch here automatically at " + root.switchThreshold(head.owner) + "%"
? I18n.tr("Stop switching automatically")
: I18n.tr("Switch here automatically at %1%", root.switchThreshold(head.owner))
onClicked: root.setSwitchMode(head.owner, head.autoOn ? "manual" : "auto")
}
// With Autoswitch on, Use waits until the line is hovered or picked.
TextLink {
visible: !head.autoOn || useHover.hovered || head.picked
text: head.pickedKind === "account" ? "Use ⏎" : "Use"
text: I18n.tr("Use") + (head.pickedKind === "account" ? " ⏎" : "")
picked: head.pickedKind === "account"
onClicked: root.useAccount(head.owner, head.account)
}
@@ -1857,7 +1857,7 @@ Panel {
Text {
id: unavailableLabel
text: "Usage unavailable"
text: I18n.tr("Usage unavailable")
color: root.dim
font.family: root.fontFamily
font.pixelSize: Style.font.bodySmall
@@ -1867,7 +1867,7 @@ Panel {
PanelToolTip {
visible: unavailableHover.hovered && unavailable.visible
text: unavailable.record ? String(unavailable.record.authHelpText || "Usage has not been updated yet.") : ""
text: unavailable.record ? String(unavailable.record.authHelpText || I18n.tr("Usage has not been updated yet.")) : ""
}
}
@@ -1892,16 +1892,16 @@ Panel {
text: {
var lines = []
if (compact.window) {
lines.push(compact.window.title + ": " + Math.round(compact.window.percent * 100) + "% used"
+ (compact.resetMs > 0 ? " · resets in " + root.formatDuration(compact.resetMs) : ""))
lines.push(I18n.tr("%1: %2% used", compact.window.title, Math.round(compact.window.percent * 100))
+ (compact.resetMs > 0 ? " · " + I18n.tr("resets in %1", root.formatDuration(compact.resetMs)) : ""))
}
if (compact.stale)
lines.push(compact.fetchedAt > 0 && root.nowMs - compact.fetchedAt > 60000
? "Last updated " + root.formatDuration(root.nowMs - compact.fetchedAt) + " ago"
: compact.fetchedAt > 0 ? "Last updated less than a minute ago" : "Last updated time unavailable")
? I18n.tr("Last updated %1 ago", root.formatDuration(root.nowMs - compact.fetchedAt))
: compact.fetchedAt > 0 ? I18n.tr("Last updated less than a minute ago") : I18n.tr("Last updated time unavailable"))
for (var i = 0; i < compact.scoped.length; i++)
lines.push(compact.scoped[i].title + ": " + Math.round(compact.scoped[i].percent * 100) + "% of its "
+ String(compact.window ? compact.window.title : "").toLowerCase() + " allowance")
lines.push(I18n.tr("%1: %2% of its %3 allowance", compact.scoped[i].title, Math.round(compact.scoped[i].percent * 100),
String(compact.window ? compact.window.title : "").toLowerCase()))
return lines.join("\n")
}
}