diff options
author | Mark Kopenga <mkopenga@gmail.com> | 2018-08-15 11:12:46 +0200 |
---|---|---|
committer | Mark Kopenga <mkopenga@gmail.com> | 2018-08-15 11:12:46 +0200 |
commit | 295093a432f991869abc52bc7cb00addd0032bf1 (patch) | |
tree | 6c4d3d56e437ce740c8a37a54731667be9a3a77f /pkg/gui/stash_panel.go | |
parent | 10c53162ca99250b25ec15dbfad66f425af35342 (diff) |
Translated pkg/gui/stash_panel.go
Diffstat (limited to 'pkg/gui/stash_panel.go')
-rw-r--r-- | pkg/gui/stash_panel.go | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go index b4fb11902..96d7baba7 100644 --- a/pkg/gui/stash_panel.go +++ b/pkg/gui/stash_panel.go @@ -33,10 +33,10 @@ func (gui *Gui) getSelectedStashEntry(v *gocui.View) *commands.StashEntry { func (gui *Gui) renderStashOptions(g *gocui.Gui) error { return gui.renderOptionsMap(g, map[string]string{ - "space": "apply", - "g": "pop", - "d": "drop", - "← → ↑ ↓": "navigate", + "space": gui.Tr.SLocalize("apply", "apply"), + "g": gui.Tr.SLocalize("pop", "pop"), + "d": gui.Tr.SLocalize("drop", "drop"), + "← → ↑ ↓": gui.Tr.SLocalize("navigate", "navigate"), }) } @@ -47,7 +47,7 @@ func (gui *Gui) handleStashEntrySelect(g *gocui.Gui, v *gocui.View) error { go func() { stashEntry := gui.getSelectedStashEntry(v) if stashEntry == nil { - gui.renderString(g, "main", "No stash entries") + gui.renderString(g, "main", gui.Tr.SLocalize("NoStashEntries", "No stash entries")) return } diff, _ := gui.GitCommand.GetStashEntryDiff(stashEntry.Index) @@ -65,7 +65,9 @@ func (gui *Gui) handleStashPop(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleStashDrop(g *gocui.Gui, v *gocui.View) error { - return gui.createConfirmationPanel(g, v, "Stash drop", "Are you sure you want to drop this stash entry?", func(g *gocui.Gui, v *gocui.View) error { + title := gui.Tr.SLocalize("StashDrop", "Stash drop") + message := gui.Tr.SLocalize("SureDropStashEntry", "Are you sure you want to drop this stash entry?") + return gui.createConfirmationPanel(g, v, title, message, func(g *gocui.Gui, v *gocui.View) error { return gui.stashDo(g, v, "drop") }, nil) } @@ -73,7 +75,14 @@ func (gui *Gui) handleStashDrop(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) stashDo(g *gocui.Gui, v *gocui.View, method string) error { stashEntry := gui.getSelectedStashEntry(v) if stashEntry == nil { - return gui.createErrorPanel(g, "No stash to "+method) + errorMessage := gui.Tr.TemplateLocalize( + "NoStashTo", + "No stash to {{.method}}", + map[string]interface{}{ + "method": method, + }, + ) + return gui.createErrorPanel(g, errorMessage) } if err := gui.GitCommand.StashDo(stashEntry.Index, method); err != nil { gui.createErrorPanel(g, err.Error()) @@ -84,9 +93,9 @@ func (gui *Gui) stashDo(g *gocui.Gui, v *gocui.View, method string) error { func (gui *Gui) handleStashSave(g *gocui.Gui, filesView *gocui.View) error { if len(gui.trackedFiles()) == 0 && len(gui.stagedFiles()) == 0 { - return gui.createErrorPanel(g, "You have no tracked/staged files to stash") + return gui.createErrorPanel(g, gui.Tr.SLocalize("NoTrackedStagedFilesStash", "You have no tracked/staged files to stash")) } - gui.createPromptPanel(g, filesView, "Stash changes", func(g *gocui.Gui, v *gocui.View) error { + gui.createPromptPanel(g, filesView, gui.Tr.SLocalize("StashChanges", "Stash changes"), func(g *gocui.Gui, v *gocui.View) error { if err := gui.GitCommand.StashSave(gui.trimmedContent(v)); err != nil { gui.createErrorPanel(g, err.Error()) } |