summaryrefslogtreecommitdiffstats
path: root/widgets/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/proc.go')
-rw-r--r--widgets/proc.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/widgets/proc.go b/widgets/proc.go
index 218ba63..408906c 100644
--- a/widgets/proc.go
+++ b/widgets/proc.go
@@ -50,7 +50,7 @@ type ProcWidget struct {
func NewProcWidget() *ProcWidget {
cpuCount, err := devices.CpuCount()
if err != nil {
- log.Printf("failed to get CPU count from gopsutil: %v", err)
+ log.Println(tr.Value("error.proc.err.count", err.Error()))
}
self := &ProcWidget{
Table: ui.NewTable(),
@@ -62,14 +62,14 @@ func NewProcWidget() *ProcWidget {
}
self.entry = &ui.Entry{
Style: self.TitleStyle,
- Label: " Filter: ",
+ Label: tr.Value("widget.proc.filter"),
Value: "",
UpdateCallback: func(val string) {
self.filter = val
self.update()
},
}
- self.Title = " Processes "
+ self.Title = tr.Value("widget.proc.label")
self.ShowCursor = true
self.ShowLocation = true
self.ColGap = 3
@@ -136,7 +136,7 @@ func (proc *ProcWidget) filterProcs(procs []Proc) []Proc {
func (proc *ProcWidget) update() {
procs, err := getProcs()
if err != nil {
- log.Printf("failed to retrieve processes: %v", err)
+ log.Printf(tr.Value("widget.proc.error.retrieve", err.Error()))
return
}
@@ -156,10 +156,15 @@ func (proc *ProcWidget) update() {
// sortProcs sorts either the grouped or ungrouped []Process based on the sortMethod.
// Called with every update, when the sort method is changed, and when processes are grouped and ungrouped.
func (proc *ProcWidget) sortProcs() {
- proc.Header = []string{"Count", "Command", "CPU%", "Mem%"}
+ proc.Header = []string{
+ tr.Value("widget.proc.header.count"),
+ tr.Value("widget.proc.header.command"),
+ tr.Value("widget.proc.header.cpu"),
+ tr.Value("widget.proc.header.mem"),
+ }
if !proc.showGroupedProcs {
- proc.Header[0] = "PID"
+ proc.Header[0] = tr.Value("widget.proc.header.pid")
}
var procs *[]Proc