diff options
author | Sean E. Russell <ser@ser1.net> | 2020-11-23 14:58:32 -0600 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-11-23 14:58:32 -0600 |
commit | daf5916fde35c7ae2a69fc45a32f9c684d88fe2b (patch) | |
tree | 2090650c190b4a517d6d1f4da8fde1cb3b2c2563 /widgets/proc.go | |
parent | 72cde0545887f98e58423c1495327276daa202b5 (diff) | |
parent | edf0c2a3a8edd43a685ef91c2e3f9f3ea7d5bc23 (diff) |
Resolves merge conflicts
Diffstat (limited to 'widgets/proc.go')
-rw-r--r-- | widgets/proc.go | 17 |
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 |