summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-11 19:35:42 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-11 23:36:34 +1000
commitadee0b8ccbeb8e3b6f77c067312dcf457c0bb5bb (patch)
tree7eb522aa9df554c09dd1f48d25a4ea1cfb57cf85 /pkg/gui
parent0bebfe454e99264cfab7d97c8f861536e1365c6f (diff)
add spans to i18n
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/branches_panel.go16
-rw-r--r--pkg/gui/cherry_picking.go2
-rw-r--r--pkg/gui/commit_files_panel.go4
-rw-r--r--pkg/gui/commit_message_panel.go2
-rw-r--r--pkg/gui/commits_panel.go30
-rw-r--r--pkg/gui/custom_commands.go2
-rw-r--r--pkg/gui/discard_changes_menu_panel.go8
-rw-r--r--pkg/gui/files_panel.go36
-rw-r--r--pkg/gui/git_flow.go4
-rw-r--r--pkg/gui/global_handlers.go2
-rw-r--r--pkg/gui/patch_options_panel.go10
-rw-r--r--pkg/gui/reflog_panel.go2
-rw-r--r--pkg/gui/remote_branches_panel.go4
-rw-r--r--pkg/gui/remotes_panel.go6
-rw-r--r--pkg/gui/staging_panel.go2
-rw-r--r--pkg/gui/stash_panel.go2
-rw-r--r--pkg/gui/sub_commits_panel.go2
-rw-r--r--pkg/gui/submodules_panel.go20
-rw-r--r--pkg/gui/tags_panel.go8
-rw-r--r--pkg/gui/undoing.go4
-rw-r--r--pkg/gui/workspace_reset_options_panel.go12
21 files changed, 89 insertions, 89 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go
index 88ba2d3fd..450ce87eb 100644
--- a/pkg/gui/branches_panel.go
+++ b/pkg/gui/branches_panel.go
@@ -87,7 +87,7 @@ func (gui *Gui) handleBranchPress() error {
return gui.createErrorPanel(gui.Tr.AlreadyCheckedOutBranch)
}
branch := gui.getSelectedBranch()
- return gui.handleCheckoutRef(branch.Name, handleCheckoutRefOptions{span: "Checkout branch"})
+ return gui.handleCheckoutRef(branch.Name, handleCheckoutRefOptions{span: gui.Tr.Spans.CheckoutBranch})
}
func (gui *Gui) handleCreatePullRequestPress() error {
@@ -139,7 +139,7 @@ func (gui *Gui) handleForceCheckout() error {
title: title,
prompt: message,
handleConfirm: func() error {
- if err := gui.GitCommand.WithSpan("Force checkout branch").Checkout(branch.Name, commands.CheckoutOptions{Force: true}); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.ForceCheckoutBranch).Checkout(branch.Name, commands.CheckoutOptions{Force: true}); err != nil {
_ = gui.surfaceError(err)
}
return gui.refreshSidePanels(refreshOptions{mode: ASYNC})
@@ -294,7 +294,7 @@ func (gui *Gui) deleteNamedBranch(selectedBranch *models.Branch, force bool) err
title: title,
prompt: message,
handleConfirm: func() error {
- if err := gui.GitCommand.WithSpan("Delete branch").DeleteBranch(selectedBranch.Name, force); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DeleteBranch).DeleteBranch(selectedBranch.Name, force); err != nil {
errMessage := err.Error()
if !force && strings.Contains(errMessage, "is not fully merged") {
return gui.deleteNamedBranch(selectedBranch, true)
@@ -330,7 +330,7 @@ func (gui *Gui) mergeBranchIntoCheckedOutBranch(branchName string) error {
title: gui.Tr.MergingTitle,
prompt: prompt,
handleConfirm: func() error {
- err := gui.GitCommand.WithSpan("Merge").Merge(branchName, commands.MergeOpts{})
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.Merge).Merge(branchName, commands.MergeOpts{})
return gui.handleGenericMergeCommandResult(err)
},
})
@@ -371,7 +371,7 @@ func (gui *Gui) handleRebaseOntoBranch(selectedBranchName string) error {
title: gui.Tr.RebasingTitle,
prompt: prompt,
handleConfirm: func() error {
- err := gui.GitCommand.WithSpan("Rebase branch").RebaseBranch(selectedBranchName)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.RebaseBranch).RebaseBranch(selectedBranchName)
return gui.handleGenericMergeCommandResult(err)
},
})
@@ -397,7 +397,7 @@ func (gui *Gui) handleFastForward() error {
return gui.surfaceError(err)
}
- span := "Fast forward branch"
+ span := gui.Tr.Spans.FastForwardBranch
split := strings.Split(upstream, "/")
remoteName := split[0]
@@ -444,7 +444,7 @@ func (gui *Gui) handleRenameBranch() error {
title: gui.Tr.NewBranchNamePrompt + " " + branch.Name + ":",
initialContent: branch.Name,
handleConfirm: func(newBranchName string) error {
- if err := gui.GitCommand.WithSpan("Rename branch").RenameBranch(branch.Name, newBranchName); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.RenameBranch).RenameBranch(branch.Name, newBranchName); err != nil {
return gui.surfaceError(err)
}
@@ -513,7 +513,7 @@ func (gui *Gui) handleNewBranchOffCurrentItem() error {
title: message,
initialContent: prefilledName,
handleConfirm: func(response string) error {
- if err := gui.GitCommand.WithSpan("Create branch").NewBranch(sanitizedBranchName(response), item.ID()); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.CreateBranch).NewBranch(sanitizedBranchName(response), item.ID()); err != nil {
return err
}
diff --git a/pkg/gui/cherry_picking.go b/pkg/gui/cherry_picking.go
index b7784997e..fbda109b9 100644
--- a/pkg/gui/cherry_picking.go
+++ b/pkg/gui/cherry_picking.go
@@ -148,7 +148,7 @@ func (gui *Gui) HandlePasteCommits() error {
prompt: gui.Tr.SureCherryPick,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.CherryPickingStatus, func() error {
- err := gui.GitCommand.WithSpan("(Cherry-pick) Paste commits").CherryPickCommits(gui.State.Modes.CherryPicking.CherryPickedCommits)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.CherryPick).CherryPickCommits(gui.State.Modes.CherryPicking.CherryPickedCommits)
return gui.handleGenericMergeCommandResult(err)
})
},
diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go
index 4679a462e..a01551e8d 100644
--- a/pkg/gui/commit_files_panel.go
+++ b/pkg/gui/commit_files_panel.go
@@ -62,7 +62,7 @@ func (gui *Gui) handleCheckoutCommitFile() error {
return nil
}
- if err := gui.GitCommand.WithSpan("Checkout file").CheckoutFile(gui.State.CommitFileManager.GetParent(), node.GetPath()); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.CheckoutFile).CheckoutFile(gui.State.CommitFileManager.GetParent(), node.GetPath()); err != nil {
return gui.surfaceError(err)
}
@@ -81,7 +81,7 @@ func (gui *Gui) handleDiscardOldFileChange() error {
prompt: gui.Tr.DiscardFileChangesPrompt,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error {
- if err := gui.GitCommand.WithSpan("Discard old file change").DiscardOldFileChanges(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, fileName); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DiscardOldFileChange).DiscardOldFileChanges(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, fileName); err != nil {
if err := gui.handleGenericMergeCommandResult(err); err != nil {
return err
}
diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go
index 21a5d2cfc..fb04dafb0 100644
--- a/pkg/gui/commit_message_panel.go
+++ b/pkg/gui/commit_message_panel.go
@@ -21,7 +21,7 @@ func (gui *Gui) handleCommitConfirm() error {
}
cmdStr := gui.GitCommand.CommitCmdStr(message, flags)
- gui.OnRunCommand(oscommands.NewCmdLogEntry(cmdStr, "Commit", true))
+ gui.OnRunCommand(oscommands.NewCmdLogEntry(cmdStr, gui.Tr.Spans.Commit, true))
return gui.withGpgHandling(cmdStr, gui.Tr.CommittingStatus, func() error {
_ = gui.returnFromContext()
gui.clearEditorView(gui.Views.CommitMessage)
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go
index a9294d66e..01264948e 100644
--- a/pkg/gui/commits_panel.go
+++ b/pkg/gui/commits_panel.go
@@ -171,7 +171,7 @@ func (gui *Gui) handleCommitSquashDown() error {
prompt: gui.Tr.SureSquashThisCommit,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.SquashingStatus, func() error {
- err := gui.GitCommand.WithSpan("Squash commit down").InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "squash")
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.SquashCommitDown).InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "squash")
return gui.handleGenericMergeCommandResult(err)
})
},
@@ -200,7 +200,7 @@ func (gui *Gui) handleCommitFixup() error {
prompt: gui.Tr.SureFixupThisCommit,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.FixingStatus, func() error {
- err := gui.GitCommand.WithSpan("Fixup commit").InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "fixup")
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.FixupCommit).InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "fixup")
return gui.handleGenericMergeCommandResult(err)
})
},
@@ -238,7 +238,7 @@ func (gui *Gui) handleRenameCommit() error {
title: gui.Tr.LcRenameCommit,
initialContent: message,
handleConfirm: func(response string) error {
- if err := gui.GitCommand.WithSpan("Reword commit").RenameCommit(response); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.RewordCommit).RenameCommit(response); err != nil {
return gui.surfaceError(err)
}
@@ -260,7 +260,7 @@ func (gui *Gui) handleRenameCommitEditor() error {
return nil
}
- subProcess, err := gui.GitCommand.WithSpan("Reword commit").RewordCommit(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx)
+ subProcess, err := gui.GitCommand.WithSpan(gui.Tr.Spans.RewordCommit).RewordCommit(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx)
if err != nil {
return gui.surfaceError(err)
}
@@ -319,7 +319,7 @@ func (gui *Gui) handleCommitDelete() error {
prompt: gui.Tr.DeleteCommitPrompt,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.DeletingStatus, func() error {
- err := gui.GitCommand.WithSpan("Drop commit").InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "drop")
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.DropCommit).InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "drop")
return gui.handleGenericMergeCommandResult(err)
})
},
@@ -331,7 +331,7 @@ func (gui *Gui) handleCommitMoveDown() error {
return err
}
- span := "Move commit down"
+ span := gui.Tr.Spans.MoveCommitDown
index := gui.State.Panels.Commits.SelectedLineIdx
selectedCommit := gui.State.Commits[index]
@@ -374,7 +374,7 @@ func (gui *Gui) handleCommitMoveUp() error {
return nil
}
- span := "Move commit up"
+ span := gui.Tr.Spans.MoveCommitUp
selectedCommit := gui.State.Commits[index]
if selectedCommit.Status == "rebasing" {
@@ -416,7 +416,7 @@ func (gui *Gui) handleCommitEdit() error {
}
return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error {
- err = gui.GitCommand.WithSpan("Edit commit").InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "edit")
+ err = gui.GitCommand.WithSpan(gui.Tr.Spans.EditCommit).InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "edit")
return gui.handleGenericMergeCommandResult(err)
})
}
@@ -431,7 +431,7 @@ func (gui *Gui) handleCommitAmendTo() error {
prompt: gui.Tr.AmendCommitPrompt,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.AmendingStatus, func() error {
- err := gui.GitCommand.WithSpan("Amend commit").AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.AmendCommit).AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha)
return gui.handleGenericMergeCommandResult(err)
})
},
@@ -461,7 +461,7 @@ func (gui *Gui) handleCommitRevert() error {
return err
}
- if err := gui.GitCommand.WithSpan("Revert commit").Revert(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.RevertCommit).Revert(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha); err != nil {
return gui.surfaceError(err)
}
gui.State.Panels.Commits.SelectedLineIdx++
@@ -498,7 +498,7 @@ func (gui *Gui) handleCreateFixupCommit() error {
title: gui.Tr.CreateFixupCommit,
prompt: prompt,
handleConfirm: func() error {
- if err := gui.GitCommand.WithSpan("Create fixup commit").CreateFixupCommit(commit.Sha); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.CreateFixupCommit).CreateFixupCommit(commit.Sha); err != nil {
return gui.surfaceError(err)
}
@@ -529,7 +529,7 @@ func (gui *Gui) handleSquashAllAboveFixupCommits() error {
prompt: prompt,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.SquashingStatus, func() error {
- err := gui.GitCommand.WithSpan("Squash all above fixup commits").SquashAllAboveFixupCommits(commit.Sha)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.SquashAllAboveFixupCommits).SquashAllAboveFixupCommits(commit.Sha)
return gui.handleGenericMergeCommandResult(err)
})
},
@@ -552,7 +552,7 @@ func (gui *Gui) handleCreateLightweightTag(commitSha string) error {
return gui.prompt(promptOpts{
title: gui.Tr.TagNameTitle,
handleConfirm: func(response string) error {
- if err := gui.GitCommand.WithSpan("Create lightweight tag").CreateLightweightTag(response, commitSha); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.CreateLightweightTag).CreateLightweightTag(response, commitSha); err != nil {
return gui.surfaceError(err)
}
return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{COMMITS, TAGS}})
@@ -570,7 +570,7 @@ func (gui *Gui) handleCheckoutCommit() error {
title: gui.Tr.LcCheckoutCommit,
prompt: gui.Tr.SureCheckoutThisCommit,
handleConfirm: func() error {
- return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{span: "Checkout commit"})
+ return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{span: gui.Tr.Spans.CheckoutCommit})
},
})
}
@@ -625,7 +625,7 @@ func (gui *Gui) handleCopySelectedCommitMessageToClipboard() error {
return gui.surfaceError(err)
}
- if err := gui.OSCommand.WithSpan("Copy commit message to clipboard").CopyToClipboard(message); err != nil {
+ if err := gui.OSCommand.WithSpan(gui.Tr.Spans.CopyCommitMessageToClipboard).CopyToClipboard(message); err != nil {
return gui.surfaceError(err)
}
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go
index 881c53502..06be97da0 100644
--- a/pkg/gui/custom_commands.go
+++ b/pkg/gui/custom_commands.go
@@ -68,7 +68,7 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand config.CustomCommand
loadingText = gui.Tr.LcRunningCustomCommandStatus
}
return gui.WithWaitingStatus(loadingText, func() error {
- if err := gui.OSCommand.WithSpan("Custom command").RunShellCommand(cmdStr); err != nil {
+ if err := gui.OSCommand.WithSpan(gui.Tr.Spans.CustomCommand).RunShellCommand(cmdStr); err != nil {
return gui.surfaceError(err)
}
return gui.refreshSidePanels(refreshOptions{})
diff --git a/pkg/gui/discard_changes_menu_panel.go b/pkg/gui/discard_changes_menu_panel.go
index 853fd53d3..0b1059516 100644
--- a/pkg/gui/discard_changes_menu_panel.go
+++ b/pkg/gui/discard_changes_menu_panel.go
@@ -12,7 +12,7 @@ func (gui *Gui) handleCreateDiscardMenu() error {
{
displayString: gui.Tr.LcDiscardAllChanges,
onPress: func() error {
- if err := gui.GitCommand.WithSpan("Discard all changes in directory").DiscardAllDirChanges(node); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DiscardAllChangesInDirectory).DiscardAllDirChanges(node); err != nil {
return gui.surfaceError(err)
}
return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{FILES}})
@@ -24,7 +24,7 @@ func (gui *Gui) handleCreateDiscardMenu() error {
menuItems = append(menuItems, &menuItem{
displayString: gui.Tr.LcDiscardUnstagedChanges,
onPress: func() error {
- if err := gui.GitCommand.WithSpan("Discard unstaged changes in directory").DiscardUnstagedDirChanges(node); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DiscardUnstagedChangesInDirectory).DiscardUnstagedDirChanges(node); err != nil {
return gui.surfaceError(err)
}
@@ -53,7 +53,7 @@ func (gui *Gui) handleCreateDiscardMenu() error {
displayString: gui.Tr.LcDiscardAllChanges,
onPress: func() error {
gui.Log.Warn("HA?")
- if err := gui.GitCommand.WithSpan("Discard all changes in file").DiscardAllFileChanges(file); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DiscardAllChangesInFile).DiscardAllFileChanges(file); err != nil {
return gui.surfaceError(err)
}
return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{FILES}})
@@ -65,7 +65,7 @@ func (gui *Gui) handleCreateDiscardMenu() error {
menuItems = append(menuItems, &menuItem{
displayString: gui.Tr.LcDiscardUnstagedChanges,
onPress: func() error {
- if err := gui.GitCommand.WithSpan("Discard all unstaged changes in file").DiscardUnstagedFileChanges(file); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DiscardAllUnstagedChangesInFile).DiscardUnstagedFileChanges(file); err != nil {
return gui.surfaceError(err)
}
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 795152bae..34b9e37d2 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -219,11 +219,11 @@ func (gui *Gui) handleFilePress() error {
}
if file.HasUnstagedChanges {
- if err := gui.GitCommand.WithSpan("Stage file").StageFile(file.Name); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.StageFile).StageFile(file.Name); err != nil {
return gui.surfaceError(err)
}
} else {
- if err := gui.GitCommand.WithSpan("Unstage file").UnStageFile(file.Names(), file.Tracked); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.UnstageFile).UnStageFile(file.Names(), file.Tracked); err != nil {
return gui.surfaceError(err)
}
}
@@ -235,12 +235,12 @@ func (gui *Gui) handleFilePress() error {
}
if node.GetHasUnstagedChanges() {
- if err := gui.GitCommand.WithSpan("Stage file").StageFile(node.Path); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.StageFile).StageFile(node.Path); err != nil {
return gui.surfaceError(err)
}
} else {
// pretty sure it doesn't matter that we're always passing true here
- if err := gui.GitCommand.WithSpan("Unstage file").UnStageFile([]string{node.Path}, true); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.UnstageFile).UnStageFile([]string{node.Path}, true); err != nil {
return gui.surfaceError(err)
}
}
@@ -269,9 +269,9 @@ func (gui *Gui) focusAndSelectFile() error {
func (gui *Gui) handleStageAll() error {
var err error
if gui.allFilesStaged() {
- err = gui.GitCommand.WithSpan("Unstage all files").UnstageAll()
+ err = gui.GitCommand.WithSpan(gui.Tr.Spans.UnstageAllFiles).UnstageAll()
} else {
- err = gui.GitCommand.WithSpan("Stage all files").StageAll()
+ err = gui.GitCommand.WithSpan(gui.Tr.Spans.StageAllFiles).StageAll()
}
if err != nil {
_ = gui.surfaceError(err)
@@ -294,7 +294,7 @@ func (gui *Gui) handleIgnoreFile() error {
return gui.createErrorPanel("Cannot ignore .gitignore")
}
- gitCommand := gui.GitCommand.WithSpan("Ignore file")
+ gitCommand := gui.GitCommand.WithSpan(gui.Tr.Spans.IgnoreFile)
unstageFiles := func() error {
return node.ForEachFile(func(file *models.File) error {
@@ -367,7 +367,7 @@ func (gui *Gui) commitPrefixConfigForRepo() *config.CommitPrefixConfig {
func (gui *Gui) prepareFilesForCommit() error {
noStagedFiles := len(gui.stagedFiles()) == 0
if noStagedFiles && gui.Config.GetUserConfig().Gui.SkipNoStagedFilesWarning {
- err := gui.GitCommand.WithSpan("Stage all files").StageAll()
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.StageAllFiles).StageAll()
if err != nil {
return err
}
@@ -422,7 +422,7 @@ func (gui *Gui) promptToStageAllAndRetry(retry func() error) error {
title: gui.Tr.NoFilesStagedTitle,
prompt: gui.Tr.NoFilesStagedPrompt,
handleConfirm: func() error {
- if err := gui.GitCommand.WithSpan("Stage all files").StageAll(); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.StageAllFiles).StageAll(); err != nil {
return gui.surfaceError(err)
}
if err := gui.refreshFilesAndSubmodules(); err != nil {
@@ -452,7 +452,7 @@ func (gui *Gui) handleAmendCommitPress() error {
prompt: gui.Tr.SureToAmend,
handleConfirm: func() error {
cmdStr := gui.GitCommand.AmendHeadCmdStr()
- gui.OnRunCommand(oscommands.NewCmdLogEntry(cmdStr, "Amend commit", true))
+ gui.OnRunCommand(oscommands.NewCmdLogEntry(cmdStr, gui.Tr.Spans.AmendCommit, true))
return gui.withGpgHandling(cmdStr, gui.Tr.AmendingStatus, nil)
},
})
@@ -470,7 +470,7 @@ func (gui *Gui) handleCommitEditorPress() error {
}
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.WithSpan("Commit").PrepareSubProcess("git", "commit"),
+ gui.OSCommand.WithSpan(gui.Tr.Spans.Commit).PrepareSubProcess("git", "commit"),
)
}
@@ -481,7 +481,7 @@ func (gui *Gui) editFile(filename string) error {
}
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.WithSpan("Edit file").PrepareShellSubProcess(cmdStr),
+ gui.OSCommand.WithSpan(gui.Tr.Spans.EditFile).PrepareShellSubProcess(cmdStr),
)
}
@@ -609,7 +609,7 @@ func (gui *Gui) handlePullFiles() error {
return nil
}
- span := "Pull"
+ span := gui.Tr.Spans.Pull
currentBranch := gui.currentBranch()
if currentBranch == nil {
@@ -707,7 +707,7 @@ func (gui *Gui) pushWithForceFlag(force bool, upstream string, args string) erro
}
go utils.Safe(func() {
branchName := gui.getCheckedOutBranch().Name
- err := gui.GitCommand.WithSpan("Push").Push(branchName, force, upstream, args, gui.promptUserForCredential)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.Push).Push(branchName, force, upstream, args, gui.promptUserForCredential)
if err != nil && !force && strings.Contains(err.Error(), "Updates were rejected") {
forcePushDisabled := gui.Config.GetUserConfig().Git.DisableForcePushing
if forcePushDisabled {
@@ -796,7 +796,7 @@ func (gui *Gui) handleSwitchToMerge() error {
}
func (gui *Gui) openFile(filename string) error {
- if err := gui.OSCommand.WithSpan("Open file").OpenFile(filename); err != nil {
+ if err := gui.OSCommand.WithSpan(gui.Tr.Spans.OpenFile).OpenFile(filename); err != nil {
return gui.surfaceError(err)
}
return nil
@@ -815,7 +815,7 @@ func (gui *Gui) handleCustomCommand() error {
return gui.prompt(promptOpts{
title: gui.Tr.CustomCommand,
handleConfirm: func(command string) error {
- gui.OnRunCommand(oscommands.NewCmdLogEntry(command, "Custom command", true))
+ gui.OnRunCommand(oscommands.NewCmdLogEntry(command, gui.Tr.Spans.CustomCommand, true))
return gui.runSubprocessWithSuspenseAndRefresh(
gui.OSCommand.PrepareShellSubProcess(command),
)
@@ -828,13 +828,13 @@ func (gui *Gui) handleCreateStashMenu() error {
{
displayString: gui.Tr.LcStashAllChanges,
onPress: func() error {
- return gui.handleStashSave(gui.GitCommand.WithSpan("Stash all changes").StashSave)
+ return gui.handleStashSave(gui.GitCommand.WithSpan(gui.Tr.Spans.StashAllChanges).StashSave)
},
},
{
displayString: gui.Tr.LcStashStagedChanges,
onPress: func() error {
- return gui.handleStashSave(gui.GitCommand.WithSpan("Stash staged changes").StashSaveStagedChanges)
+ return gui.handleStashSave(gui.GitCommand.WithSpan(gui.Tr.Spans.StashStagedChanges).StashSaveStagedChanges)
},
},
}
diff --git a/pkg/gui/git_flow.go b/pkg/gui/git_flow.go
index 6130118fb..31c64385b 100644
--- a/pkg/gui/git_flow.go
+++ b/pkg/gui/git_flow.go
@@ -32,7 +32,7 @@ func (gui *Gui) gitFlowFinishBranch(gitFlowConfig string, branchName string) err
}
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.WithSpan("Git flow finish").PrepareSubProcess("git", "flow", branchType, "finish", suffix),
+ gui.OSCommand.WithSpan(gui.Tr.Spans.GitFlowFinish).PrepareSubProcess("git", "flow", branchType, "finish", suffix),
)
}
@@ -56,7 +56,7 @@ func (gui *Gui) handleCreateGitFlowMenu() error {
title: title,
handleConfirm: func(name string) error {
return gui.runSubprocessWithSuspenseAndRefresh(
- gui.OSCommand.WithSpan("Git Flow start").PrepareSubProcess("git", "flow", branchType, "start", name),
+ gui.OSCommand.WithSpan(gui.Tr.Spans.GitFlowStart).PrepareSubProcess("git", "flow", branchType, "start", name),
)
},
})
diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go
index 6e098fb6c..b55d6e3a8 100644
--- a/pkg/gui/global_handlers.go
+++ b/pkg/gui/global_handlers.go
@@ -215,7 +215,7 @@ func (gui *Gui) handleCopySelectedSideContextItemToClipboard() error {
return nil
}
- if err := gui.OSCommand.WithSpan("Copy to clipboard").CopyToClipboard(itemId); err != nil {
+ if err := gui.OSCommand.WithSpan(gui.Tr.Spans.CopyToClipboard).CopyToClipboard(itemId); err != nil {
return gui.surfaceError(err)
}
diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go
index 1d31b7e60..3e36c4983 100644
--- a/pkg/gui/patch_options_panel.go
+++ b/pkg/gui/patch_options_panel.go
@@ -98,7 +98,7 @@ func (gui *Gui) handleDeletePatchFromCommit() error {
return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error {
commitIndex := gui.getPatchCommitIndex()
- err := gui.GitCommand.WithSpan("Remove patch from commit").DeletePatchesFromCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.RemovePatchFromCommit).DeletePatchesFromCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager)
return gui.handleGenericMergeCommandResult(err)
})
}
@@ -114,7 +114,7 @@ func (gui *Gui) handleMovePatchToSelectedCommit() error {
return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error {
commitIndex := gui.getPatchCommitIndex()
- err := gui.GitCommand.WithSpan("Move patch to selected commit").MovePatchToSelectedCommit(gui.State.Commits, commitIndex, gui.State.Panels.Commits.SelectedLineIdx, gui.GitCommand.PatchManager)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.MovePatchToSelectedCommit).MovePatchToSelectedCommit(gui.State.Commits, commitIndex, gui.State.Panels.Commits.SelectedLineIdx, gui.GitCommand.PatchManager)
return gui.handleGenericMergeCommandResult(err)
})
}
@@ -131,7 +131,7 @@ func (gui *Gui) handleMovePatchIntoWorkingTree() error {
pull := func(stash bool) error {
return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error {
commitIndex := gui.getPatchCommitIndex()
- err := gui.GitCommand.WithSpan("Move patch into index").MovePatchIntoIndex(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager, stash)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.MovePatchIntoIndex).MovePatchIntoIndex(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager, stash)
return gui.handleGenericMergeCommandResult(err)
})
}
@@ -160,7 +160,7 @@ func (gui *Gui) handlePullPatchIntoNewCommit() error {
return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error {
commitIndex := gui.getPatchCommitIndex()
- err := gui.GitCommand.WithSpan("Move patch into new commit").PullPatchIntoNewCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.MovePatchIntoNewCommit).PullPatchIntoNewCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager)
return gui.handleGenericMergeCommandResult(err)
})
}
@@ -170,7 +170,7 @@ func (gui *Gui) handleApplyPatch(reverse bool) error {
return err
}
- span := "Apply patch"
+ span := gui.Tr.Spans.ApplyPatch
if reverse {
span = "Apply patch in reverse"
}
diff --git a/pkg/gui/reflog_panel.go b/pkg/gui/reflog_panel.go
index 4b5ac1b76..e00d7c223 100644
--- a/pkg/gui/reflog_panel.go
+++ b/pkg/gui/reflog_panel.go
@@ -92,7 +92,7 @@ func (gui *Gui) handleCheckoutReflogCommit() error {
title: gui.Tr.LcCheckoutCommit,
prompt: gui.Tr.SureCheckoutThisCommit,
handleConfirm: func() error {
- return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{span: "Checkout reflog commit"})
+ return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{span: gui.Tr.Spans.CheckoutReflogCommit})
},
})
if err != nil {
diff --git a/pkg/gui/remote_branches_panel.go b/pkg/gui/remote_branches_panel.go
index 6f87d8747..23fcc32f6 100644
--- a/pkg/gui/remote_branches_panel.go
+++ b/pkg/gui/remote_branches_panel.go
@@ -59,7 +59,7 @@ func (gui *Gui) handleDeleteRemoteBranch() error {
prompt: message,
handleConfirm: func() error {
return gui.WithWaitingStatus(gui.Tr.DeletingStatus, func() error {
- err := gui.GitCommand.WithSpan("Delete remote branch").DeleteRemoteBranch(remoteBranch.RemoteName, remoteBranch.Name, gui.promptUserForCredential)
+ err := gui.GitCommand.WithSpan(gui.Tr.Spans.DeleteRemoteBranch).DeleteRemoteBranch(remoteBranch.RemoteName, remoteBranch.Name, gui.promptUserForCredential)
gui.handleCredentialsPopup(err)
return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{BRANCHES, REMOTES}})
@@ -89,7 +89,7 @@ func (gui *Gui) handleSetBranchUpstream() error {
title: gui.Tr.SetUpstreamTitle,
prompt: message,
handleConfirm: func() error {
- if err := gui.GitCommand.WithSpan("Set branch upstream").SetBranchUpstream(selectedBranch.RemoteName, selectedBranch.Name, checkedOutBranch.Name); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.SetBranchUpstream).SetBranchUpstream(selectedBranch.RemoteName, selectedBranch.Name, checkedOutBranch.Name); err != nil {
return err
}
diff --git a/pkg/gui/remotes_panel.go b/pkg/gui/remotes_panel.go
index 00feb5680..740a58da3 100644
--- a/pkg/gui/remotes_panel.go
+++ b/pkg/gui/remotes_panel.go
@@ -85,7 +85,7 @@ func (gui *Gui) handleAddRemote() error {
return gui.prompt(promptOpts{
title: gui.Tr.LcNewRemoteUrl,
handleConfirm: func(remoteUrl string) error {
- if err := gui.GitCommand.WithSpan("Add remote").AddRemote(remoteName, remoteUrl); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.AddRemote).AddRemote(remoteName, remoteUrl); err != nil {
return err
}
return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{REMOTES}})
@@ -106,7 +106,7 @@ func (gui *Gui) handleRemoveRemote() error {
title: gui.Tr.LcRemoveRemote,
prompt: gui.Tr.LcRemoveRemotePrompt + " '" + remote.Name + "'?",
handleConfirm: func() error {
- if err := gui.GitCommand.WithSpan("Remove remote").RemoveRemote(remote.Name); err != nil {
+ if err := gui.GitCommand.WithSpan(gui.Tr.Spans.RemoveRemote).RemoveRemote(remote.Name); err != nil {
return gui.surfaceError(err)
}
@@ -128,7 +128,7 @@ func (gui *Gui) handleEditRemote() error {
},
)
- gitCommand := gui.GitCommand.WithSpan("Update remote")
+ gitCommand := gui.GitCommand.WithSpan(gui.Tr.Spans.UpdateRemote)
return gui.prompt(promptOpts{
title: editNameMessage,
diff --git a/pkg/gui/staging_panel.go b/pkg/gui/staging_panel.go
index 612806f94..0a6ccfa3d 100644
--- a/pkg/gui/staging_panel.go
+++ b/