1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-20 05:19:24 +02:00

Fix the title and text (and variable names) of the Discard Changes prompt

The title was saying "Unstage lines", which was just wrong. The text said
"Delete lines", which can be seen as a bit misleading; we are only discarding
the changes to the selected lines, not deleting the lines themselves.

For consistency, rename the config variable skipUnstageLineWarning accordingly.
This commit is contained in:
Stefan Haller 2023-04-17 17:32:10 +02:00
parent 6ecd691223
commit 51a558040d
10 changed files with 32 additions and 32 deletions

View File

@ -53,7 +53,7 @@ gui:
commitLength:
show: true
mouseEvents: true
skipUnstageLineWarning: false
skipDiscardChangeWarning: false
skipStashWarning: false
showFileTree: true # for rendering changes files in a tree format
showListFooter: true # for seeing the '5 of 20' message in list panels

View File

@ -32,7 +32,7 @@ type GuiConfig struct {
ScrollHeight int `yaml:"scrollHeight"`
ScrollPastBottom bool `yaml:"scrollPastBottom"`
MouseEvents bool `yaml:"mouseEvents"`
SkipUnstageLineWarning bool `yaml:"skipUnstageLineWarning"`
SkipDiscardChangeWarning bool `yaml:"skipDiscardChangeWarning"`
SkipStashWarning bool `yaml:"skipStashWarning"`
SidePanelWidth float64 `yaml:"sidePanelWidth"`
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
@ -397,17 +397,17 @@ type CustomCommandMenuOption struct {
func GetDefaultConfig() *UserConfig {
return &UserConfig{
Gui: GuiConfig{
ScrollHeight: 2,
ScrollPastBottom: true,
MouseEvents: true,
SkipUnstageLineWarning: false,
SkipStashWarning: false,
SidePanelWidth: 0.3333,
ExpandFocusedSidePanel: false,
MainPanelSplitMode: "flexible",
Language: "auto",
TimeFormat: "02 Jan 06",
ShortTimeFormat: time.Kitchen,
ScrollHeight: 2,
ScrollPastBottom: true,
MouseEvents: true,
SkipDiscardChangeWarning: false,
SkipStashWarning: false,
SidePanelWidth: 0.3333,
ExpandFocusedSidePanel: false,
MainPanelSplitMode: "flexible",
Language: "auto",
TimeFormat: "02 Jan 06",
ShortTimeFormat: time.Kitchen,
Theme: ThemeConfig{
ActiveBorderColor: []string{"green", "bold"},
InactiveBorderColor: []string{"default"},

View File

@ -169,10 +169,10 @@ func (self *StagingController) ToggleStaged() error {
func (self *StagingController) ResetSelection() error {
reset := func() error { return self.applySelectionAndRefresh(true) }
if !self.staged && !self.c.UserConfig.Gui.SkipUnstageLineWarning {
if !self.staged && !self.c.UserConfig.Gui.SkipDiscardChangeWarning {
return self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.UnstageLinesTitle,
Prompt: self.c.Tr.UnstageLinesPrompt,
Title: self.c.Tr.DiscardChangeTitle,
Prompt: self.c.Tr.DiscardChangePrompt,
HandleConfirm: reset,
})
}

View File

@ -378,8 +378,8 @@ func chineseTranslationSet() TranslationSet {
NoFilesStagedPrompt: "您尚未暂存任何文件。提交所有文件?",
BranchNotFoundTitle: "找不到分支",
BranchNotFoundPrompt: "找不到分支。创建一个新分支命名为:",
UnstageLinesTitle: "取消暂存选中的行",
UnstageLinesPrompt: "您确定要删除所选的行(git reset)吗?这是不可逆的。\n要禁用此对话框,请将 'gui.skipUnstageLineWarning' 的配置键设置为 true",
DiscardChangeTitle: "取消暂存选中的行",
DiscardChangePrompt: "您确定要删除所选的行(git reset)吗?这是不可逆的。\n要禁用此对话框,请将 'gui.skipDiscardChangeWarning' 的配置键设置为 true",
CreateNewBranchFromCommit: "从提交创建新分支",
BuildingPatch: "正在构建补丁",
ViewCommits: "查看提交",

View File

@ -428,8 +428,8 @@ type TranslationSet struct {
BranchNotFoundTitle string
BranchNotFoundPrompt string
BranchUnknown string
UnstageLinesTitle string
UnstageLinesPrompt string
DiscardChangeTitle string
DiscardChangePrompt string
CreateNewBranchFromCommit string
BuildingPatch string
ViewCommits string
@ -1119,8 +1119,8 @@ func EnglishTranslationSet() TranslationSet {
BranchNotFoundTitle: "Branch not found",
BranchNotFoundPrompt: "Branch not found. Create a new branch named",
BranchUnknown: "Branch unknown",
UnstageLinesTitle: "Unstage lines",
UnstageLinesPrompt: "Are you sure you want to delete the selected lines (git reset)? It is irreversible.\nTo disable this dialogue set the config key of 'gui.skipUnstageLineWarning' to true",
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",
CreateNewBranchFromCommit: "Create new branch off of commit",
BuildingPatch: "Building patch",
ViewCommits: "View commits",

View File

@ -394,8 +394,8 @@ func japaneseTranslationSet() TranslationSet {
NoFilesStagedPrompt: "ファイルがステージされていません。すべての変更をコミットしますか?",
BranchNotFoundTitle: "ブランチが見つかりませんでした。",
BranchNotFoundPrompt: "ブランチが見つかりませんでした。新しくブランチを作成します ",
UnstageLinesTitle: "選択行をアンステージ",
UnstageLinesPrompt: "選択された行を削除 (git reset) します。よろしいですか? この操作は取り消せません。\nこの警告を無効化するには設定ファイルの 'gui.skipUnstageLineWarning' を true に設定してください。",
DiscardChangeTitle: "選択行をアンステージ",
DiscardChangePrompt: "選択された行を削除 (git reset) します。よろしいですか? この操作は取り消せません。\nこの警告を無効化するには設定ファイルの 'gui.skipDiscardChangeWarning' を true に設定してください。",
CreateNewBranchFromCommit: "コミットにブランチを作成",
BuildingPatch: "パッチを構築",
ViewCommits: "コミットを閲覧",

View File

@ -389,8 +389,8 @@ func koreanTranslationSet() TranslationSet {
NoFilesStagedPrompt: "파일이 Staged 되지 않았습니다. 모든 파일을 커밋하시겠습니까?",
BranchNotFoundTitle: "브랜치를 찾을 수 없습니다.",
BranchNotFoundPrompt: "브랜치를 찾을 수 없습니다. 새로운 브랜치를 생성합니다.",
UnstageLinesTitle: "선택한 라인을 unstaged",
UnstageLinesPrompt: "정말로 선택한 라인을 삭제 (git reset) 하시겠습니까? 이 조작은 취소할 수 없습니다.\n이 경고를 비활성화 하려면 설정 파일의 'gui.skipUnstageLineWarning' 를 true로 설정하세요.",
DiscardChangeTitle: "선택한 라인을 unstaged",
DiscardChangePrompt: "정말로 선택한 라인을 삭제 (git reset) 하시겠습니까? 이 조작은 취소할 수 없습니다.\n이 경고를 비활성화 하려면 설정 파일의 'gui.skipDiscardChangeWarning' 를 true로 설정하세요.",
CreateNewBranchFromCommit: "커밋에서 새 브랜치를 만듭니다.",
BuildingPatch: "Building patch",
ViewCommits: "커밋 보기",

View File

@ -481,8 +481,8 @@ func traditionalChineseTranslationSet() TranslationSet {
BranchNotFoundTitle: "找不到分支",
BranchNotFoundPrompt: "找不到分支。是否創建一個名為",
BranchUnknown: "分支未知",
UnstageLinesTitle: "取消預存行",
UnstageLinesPrompt: "你確定要刪除所選行嗎(git reset)?此操作是不可逆的。\n要禁用此對話框,請將“gui.skipUnstageLineWarning”設置為true。",
DiscardChangeTitle: "取消預存行",
DiscardChangePrompt: "你確定要刪除所選行嗎(git reset)?此操作是不可逆的。\n要禁用此對話框,請將“gui.skipDiscardChangeWarning”設置為true。",
CreateNewBranchFromCommit: "從提交建立新分支",
BuildingPatch: "正在建立補丁",
ViewCommits: "檢視提交",

View File

@ -34,8 +34,8 @@ func (self *Common) ContinueOnConflictsResolved() {
func (self *Common) ConfirmDiscardLines() {
self.t.ExpectPopup().Confirmation().
Title(Equals("Unstage lines")).
Content(Contains("Are you sure you want to delete the selected lines")).
Title(Equals("Discard change")).
Content(Contains("Are you sure you want to discard this change")).
Confirm()
}

View File

@ -92,8 +92,8 @@ var StageLines = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectPopup().Confirmation().
Title(Equals("Unstage lines")).
Content(Contains("Are you sure you want to delete the selected lines")).
Title(Equals("Discard change")).
Content(Contains("Are you sure you want to discard this change")).
Confirm()
}).
IsEmpty()