fix(ui): 校正三语指标文案并核对构建包译文

This commit is contained in:
2026-11-16 00:17:42 +08:00
parent 3ee6b45eb4
commit 36518d29db
10 changed files with 172 additions and 38 deletions
+10 -7
View File
@@ -7,7 +7,7 @@ struct StorageDetailsView: View {
var body: some View {
VStack(alignment: .leading, spacing: 3) {
field("memory.available", value: MetricFormat.bytes(disk?.available))
field("memory.available", value: Text(verbatim: MetricFormat.bytes(disk?.available)))
ViewThatFits(in: .horizontal) {
HStack(spacing: 6) { read; write }.fixedSize(horizontal: true, vertical: true)
VStack(alignment: .leading, spacing: 3) { read; write }
@@ -24,15 +24,18 @@ struct StorageDetailsView: View {
.font(.system(size: 10)).lineLimit(1)
}
private var read: some View { field("disk.read", value: MetricFormat.rate(io?.read)) }
private var write: some View { field("disk.write", value: MetricFormat.rate(io?.written)) }
private var life: some View { field("disk.lifeShort", value: MetricFormat.percent(health?.remainingLife)) }
private var powerOn: some View { field("disk.powerOnShort", value: health?.powerOnHours.map { "\($0) h" } ?? "--") }
private var read: some View { field("disk.read", value: Text(verbatim: MetricFormat.rate(io?.read))) }
private var write: some View { field("disk.write", value: Text(verbatim: MetricFormat.rate(io?.written))) }
private var life: some View { field("disk.lifeShort", value: Text(verbatim: MetricFormat.percent(health?.remainingLife))) }
private var powerOn: some View {
let hours = health?.powerOnHours.map { Text("duration.hours \(String($0))") }
return field("disk.powerOnShort", value: hours ?? Text(verbatim: "--"))
}
private func field(_ title: LocalizedStringKey, value: String) -> some View {
private func field(_ title: LocalizedStringKey, value: Text) -> some View {
HStack(spacing: 3) {
Text(title).foregroundStyle(.secondary).help(Text(title))
MetricText(value: value).fontWeight(.medium).foregroundStyle(.primary)
value.monospacedDigit().fontWeight(.medium).foregroundStyle(.primary)
}.frame(height: 14)
}
}