diff --git a/pkg/gui/presentation/worktrees.go b/pkg/gui/presentation/worktrees.go index b2d99cb95..d0a506690 100644 --- a/pkg/gui/presentation/worktrees.go +++ b/pkg/gui/presentation/worktrees.go @@ -49,7 +49,8 @@ func GetWorktreeDisplayString(tr *i18n.TranslationSet, worktree *models.Worktree if worktree.Branch != "" { branch = style.FgCyan.Sprint(worktree.Branch) } else if worktree.Head != "" { - branch = style.FgYellow.Sprint("HEAD detached at " + utils.ShortHash(worktree.Head)) + branch = style.FgYellow.Sprint(utils.ResolvePlaceholderString( + tr.HeadDetachedAt, map[string]string{"hash": utils.ShortHash(worktree.Head)})) } res = append(res, branch+mainWorktreeLabel(tr, worktree)) return res diff --git a/pkg/gui/presentation/worktrees_test.go b/pkg/gui/presentation/worktrees_test.go index 73abe100d..a7b1ab4a5 100644 --- a/pkg/gui/presentation/worktrees_test.go +++ b/pkg/gui/presentation/worktrees_test.go @@ -14,6 +14,7 @@ func Test_GetWorktreeDisplayString(t *testing.T) { tr := &i18n.TranslationSet{ MainWorktree: "(main worktree)", MissingWorktree: "(missing)", + HeadDetachedAt: "HEAD detached at {{.hash}}", } scenarios := []struct { diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 0f33d9bc0..7a39cd716 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -718,6 +718,7 @@ type TranslationSet struct { BranchNotFoundTitle string BranchNotFoundPrompt string BranchUnknown string + HeadDetachedAt string DiscardChangeTitle string DiscardChangePrompt string DiscardLinesFromCommitTitle string @@ -1884,6 +1885,7 @@ func EnglishTranslationSet() *TranslationSet { BranchNotFoundTitle: "Branch not found", BranchNotFoundPrompt: "Branch not found. Create a new branch named", BranchUnknown: "Branch unknown", + HeadDetachedAt: "HEAD detached at {{.hash}}", DiscardChangeTitle: "Discard change", DiscardChangePrompt: "Are you sure you want to discard this change (git reset)? It is irreversible.\nTo disable this dialogue set the config key of 'gui.skipDiscardChangeWarning' to true", DiscardLinesFromCommitTitle: "Discard lines from commit",