diff options
-rw-r--r-- | pkg/gui/commits_panel.go | 20 | ||||
-rw-r--r-- | pkg/gui/merge_panel.go | 15 | ||||
-rw-r--r-- | pkg/i18n/dutch.go | 21 | ||||
-rw-r--r-- | pkg/i18n/english.go | 21 | ||||
-rw-r--r-- | pkg/i18n/polish.go | 21 |
5 files changed, 82 insertions, 16 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 2cdfc8853..2154ad5c9 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -144,7 +144,7 @@ func (gui *Gui) handleCommitSquashDown(g *gocui.Gui, v *gocui.View) error { } gui.createConfirmationPanel(g, v, gui.Tr.SLocalize("Squash"), gui.Tr.SLocalize("SureSquashThisCommit"), func(g *gocui.Gui, v *gocui.View) error { - return gui.WithWaitingStatus("squashing", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("SquashingStatus"), func() error { err := gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLine, "squash") return gui.handleGenericMergeCommandResult(err) }) @@ -176,7 +176,7 @@ func (gui *Gui) handleCommitFixup(g *gocui.Gui, v *gocui.View) error { } gui.createConfirmationPanel(g, v, gui.Tr.SLocalize("Fixup"), gui.Tr.SLocalize("SureFixupThisCommit"), func(g *gocui.Gui, v *gocui.View) error { - return gui.WithWaitingStatus("fixing up", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("FixingStatus"), func() error { err := gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLine, "fixup") return gui.handleGenericMergeCommandResult(err) }) @@ -276,7 +276,7 @@ func (gui *Gui) handleCommitDelete(g *gocui.Gui, v *gocui.View) error { } return gui.createConfirmationPanel(gui.g, v, gui.Tr.SLocalize("DeleteCommitTitle"), gui.Tr.SLocalize("DeleteCommitPrompt"), func(*gocui.Gui, *gocui.View) error { - return gui.WithWaitingStatus("deleting", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("DeletingStatus"), func() error { err := gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLine, "drop") return gui.handleGenericMergeCommandResult(err) }) @@ -297,7 +297,7 @@ func (gui *Gui) handleCommitMoveDown(g *gocui.Gui, v *gocui.View) error { return gui.refreshCommits(gui.g) } - return gui.WithWaitingStatus("moving", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("MovingStatus"), func() error { err := gui.GitCommand.MoveCommitDown(gui.State.Commits, index) if err == nil { gui.State.Panels.Commits.SelectedLine++ @@ -320,7 +320,7 @@ func (gui *Gui) handleCommitMoveUp(g *gocui.Gui, v *gocui.View) error { return gui.refreshCommits(gui.g) } - return gui.WithWaitingStatus("moving", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("MovingStatus"), func() error { err := gui.GitCommand.MoveCommitDown(gui.State.Commits, index-1) if err == nil { gui.State.Panels.Commits.SelectedLine-- @@ -338,7 +338,7 @@ func (gui *Gui) handleCommitEdit(g *gocui.Gui, v *gocui.View) error { return nil } - return gui.WithWaitingStatus("rebasing", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { err = gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLine, "edit") return gui.handleGenericMergeCommandResult(err) }) @@ -346,7 +346,7 @@ func (gui *Gui) handleCommitEdit(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleCommitAmendTo(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(gui.g, v, gui.Tr.SLocalize("AmendCommitTitle"), gui.Tr.SLocalize("AmendCommitPrompt"), func(*gocui.Gui, *gocui.View) error { - return gui.WithWaitingStatus("amending", func() error { + return gui.WithWaitingStatus(gui.Tr.SLocalize("AmendingStatus"), func() error { err := gui.GitCommand.AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLine].Sha) return gui.handleGenericMergeCommandResult(err) }) @@ -431,7 +431,9 @@ func (gui *Gui) handleCopyCommitRange(g *gocui.Gui, v *gocui.View) error { // HandlePasteCommits begins a cherry-pick rebase with the commits the user has copied func (gui *Gui) HandlePasteCommits(g *gocui.Gui, v *gocui.View) error { return gui.createConfirmationPanel(g, v, gui.Tr.SLocalize("CherryPick"), gui.Tr.SLocalize("SureCherryPick"), func(g *gocui.Gui, v *gocui.View) error { - err := gui.GitCommand.CherryPickCommits(gui.State.CherryPickedCommits) - return gui.handleGenericMergeCommandResult(err) + return gui.WithWaitingStatus(gui.Tr.SLocalize("CherryPickingStatus"), func() error { + err := gui.GitCommand.CherryPickCommits(gui.State.CherryPickedCommits) + return gui.handleGenericMergeCommandResult(err) + }) }, nil) } diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go index 0d10ed4d7..1b4f1a88f 100644 --- a/pkg/gui/merge_panel.go +++ b/pkg/gui/merge_panel.go @@ -264,7 +264,6 @@ func (gui *Gui) handleEscapeMerge(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleCompleteMerge() error { - filesView := gui.getFilesView() if err := gui.stageSelectedFile(gui.g); err != nil { return err } @@ -278,12 +277,14 @@ func (gui *Gui) handleCompleteMerge() error { } // if there are no more files with merge conflicts, we should ask whether the user wants to continue if !gui.anyFilesWithMergeConflicts() { - // ask if user wants to continue - if err := gui.createConfirmationPanel(gui.g, filesView, "continue", gui.Tr.SLocalize("ConflictsResolved"), func(g *gocui.Gui, v *gocui.View) error { - return gui.genericMergeCommand("continue") - }, nil); err != nil { - return err - } + return gui.promptToContinue() } return gui.handleEscapeMerge(gui.g, gui.getMainView()) } + +// promptToContinue asks the user if they want to continue the rebase/merge that's in progress +func (gui *Gui) promptToContinue() error { + return gui.createConfirmationPanel(gui.g, gui.getFilesView(), "continue", gui.Tr.SLocalize("ConflictsResolved"), func(g *gocui.Gui, v *gocui.View) error { + return gui.genericMergeCommand("continue") + }, nil) +} diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index 6f0ec66dd..9c0b63b90 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -622,6 +622,27 @@ func addDutch(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "DeleteCommitPrompt", Other: "Are you sure you want to delete this commit?", + }, &i18n.Message{ + ID: "SquashingStatus", + Other: "squashing", + }, &i18n.Message{ + ID: "FixingStatus", + Other: "fixing up", + }, &i18n.Message{ + ID: "DeletingStatus", + Other: "deleting", + }, &i18n.Message{ + ID: "MovingStatus", + Other: "moving", + }, &i18n.Message{ + ID: "RebasingStatus", + Other: "rebasing", + }, &i18n.Message{ + ID: "AmendingStatus", + Other: "amending", + }, &i18n.Message{ + ID: "CherryPickingStatus", + Other: "cherry-picking", }, ) } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 3727d30ce..d397398ae 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -645,6 +645,27 @@ func addEnglish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "DeleteCommitPrompt", Other: "Are you sure you want to delete this commit?", + }, &i18n.Message{ + ID: "SquashingStatus", + Other: "squashing", + }, &i18n.Message{ + ID: "FixingStatus", + Other: "fixing up", + }, &i18n.Message{ + ID: "DeletingStatus", + Other: "deleting", + }, &i18n.Message{ + ID: "MovingStatus", + Other: "moving", + }, &i18n.Message{ + ID: "RebasingStatus", + Other: "rebasing", + }, &i18n.Message{ + ID: "AmendingStatus", + Other: "amending", + }, &i18n.Message{ + ID: "CherryPickingStatus", + Other: "cherry-picking", }, ) } diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 6cef94b2c..8fb7c5e88 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -605,6 +605,27 @@ func addPolish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "DeleteCommitPrompt", Other: "Are you sure you want to delete this commit?", + }, &i18n.Message{ + ID: "SquashingStatus", + Other: "squashing", + }, &i18n.Message{ + ID: "FixingStatus", + Other: "fixing up", + }, &i18n.Message{ + ID: "DeletingStatus", + Other: "deleting", + }, &i18n.Message{ + ID: "MovingStatus", + Other: "moving", + }, &i18n.Message{ + ID: "RebasingStatus", + Other: "rebasing", + }, &i18n.Message{ + ID: "AmendingStatus", + Other: "amending", + }, &i18n.Message{ + ID: "CherryPickingStatus", + Other: "cherry-picking", }, ) } |