diff options
Diffstat (limited to 'pkg/gui/confirmation_panel.go')
-rw-r--r-- | pkg/gui/confirmation_panel.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index 3bec18419..0a1cd0c5b 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -113,7 +113,15 @@ func (gui *Gui) handleNewline(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) setKeyBindings(g *gocui.Gui, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error { - gui.renderString(g, "options", "esc: close, enter: confirm") + actions := gui.Tr.TemplateLocalize( + "CloseConfirm", + "{{.keyBindClose}}: close, {{.keyBindConfirm}}: confirm", + map[string]interface{}{ + "keyBindClose": "esc", + "keyBindConfirm": "enter", + }, + ) + gui.renderString(g, "options", actions) if err := g.SetKeybinding("confirmation", gocui.KeyEnter, gocui.ModNone, gui.wrappedConfirmationFunction(handleConfirm)); err != nil { return err } @@ -131,7 +139,7 @@ func (gui *Gui) createErrorPanel(g *gocui.Gui, message string) error { currentView := g.CurrentView() colorFunction := color.New(color.FgRed).SprintFunc() coloredMessage := colorFunction(strings.TrimSpace(message)) - return gui.createConfirmationPanel(g, currentView, "Error", coloredMessage, nil, nil) + return gui.createConfirmationPanel(g, currentView, gui.Tr.SLocalize("Error", "Error"), coloredMessage, nil, nil) } func (gui *Gui) resizePopupPanel(g *gocui.Gui, v *gocui.View) error { @@ -143,7 +151,7 @@ func (gui *Gui) resizePopupPanel(g *gocui.Gui, v *gocui.View) error { if vx0 == x0 && vy0 == y0 && vx1 == x1 && vy1 == y1 { return nil } - gui.Log.Info("resizing popup panel") + gui.Log.Info(gui.Tr.SLocalize("resizingPopupPanel", "resizing popup panel")) _, err := g.SetView(v.Name(), x0, y0, x1, y1, 0) return err } |