From 7e926cf41da55461fbd02d2a4ce4e3c2318db0a8 Mon Sep 17 00:00:00 2001 From: Mark Kopenga Date: Wed, 15 Aug 2018 10:53:05 +0200 Subject: Added translation for pkg/gui/ confirmation_panel.go gui.go merge_panel.go --- pkg/gui/confirmation_panel.go | 14 +++++++++++--- pkg/gui/gui.go | 2 +- pkg/gui/merge_panel.go | 10 +++++----- pkg/i18n/dutch.go | 26 +++++++++++++++++++++++++- 4 files changed, 42 insertions(+), 10 deletions(-) (limited to 'pkg') 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 } diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 11c6cae74..5aabca8a8 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -44,7 +44,7 @@ type SentinelErrors struct { // localising things in the code. func (gui *Gui) GenerateSentinelErrors() { gui.Errors = SentinelErrors{ - ErrSubProcess: errors.New("running subprocess"), + ErrSubProcess: errors.New(gui.Tr.SLocalize("RunningSubprocess", "running subprocess")), ErrNoFiles: errors.New(gui.Tr.SLocalize("NoChangedFiles", "No changed files")), } } diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go index 81e37f593..213bac739 100644 --- a/pkg/gui/merge_panel.go +++ b/pkg/gui/merge_panel.go @@ -232,11 +232,11 @@ func (gui *Gui) switchToMerging(g *gocui.Gui) error { func (gui *Gui) renderMergeOptions(g *gocui.Gui) error { return gui.renderOptionsMap(g, map[string]string{ - "↑ ↓": "select hunk", - "← →": "navigate conflicts", - "space": "pick hunk", - "b": "pick both hunks", - "z": "undo", + "↑ ↓": gui.Tr.SLocalize("selectHunk", "select hunk"), + "← →": gui.Tr.SLocalize("navigateConflicts", "navigate conflicts"), + "space": gui.Tr.SLocalize("pickHunk", "pick hunk"), + "b": gui.Tr.SLocalize("pickBothHunks", "pick both hunks"), + "z": gui.Tr.SLocalize("undo", "undo"), }) } diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index ccc285386..1f59529b0 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -141,7 +141,7 @@ func addDutch(i18nObject *i18n.Bundle) { Other: "Je kan niet een branch in zichzelf mergen", }, &i18n.Message{ ID: "forceCheckout", - Other: "forceren checkout", + Other: "forceer checkout", }, &i18n.Message{ ID: "merge", Other: "merge", @@ -214,6 +214,30 @@ func addDutch(i18nObject *i18n.Bundle) { }, &i18n.Message{ ID: "NoCommitsThisBranch", Other: "Geen commits voor deze branch", + }, &i18n.Message{ + ID: "Error", + Other: "Error", + }, &i18n.Message{ + ID: "resizingPopupPanel", + Other: "resizen popup paneel", + }, &i18n.Message{ + ID: "RunningSubprocess", + Other: "subprocess lopend", + }, &i18n.Message{ + ID: "selectHunk", + Other: "selecteer Hunk", + }, &i18n.Message{ + ID: "navigateConflicts", + Other: "navigeer conflicts", + }, &i18n.Message{ + ID: "pickHunk", + Other: "kies Hunk", + }, &i18n.Message{ + ID: "pickBothHunks", + Other: "kies bijde hunks", + }, &i18n.Message{ + ID: "undo", + Other: "ongedaan maken", }, ) } -- cgit v1.2.3