Skip to content

Commit

Permalink
Localize minimized note view
Browse files Browse the repository at this point in the history
  • Loading branch information
diegotid committed Nov 1, 2024
1 parent a734751 commit 48c4881
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 2 deletions.
69 changes: 69 additions & 0 deletions Tildone/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,29 @@
}
}
},
"all done" : {
"extractionState" : "manual",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "completado"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "complète"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "全部完成"
}
}
}
},
"Appearance" : {
"localizations" : {
"es" : {
Expand Down Expand Up @@ -874,6 +897,29 @@
}
}
},
"no tasks" : {
"extractionState" : "manual",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "vacío"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "aucune"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "没有任务"
}
}
}
},
"Note may stay in the background" : {
"localizations" : {
"es" : {
Expand Down Expand Up @@ -940,6 +986,29 @@
}
}
},
"pending" : {
"extractionState" : "manual",
"localizations" : {
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "pendiente"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "incomplète"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "待处理"
}
}
}
},
"Quit Tildone" : {
"localizations" : {
"es" : {
Expand Down
9 changes: 7 additions & 2 deletions Tildone/Views/Note.swift
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,18 @@ private extension Note {
let progressGoal = list.items.isEmpty ? 1 : list.items.count
let progressComplete: Bool = pendingCount == 0 && !list.items.isEmpty
let color: Color = progressComplete ? .accentColor : Color(nsColor: .checkboxBorder)
let label: String = progressComplete ? "all done" : (list.items.isEmpty ? "no tasks" : "pending")
let allDoneLabel = NSLocalizedString("all done", comment: "All tasks are completed")
let pendingLabel = NSLocalizedString("pending", comment: "Tasks are pending")
let emptyLabel = NSLocalizedString("no tasks", comment: "No tasks available")
let label: String = progressComplete ? allDoneLabel : (list.items.isEmpty ? emptyLabel : pendingLabel)
Gauge(value: progressValue, in: 0...Float(progressGoal)) {
Text(label)
.font(.system(size: 10))
.foregroundStyle(color)
.padding(.top, 6)
.padding(.leading, -16)
.padding(.trailing, 6)
.padding(.leading, -19)
.frame(maxWidth: .infinity, alignment: .trailing)
} currentValueLabel: {
Text("\(pendingCount)")
.bold()
Expand Down

0 comments on commit 48c4881

Please sign in to comment.