summaryrefslogtreecommitdiffstats
path: root/widgets/batterygauge.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/batterygauge.go')
-rw-r--r--widgets/batterygauge.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go
index 135f223..20d92d4 100644
--- a/widgets/batterygauge.go
+++ b/widgets/batterygauge.go
@@ -18,7 +18,7 @@ type BatteryGauge struct {
func NewBatteryGauge() *BatteryGauge {
self := &BatteryGauge{Gauge: termui.NewGauge()}
- self.Title = " Power Level "
+ self.Title = tr.Value("widget.label.gauge")
self.update()
@@ -51,6 +51,10 @@ func (b *BatteryGauge) update() {
}
return
}
+ if len(bats) < 1 {
+ b.Label = fmt.Sprintf("N/A")
+ return
+ }
mx := 0.0
cu := 0.0
charging := "%d%% ⚡%s"