From adee0b8ccbeb8e3b6f77c067312dcf457c0bb5bb Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 11 Apr 2021 19:35:42 +1000 Subject: add spans to i18n --- pkg/gui/branches_panel.go | 16 +++++++------- pkg/gui/cherry_picking.go | 2 +- pkg/gui/commit_files_panel.go | 4 ++-- pkg/gui/commit_message_panel.go | 2 +- pkg/gui/commits_panel.go | 30 +++++++++++++------------- pkg/gui/custom_commands.go | 2 +- pkg/gui/discard_changes_menu_panel.go | 8 +++---- pkg/gui/files_panel.go | 36 ++++++++++++++++---------------- pkg/gui/git_flow.go | 4 ++-- pkg/gui/global_handlers.go | 2 +- pkg/gui/patch_options_panel.go | 10 ++++----- pkg/gui/reflog_panel.go | 2 +- pkg/gui/remote_branches_panel.go | 4 ++-- pkg/gui/remotes_panel.go | 6 +++--- pkg/gui/staging_panel.go | 2 +- pkg/gui/stash_panel.go | 2 +- pkg/gui/sub_commits_panel.go | 2 +- pkg/gui/submodules_panel.go | 20 +++++++++--------- pkg/gui/tags_panel.go | 8 +++---- pkg/gui/undoing.go | 4 ++-- pkg/gui/workspace_reset_options_panel.go | 12 +++++------ 21 files changed, 89 insertions(+), 89 deletions(-) (limited to 'pkg/gui') 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/pkg/gui/staging_panel.go @@ -142,7 +142,7 @@ func (gui *Gui) applySelection(reverse bool, state *lBlPanelState) error { if !reverse || state.SecondaryFocused { applyFlags = append(applyFlags, "cached") } - err := gui.GitCommand.WithSpan("Apply patch").ApplyPatch(patch, applyFlags...) + err := gui.GitCommand.WithSpan(gui.Tr.Spans.ApplyPatch).ApplyPatch(patch, applyFlags...) if err != nil { return gui.surfaceError(err) } diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go index a87ae2681..d72b32451 100644 --- a/pkg/gui/stash_panel.go +++ b/pkg/gui/stash_panel.go @@ -106,7 +106,7 @@ func (gui *Gui) stashDo(method string) error { return gui.createErrorPanel(errorMessage) } - if err := gui.GitCommand.WithSpan("Stash").StashDo(stashEntry.Index, method); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.Stash).StashDo(stashEntry.Index, method); err != nil { return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{STASH, FILES}}) diff --git a/pkg/gui/sub_commits_panel.go b/pkg/gui/sub_commits_panel.go index 24ea834d4..f1c27388a 100644 --- a/pkg/gui/sub_commits_panel.go +++ b/pkg/gui/sub_commits_panel.go @@ -48,7 +48,7 @@ func (gui *Gui) handleCheckoutSubCommit() 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}) }, }) if err != nil { diff --git a/pkg/gui/submodules_panel.go b/pkg/gui/submodules_panel.go index a9d1d2eca..8a1d8d753 100644 --- a/pkg/gui/submodules_panel.go +++ b/pkg/gui/submodules_panel.go @@ -81,7 +81,7 @@ func (gui *Gui) removeSubmodule(submodule *models.SubmoduleConfig) error { title: gui.Tr.RemoveSubmodule, prompt: fmt.Sprintf(gui.Tr.RemoveSubmodulePrompt, submodule.Name), handleConfirm: func() error { - if err := gui.GitCommand.WithSpan("Remove submodule").SubmoduleDelete(submodule); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.RemoveSubmodule).SubmoduleDelete(submodule); err != nil { return gui.surfaceError(err) } @@ -107,7 +107,7 @@ func (gui *Gui) fileForSubmodule(submodule *models.SubmoduleConfig) *models.File } func (gui *Gui) resetSubmodule(submodule *models.SubmoduleConfig) error { - gitCommand := gui.GitCommand.WithSpan("Reset submodule") + gitCommand := gui.GitCommand.WithSpan(gui.Tr.Spans.ResetSubmodule) file := gui.fileForSubmodule(submodule) if file != nil { @@ -142,7 +142,7 @@ func (gui *Gui) handleAddSubmodule() error { initialContent: submoduleName, handleConfirm: func(submodulePath string) error { return gui.WithWaitingStatus(gui.Tr.LcAddingSubmoduleStatus, func() error { - err := gui.GitCommand.WithSpan("Add submodule").SubmoduleAdd(submoduleName, submodulePath, submoduleUrl) + err := gui.GitCommand.WithSpan(gui.Tr.Spans.AddSubmodule).SubmoduleAdd(submoduleName, submodulePath, submoduleUrl) gui.handleCredentialsPopup(err) return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{SUBMODULES}}) @@ -162,7 +162,7 @@ func (gui *Gui) handleEditSubmoduleUrl(submodule *models.SubmoduleConfig) error initialContent: submodule.Url, handleConfirm: func(newUrl string) error { return gui.WithWaitingStatus(gui.Tr.LcUpdatingSubmoduleUrlStatus, func() error { - err := gui.GitCommand.WithSpan("Update submodule URL").SubmoduleUpdateUrl(submodule.Name, submodule.Path, newUrl) + err := gui.GitCommand.WithSpan(gui.Tr.Spans.UpdateSubmoduleUrl).SubmoduleUpdateUrl(submodule.Name, submodule.Path, newUrl) gui.handleCredentialsPopup(err) return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{SUBMODULES}}) @@ -173,7 +173,7 @@ func (gui *Gui) handleEditSubmoduleUrl(submodule *models.SubmoduleConfig) error func (gui *Gui) handleSubmoduleInit(submodule *models.SubmoduleConfig) error { return gui.WithWaitingStatus(gui.Tr.LcInitializingSubmoduleStatus, func() error { - err := gui.GitCommand.WithSpan("Initialise submodule").SubmoduleInit(submodule.Path) + err := gui.GitCommand.WithSpan(gui.Tr.Spans.InitialiseSubmodule).SubmoduleInit(submodule.Path) gui.handleCredentialsPopup(err) return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{SUBMODULES}}) @@ -216,7 +216,7 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { displayStrings: []string{gui.Tr.LcBulkInitSubmodules, utils.ColoredString(gui.GitCommand.SubmoduleBulkInitCmdStr(), color.FgGreen)}, onPress: func() error { return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { - if err := gui.OSCommand.WithSpan("Bulk initialise submodules").RunCommand(gui.GitCommand.SubmoduleBulkInitCmdStr()); err != nil { + if err := gui.OSCommand.WithSpan(gui.Tr.Spans.BulkInitialiseSubmodules).RunCommand(gui.GitCommand.SubmoduleBulkInitCmdStr()); err != nil { return gui.surfaceError(err) } @@ -228,7 +228,7 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { displayStrings: []string{gui.Tr.LcBulkUpdateSubmodules, utils.ColoredString(gui.GitCommand.SubmoduleBulkUpdateCmdStr(), color.FgYellow)}, onPress: func() error { return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { - if err := gui.OSCommand.WithSpan("Bulk update submodules").RunCommand(gui.GitCommand.SubmoduleBulkUpdateCmdStr()); err != nil { + if err := gui.OSCommand.WithSpan(gui.Tr.Spans.BulkUpdateSubmodules).RunCommand(gui.GitCommand.SubmoduleBulkUpdateCmdStr()); err != nil { return gui.surfaceError(err) } @@ -240,7 +240,7 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { displayStrings: []string{gui.Tr.LcSubmoduleStashAndReset, utils.ColoredString(fmt.Sprintf("git stash in each submodule && %s", gui.GitCommand.SubmoduleForceBulkUpdateCmdStr()), color.FgRed)}, onPress: func() error { return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { - if err := gui.GitCommand.WithSpan("Bulk stash and reset submodules").ResetSubmodules(gui.State.Submodules); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.BulkStashAndResetSubmodules).ResetSubmodules(gui.State.Submodules); err != nil { return gui.surfaceError(err) } @@ -252,7 +252,7 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { displayStrings: []string{gui.Tr.LcBulkDeinitSubmodules, utils.ColoredString(gui.GitCommand.SubmoduleBulkDeinitCmdStr(), color.FgRed)}, onPress: func() error { return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { - if err := gui.OSCommand.WithSpan("Bulk deinitialise submodules").RunCommand(gui.GitCommand.SubmoduleBulkDeinitCmdStr()); err != nil { + if err := gui.OSCommand.WithSpan(gui.Tr.Spans.BulkDeinitialiseSubmodules).RunCommand(gui.GitCommand.SubmoduleBulkDeinitCmdStr()); err != nil { return gui.surfaceError(err) } @@ -267,7 +267,7 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { func (gui *Gui) handleUpdateSubmodule(submodule *models.SubmoduleConfig) error { return gui.WithWaitingStatus(gui.Tr.LcUpdatingSubmoduleStatus, func() error { - err := gui.GitCommand.WithSpan("Update submodule").SubmoduleUpdate(submodule.Path) + err := gui.GitCommand.WithSpan(gui.Tr.Spans.UpdateSubmodule).SubmoduleUpdate(submodule.Path) gui.handleCredentialsPopup(err) return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{SUBMODULES}}) diff --git a/pkg/gui/tags_panel.go b/pkg/gui/tags_panel.go index 670ca0bee..500b41af1 100644 --- a/pkg/gui/tags_panel.go +++ b/pkg/gui/tags_panel.go @@ -19,7 +19,7 @@ func (gui *Gui) handleCreateTag() error { title: gui.Tr.CreateTagTitle, handleConfirm: func(tagName string) error { // leaving commit SHA blank so that we're just creating the tag for the current commit - if err := gui.GitCommand.WithSpan("Create lightweight tag").CreateLightweightTag(tagName, ""); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.CreateLightweightTag).CreateLightweightTag(tagName, ""); err != nil { return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{COMMITS, TAGS}, then: func() { @@ -86,7 +86,7 @@ func (gui *Gui) withSelectedTag(f func(tag *models.Tag) error) func() error { } func (gui *Gui) handleCheckoutTag(tag *models.Tag) error { - if err := gui.handleCheckoutRef(tag.Name, handleCheckoutRefOptions{span: "Checkout tag"}); err != nil { + if err := gui.handleCheckoutRef(tag.Name, handleCheckoutRefOptions{span: gui.Tr.Spans.CheckoutTag}); err != nil { return err } return gui.pushContext(gui.State.Contexts.Branches) @@ -104,7 +104,7 @@ func (gui *Gui) handleDeleteTag(tag *models.Tag) error { title: gui.Tr.DeleteTagTitle, prompt: prompt, handleConfirm: func() error { - if err := gui.GitCommand.WithSpan("Delete tag").DeleteTag(tag.Name); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DeleteTag).DeleteTag(tag.Name); err != nil { return gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{COMMITS, TAGS}}) @@ -125,7 +125,7 @@ func (gui *Gui) handlePushTag(tag *models.Tag) error { initialContent: "origin", handleConfirm: func(response string) error { return gui.WithWaitingStatus(gui.Tr.PushingTagStatus, func() error { - err := gui.GitCommand.WithSpan("Push tag").PushTag(response, tag.Name, gui.promptUserForCredential) + err := gui.GitCommand.WithSpan(gui.Tr.Spans.PushTag).PushTag(response, tag.Name, gui.promptUserForCredential) gui.handleCredentialsPopup(err) return nil diff --git a/pkg/gui/undoing.go b/pkg/gui/undoing.go index d39372f89..bd67408d4 100644 --- a/pkg/gui/undoing.go +++ b/pkg/gui/undoing.go @@ -93,7 +93,7 @@ func (gui *Gui) reflogUndo() error { return gui.createErrorPanel(gui.Tr.LcCantUndoWhileRebasing) } - span := "Undo" + span := gui.Tr.Spans.Undo return gui.parseReflogForActions(func(counter int, action reflogAction) (bool, error) { if counter != 0 { @@ -128,7 +128,7 @@ func (gui *Gui) reflogRedo() error { return gui.createErrorPanel(gui.Tr.LcCantRedoWhileRebasing) } - span := "Redo" + span := gui.Tr.Spans.Redo return gui.parseReflogForActions(func(counter int, action reflogAction) (bool, error) { // if we're redoing and the counter is zero, we just return diff --git a/pkg/gui/workspace_reset_options_panel.go b/pkg/gui/workspace_reset_options_panel.go index 701aecf08..872cc4508 100644 --- a/pkg/gui/workspace_reset_options_panel.go +++ b/pkg/gui/workspace_reset_options_panel.go @@ -21,7 +21,7 @@ func (gui *Gui) handleCreateResetMenu() error { red.Sprint(nukeStr), }, onPress: func() error { - if err := gui.GitCommand.WithSpan("Nuke working tree").ResetAndClean(); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.NukeWorkingTree).ResetAndClean(); err != nil { return gui.surfaceError(err) } @@ -34,7 +34,7 @@ func (gui *Gui) handleCreateResetMenu() error { red.Sprint("git checkout -- ."), }, onPress: func() error { - if err := gui.GitCommand.WithSpan("Discard unstaged file changes").DiscardAnyUnstagedFileChanges(); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.DiscardUnstagedFileChanges).DiscardAnyUnstagedFileChanges(); err != nil { return gui.surfaceError(err) } @@ -47,7 +47,7 @@ func (gui *Gui) handleCreateResetMenu() error { red.Sprint("git clean -fd"), }, onPress: func() error { - if err := gui.GitCommand.WithSpan("Remove untracked files").RemoveUntrackedFiles(); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.RemoveUntrackedFiles).RemoveUntrackedFiles(); err != nil { return gui.surfaceError(err) } @@ -60,7 +60,7 @@ func (gui *Gui) handleCreateResetMenu() error { red.Sprint("git reset --soft HEAD"), }, onPress: func() error { - if err := gui.GitCommand.WithSpan("Soft reset").ResetSoft("HEAD"); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.SoftReset).ResetSoft("HEAD"); err != nil { return gui.surfaceError(err) } @@ -73,7 +73,7 @@ func (gui *Gui) handleCreateResetMenu() error { red.Sprint("git reset --mixed HEAD"), }, onPress: func() error { - if err := gui.GitCommand.WithSpan("Mixed reset").ResetMixed("HEAD"); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.MixedReset).ResetMixed("HEAD"); err != nil { return gui.surfaceError(err) } @@ -86,7 +86,7 @@ func (gui *Gui) handleCreateResetMenu() error { red.Sprint("git reset --hard HEAD"), }, onPress: func() error { - if err := gui.GitCommand.WithSpan("Hard reset").ResetHard("HEAD"); err != nil { + if err := gui.GitCommand.WithSpan(gui.Tr.Spans.HardReset).ResetHard("HEAD"); err != nil { return gui.surfaceError(err) } -- cgit v1.2.3