Remove target branch from title of rebase menu

Put it into the individual menu items instead.

Again, this is necessary because we are going to add another entry to the menu
that is independent of the selected branch.
This commit is contained in:
Stefan Haller 2024-05-04 16:12:40 +02:00 committed by Jesse Duffield
parent f2e8e3fcc1
commit b3252ee7c8
14 changed files with 29 additions and 26 deletions

View file

@ -241,7 +241,9 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
} }
menuItems := []*types.MenuItem{ menuItems := []*types.MenuItem{
{ {
Label: self.c.Tr.SimpleRebase, Label: utils.ResolvePlaceholderString(self.c.Tr.SimpleRebase,
map[string]string{"ref": ref},
),
Key: 's', Key: 's',
DisabledReason: disabledReason, DisabledReason: disabledReason,
OnPress: func() error { OnPress: func() error {
@ -263,7 +265,9 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
}, },
}, },
{ {
Label: self.c.Tr.InteractiveRebase, Label: utils.ResolvePlaceholderString(self.c.Tr.InteractiveRebase,
map[string]string{"ref": ref},
),
Key: 'i', Key: 'i',
DisabledReason: disabledReason, DisabledReason: disabledReason,
Tooltip: self.c.Tr.InteractiveRebaseTooltip, Tooltip: self.c.Tr.InteractiveRebaseTooltip,
@ -293,7 +297,6 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error {
self.c.Tr.RebasingTitle), self.c.Tr.RebasingTitle),
map[string]string{ map[string]string{
"checkedOutBranch": checkedOutBranch, "checkedOutBranch": checkedOutBranch,
"ref": ref,
}, },
) )

View file

@ -1254,10 +1254,10 @@ func EnglishTranslationSet() TranslationSet {
KeybindingsMenuSectionLocal: "Local", KeybindingsMenuSectionLocal: "Local",
KeybindingsMenuSectionGlobal: "Global", KeybindingsMenuSectionGlobal: "Global",
KeybindingsMenuSectionNavigation: "Navigation", KeybindingsMenuSectionNavigation: "Navigation",
RebasingTitle: "Rebase '{{.checkedOutBranch}}' onto '{{.ref}}'", RebasingTitle: "Rebase '{{.checkedOutBranch}}'",
RebasingFromBaseCommitTitle: "Rebase '{{.checkedOutBranch}}' from marked base onto '{{.ref}}'", RebasingFromBaseCommitTitle: "Rebase '{{.checkedOutBranch}}' from marked base",
SimpleRebase: "Simple rebase", SimpleRebase: "Simple rebase onto '{{.ref}}'",
InteractiveRebase: "Interactive rebase", InteractiveRebase: "Interactive rebase onto '{{.ref}}'",
InteractiveRebaseTooltip: "Begin an interactive rebase with a break at the start, so you can update the TODO commits before continuing.", InteractiveRebaseTooltip: "Begin an interactive rebase with a break at the start, so you can update the TODO commits before continuing.",
MustSelectTodoCommits: "When rebasing, this action only works on a selection of TODO commits.", MustSelectTodoCommits: "When rebasing, this action only works on a selection of TODO commits.",
ConfirmMerge: "Are you sure you want to merge '{{.selectedBranch}}' into '{{.checkedOutBranch}}'?", ConfirmMerge: "Are you sure you want to merge '{{.selectedBranch}}' into '{{.checkedOutBranch}}'?",

View file

@ -274,10 +274,10 @@ func polishTranslationSet() TranslationSet {
KeybindingsMenuSectionLocal: "Lokalne", KeybindingsMenuSectionLocal: "Lokalne",
KeybindingsMenuSectionGlobal: "Globalne", KeybindingsMenuSectionGlobal: "Globalne",
KeybindingsMenuSectionNavigation: "Nawigacja", KeybindingsMenuSectionNavigation: "Nawigacja",
RebasingTitle: "Rebase '{{.checkedOutBranch}}' na '{{.ref}}'", RebasingTitle: "Rebase '{{.checkedOutBranch}}'",
RebasingFromBaseCommitTitle: "Rebase '{{.checkedOutBranch}}' od oznaczonego commita bazowego na '{{.ref}}'", RebasingFromBaseCommitTitle: "Rebase '{{.checkedOutBranch}}' od oznaczonego commita bazowego",
SimpleRebase: "Prosty rebase", SimpleRebase: "Prosty rebase na '{{.ref}}'",
InteractiveRebase: "Interaktywny rebase", InteractiveRebase: "Interaktywny rebase na '{{.ref}}'",
InteractiveRebaseTooltip: "Rozpocznij interaktywny rebase z przerwaniem na początku, abyś mógł zaktualizować commity TODO przed kontynuacją.", InteractiveRebaseTooltip: "Rozpocznij interaktywny rebase z przerwaniem na początku, abyś mógł zaktualizować commity TODO przed kontynuacją.",
MustSelectTodoCommits: "Podczas rebase ta akcja działa tylko na zaznaczonych commitach TODO.", MustSelectTodoCommits: "Podczas rebase ta akcja działa tylko na zaznaczonych commitach TODO.",
ConfirmMerge: "Czy na pewno chcesz scalić '{{.selectedBranch}}' z '{{.checkedOutBranch}}'?", ConfirmMerge: "Czy na pewno chcesz scalić '{{.selectedBranch}}' z '{{.checkedOutBranch}}'?",

View file

@ -225,9 +225,9 @@ func RussianTranslationSet() TranslationSet {
ConflictsResolved: "Все конфликты слияния разрешены. Продолжить?", ConflictsResolved: "Все конфликты слияния разрешены. Продолжить?",
Continue: "Продолжить", Continue: "Продолжить",
Keybindings: "Связки клавиш", Keybindings: "Связки клавиш",
RebasingTitle: "Перебазировать '{{.checkedOutBranch}}' на '{{.ref}}'", RebasingTitle: "Перебазировать '{{.checkedOutBranch}}'",
SimpleRebase: "Простая перебазировка", SimpleRebase: "Простая перебазировка на '{{.ref}}'",
InteractiveRebase: "Интерактивная перебазировка", InteractiveRebase: "Интерактивная перебазировка на '{{.ref}}'",
InteractiveRebaseTooltip: "Начать интерактивную перебазировку с перерыва в начале, чтобы можно было обновить TODO коммиты, прежде чем продолжить.", InteractiveRebaseTooltip: "Начать интерактивную перебазировку с перерыва в начале, чтобы можно было обновить TODO коммиты, прежде чем продолжить.",
ConfirmMerge: "Вы уверены, что хотите to merge '{{.selectedBranch}}' into '{{.checkedOutBranch}}'?", ConfirmMerge: "Вы уверены, что хотите to merge '{{.selectedBranch}}' into '{{.checkedOutBranch}}'?",
FwdNoUpstream: "Невозможно перемотать ветку без upstream-ветки", FwdNoUpstream: "Невозможно перемотать ветку без upstream-ветки",

View file

@ -255,9 +255,9 @@ func traditionalChineseTranslationSet() TranslationSet {
ConflictsResolved: "所有合併衝突都已解決。是否繼續?", ConflictsResolved: "所有合併衝突都已解決。是否繼續?",
Continue: "確認", Continue: "確認",
Keybindings: "鍵盤快捷鍵", Keybindings: "鍵盤快捷鍵",
RebasingTitle: "將 '{{.checkedOutBranch}}' 變基至 '{{.ref}}'", RebasingTitle: "將 '{{.checkedOutBranch}}'",
SimpleRebase: "簡單變基", SimpleRebase: "簡單變基 變基至 '{{.ref}}'",
InteractiveRebase: "互動變基", InteractiveRebase: "互動變基 變基至 '{{.ref}}'",
InteractiveRebaseTooltip: "開始一個互動變基以中斷開始這樣你可以在繼續之前更新TODO提交", InteractiveRebaseTooltip: "開始一個互動變基以中斷開始這樣你可以在繼續之前更新TODO提交",
ConfirmMerge: "是否將 '{{.selectedBranch}}' 合併至 '{{.checkedOutBranch}}' ", ConfirmMerge: "是否將 '{{.selectedBranch}}' 合併至 '{{.checkedOutBranch}}' ",
FwdNoUpstream: "無法快進無上游分支", FwdNoUpstream: "無法快進無上游分支",

View file

@ -31,7 +31,7 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")). Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()

View file

@ -31,7 +31,7 @@ var RebaseAbortOnConflict = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")). Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()

View file

@ -37,7 +37,7 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")). Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()

View file

@ -31,7 +31,7 @@ var RebaseCancelOnConflict = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")). Title(Equals("Rebase 'first-change-branch'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()

View file

@ -42,7 +42,7 @@ var RebaseCopiedBranch = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch). Press(keys.Branches.RebaseBranch).
Tap(func() { Tap(func() {
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'branch2' onto 'master'")). Title(Equals("Rebase 'branch2'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()
}) })

View file

@ -40,7 +40,7 @@ var RebaseDoesNotAutosquash = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'my-branch' onto 'master'")). Title(Equals("Rebase 'my-branch'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()

View file

@ -61,7 +61,7 @@ var RebaseFromMarkedBase = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'active-branch' from marked base onto 'target-branch'")). Title(Equals("Rebase 'active-branch' from marked base")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()

View file

@ -67,7 +67,7 @@ var RebaseToUpstream = NewIntegrationTest(NewIntegrationTestArgs{
Select(Contains("Rebase checked-out branch onto origin/master...")). Select(Contains("Rebase checked-out branch onto origin/master...")).
Confirm() Confirm()
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals("Rebase 'target' onto 'origin/master'")). Title(Equals("Rebase 'target'")).
Select(Contains("Simple rebase")). Select(Contains("Simple rebase")).
Confirm() Confirm()
}) })

View file

@ -39,7 +39,7 @@ var AdvancedInteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Branches.RebaseBranch) Press(keys.Branches.RebaseBranch)
t.ExpectPopup().Menu(). t.ExpectPopup().Menu().
Title(Equals(fmt.Sprintf("Rebase '%s' onto '%s'", TOP_BRANCH, BASE_BRANCH))). Title(Equals(fmt.Sprintf("Rebase '%s'", TOP_BRANCH))).
Select(Contains("Interactive rebase")). Select(Contains("Interactive rebase")).
Confirm() Confirm()
t.Views().Commits(). t.Views().Commits().