1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00

Add tooltips for reset menu items

This commit is contained in:
Stefan Haller
2024-02-16 15:43:43 +01:00
parent dfabe8db70
commit 9362aede8f
2 changed files with 12 additions and 4 deletions

View File

@@ -166,12 +166,13 @@ func (self *RefsHelper) CreateGitResetMenu(ref string) error {
strength string strength string
label string label string
key types.Key key types.Key
tooltip string
} }
strengths := []strengthWithKey{ strengths := []strengthWithKey{
// not i18'ing because it's git terminology // not i18'ing because it's git terminology
{strength: "mixed", label: "Mixed reset", key: 'm'}, {strength: "mixed", label: "Mixed reset", key: 'm', tooltip: self.c.Tr.ResetMixedTooltip},
{strength: "soft", label: "Soft reset", key: 's'}, {strength: "soft", label: "Soft reset", key: 's', tooltip: self.c.Tr.ResetSoftTooltip},
{strength: "hard", label: "Hard reset", key: 'h'}, {strength: "hard", label: "Hard reset", key: 'h', tooltip: self.c.Tr.ResetHardTooltip},
} }
menuItems := lo.Map(strengths, func(row strengthWithKey, _ int) *types.MenuItem { menuItems := lo.Map(strengths, func(row strengthWithKey, _ int) *types.MenuItem {
@@ -185,6 +186,7 @@ func (self *RefsHelper) CreateGitResetMenu(ref string) error {
return self.ResetToRef(ref, row.strength, []string{}) return self.ResetToRef(ref, row.strength, []string{})
}, },
Key: row.key, Key: row.key,
Tooltip: row.tooltip,
} }
}) })

View File

@@ -398,6 +398,9 @@ type TranslationSet struct {
CommitChangesWithoutHook string CommitChangesWithoutHook string
SkipHookPrefixNotConfigured string SkipHookPrefixNotConfigured string
ResetTo string ResetTo string
ResetSoftTooltip string
ResetMixedTooltip string
ResetHardTooltip string
PressEnterToReturn string PressEnterToReturn string
ViewStashOptions string ViewStashOptions string
ViewStashOptionsTooltip string ViewStashOptionsTooltip string
@@ -1320,6 +1323,9 @@ func EnglishTranslationSet() TranslationSet {
Delete: "Delete", Delete: "Delete",
Reset: "Reset", Reset: "Reset",
ResetTooltip: "View reset options (soft/mixed/hard) for resetting onto selected item.", ResetTooltip: "View reset options (soft/mixed/hard) for resetting onto selected item.",
ResetSoftTooltip: "Reset HEAD to the chosen commit, and keep the changes between the current and chosen commit as staged changes.",
ResetMixedTooltip: "Reset HEAD to the chosen commit, and keep the changes between the current and chosen commit as unstaged changes.",
ResetHardTooltip: "Reset HEAD to the chosen commit, and discard all changes between the current and chosen commit, as well as all current modifications in the working tree.",
ViewResetOptions: `Reset`, ViewResetOptions: `Reset`,
FileResetOptionsTooltip: "View reset options for working tree (e.g. nuking the working tree).", FileResetOptionsTooltip: "View reset options for working tree (e.g. nuking the working tree).",
FixupTooltip: "Meld the selected commit into the commit below it. Similar to fixup, but the selected commit's message will be discarded.", FixupTooltip: "Meld the selected commit into the commit below it. Similar to fixup, but the selected commit's message will be discarded.",