diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index 304111d5d..302f5a82f 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -1,3 +1,5 @@ +# This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/generate_cheatsheet.go` from the project root. + # Lazygit Keybindings ## Global Keybindings @@ -21,6 +23,8 @@ W: open diff menu ctrl+e: open diff menu @: open command log menu + }: Increase the size of the context shown around changes in the diff view + {: Decrease the size of the context shown around changes in the diff view ## List Panel Navigation @@ -119,6 +123,7 @@ ## Commits Panel (Commits)
+ ctrl+l: open log menu s: squash down r: reword commit R: reword commit with editor @@ -143,6 +148,7 @@ T: tag commit ctrl+r: reset cherry-picked (copied) commits selection ctrl+y: copy commit message to clipboard + o: open commit in browser## Commits Panel (Reflog Tab) @@ -163,6 +169,12 @@ @: open command log menu +## Files Panel + +
+ ctrl+b: Filter commit files ++ ## Files Panel (Files)
@@ -205,6 +217,8 @@ ## Main Panel (Merging)## Lijstpaneel Navigatie @@ -119,6 +123,7 @@ ## Commits Paneel (Commits)+ H: scroll left + L: scroll right esc: return to files panel M: open external merge tool (git mergetool) space: pick hunk @@ -232,10 +246,13 @@ ▼: select next line ◄: select previous hunk ►: select next hunk + ctrl+o: copy the selected text to the clipboard space: add/remove line(s) to patch v: toggle drag select V: toggle drag select a: toggle select hunk + H: scroll left + L: scroll right## Main Panel (Staging) @@ -250,11 +267,14 @@ ▼: select next line ◄: select previous hunk ►: select next hunk + ctrl+o: copy the selected text to the clipboard e: edit file o: open file v: toggle drag select V: toggle drag select a: toggle select hunk + H: scroll left + L: scroll right c: commit changes w: commit changes without pre-commit hook C: commit changes using git editor diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index 56158c6fb..4dcc1c586 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -1,3 +1,5 @@ +# This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/generate_cheatsheet.go` from the project root. + # Lazygit Sneltoetsen ## Globale Sneltoetsen @@ -21,6 +23,8 @@ W: open diff menu ctrl+e: open diff menu @: open command log menu + }: Increase the size of the context shown around changes in the diff view + {: Decrease the size of the context shown around changes in the diff view
+ ctrl+l: open log menu s: squash beneden r: hernoem commit R: hernoem commit met editor @@ -143,6 +148,7 @@ T: tag commit ctrl+r: reset cherry-picked (gekopieerde) commits selectie ctrl+y: kopieer commit bericht naar klembord + o: open commit in browser## Commits Paneel (Reflog Tabblad) @@ -163,6 +169,12 @@ @: open command log menu +## Bestanden Paneel + +
+ ctrl+b: Commit dossiers filteren ++ ## Bestanden Paneel (Bestanden)
@@ -205,6 +217,8 @@ ## Hoofd Paneel (Mergen)## List Panel Navigation @@ -39,18 +43,18 @@+ H: scroll left + L: scroll right esc: ga terug naar het bestanden paneel M: open external merge tool (git mergetool) space: kies hunk @@ -232,10 +246,13 @@ ▼: selecteer de volgende lijn ◄: selecteer de vorige hunk ►: selecteer de volgende hunk + ctrl+o: copy the selected text to the clipboard space: voeg toe/verwijder lijn(en) in patch v: toggle drag selecteer V: toggle drag selecteer a: toggle selecteer hunk + H: scroll left + L: scroll right## Hoofd Paneel (Staging) @@ -250,11 +267,14 @@ ▼: selecteer de volgende lijn ◄: selecteer de vorige hunk ►: selecteer de volgende hunk + ctrl+o: copy the selected text to the clipboard e: verander bestand o: open bestand v: toggle drag selecteer V: toggle drag selecteer a: toggle selecteer hunk + H: scroll left + L: scroll right c: Commit veranderingen w: commit veranderingen zonder pre-commit hook C: commit veranderingen met de git editor diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md index 21f9ec093..6191d1516 100644 --- a/docs/keybindings/Keybindings_pl.md +++ b/docs/keybindings/Keybindings_pl.md @@ -1,3 +1,5 @@ +# This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/generate_cheatsheet.go` from the project root. + # Lazygit Keybindings ## Globalne @@ -6,7 +8,7 @@ ctrl+r: switch to a recent repo () pgup: scroll up main panel (fn+up) pgdown: scroll down main panel (fn+down) - m: view merge/rebase options + m: widok scalenia/opcje zmiany bazy ctrl+p: view custom patch options P: push p: pull @@ -16,11 +18,13 @@ ctrl+z: redo (via reflog) (experimental) +: next screen mode (normal/half/fullscreen) _: prev screen mode - :: execute custom command + :: wykonaj własną komendę ctrl+s: view filter-by-path options W: open diff menu ctrl+e: open diff menu @: open command log menu + }: Increase the size of the context shown around changes in the diff view + {: Decrease the size of the context shown around changes in the diff view
space: przełącz - o: utwórz żądanie wyciągnięcia + o: utwórz żądanie pobrania O: utwórz opcje żądania ściągnięcia - ctrl+y: skopiuj adres URL żądania ściągnięcia do schowka + ctrl+y: skopiuj adres URL żądania pobrania do schowka c: przełącz używając nazwy F: wymuś przełączenie n: nowa gałąź d: usuń gałąź - r: rebase branch + r: zmiana bazy gałęzi M: scal do obecnej gałęzi i: show git-flow options f: fast-forward this branch from its upstream - g: view reset options + g: wyświetl opcje resetu R: rename branch ctrl+o: copy branch name to clipboard enter: view commits @@ -59,14 +63,14 @@ ## Gałęzie Panel (Remote Branches (in Remotes tab))-## Commit files Panel +## Pliki commita Panel- esc: return to remotes list - g: view reset options + esc: wróć do listy repozytoriów zdalnych + g: wyświetl opcje resetu enter: view commits space: przełącz n: nowa gałąź M: scal do obecnej gałęzi d: usuń gałąź - r: rebase branch + r: zmiana bazy gałęzi u: set as upstream of checked-out branch@@ -82,12 +86,12 @@ ## Gałęzie Panel (Sub-commits)- enter: view commit's files + enter: przeglądaj pliki commita space: checkout commit - g: view reset options + g: wyświetl opcje resetu n: nowa gałąź - c: copy commit (cherry-pick) - C: copy commit range (cherry-pick) + c: kopiuj commit (przebieranie) + C: kopiuj zakres commitów (przebieranie) ctrl+r: reset cherry-picked (copied) commits selection ctrl+o: copy commit SHA to clipboard@@ -99,16 +103,16 @@ d: delete tag P: push tag n: create tag - g: view reset options + g: wyświetl opcje resetu enter: view commits
ctrl+o: copy the committed file name to the clipboard - c: checkout file - d: discard this commit's changes to this file + c: plik wybierania + d: porzuć zmiany commita dla tego pliku o: otwórz plik e: edytuj plik space: toggle file included in patch @@ -119,40 +123,42 @@ ## Commity Panel (Commity)+## Pliki Panel + +- s: ściśnij w dół - r: przemianuj commit - R: przemianuj commit w edytorze + ctrl+l: open log menu + s: ściśnij + r: zmień nazwę commita + R: zmień nazwę commita w edytorze g: zresetuj do tego commita f: napraw commit - F: create fixup commit for this commit - S: squash all 'fixup!' commits above selected commits (autosquash) - d: delete commit - ctrl+j: move commit down one - ctrl+k: move commit up one - e: edit commit - A: amend commit with staged changes - p: pick commit (when mid-rebase) - t: revert commit - c: copy commit (cherry-pick) + F: utwórz commit naprawczy dla tego commita + S: spłaszcz wszystkie commity naprawcze powyżej zaznaczonych commitów (autosquash) + d: usuń commit + ctrl+j: przenieś commit 1 w dół + ctrl+k: przenieś commit 1 w górę + e: edytuj commit + A: popraw commit zmianami z poczekalni + p: wybierz commit (podczas zmiany bazy) + t: odwróć commit + c: kopiuj commit (przebieranie) ctrl+o: copy commit SHA to clipboard - C: copy commit range (cherry-pick) - v: paste commits (cherry-pick) - enter: view commit's files + C: kopiuj zakres commitów (przebieranie) + v: wklej commity (przebieranie) + enter: przeglądaj pliki commita space: checkout commit n: create new branch off of commit T: tag commit ctrl+r: reset cherry-picked (copied) commits selection ctrl+y: copy commit message to clipboard + o: open commit in browser## Commity Panel (Reflog Tab)- enter: view commit's files + enter: przeglądaj pliki commita space: checkout commit - g: view reset options - c: copy commit (cherry-pick) - C: copy commit range (cherry-pick) + g: wyświetl opcje resetu + c: kopiuj commit (przebieranie) + C: kopiuj zakres commitów (przebieranie) ctrl+r: reset cherry-picked (copied) commits selection ctrl+o: copy commit SHA to clipboard@@ -163,25 +169,31 @@ @: open command log menu
+ ctrl+b: Filtrowanie commitów ++ ## Pliki Panel (Pliki)
- c: commituj zmiany - w: commit changes without pre-commit hook - A: zmień ostatnie zatwierdzenie - C: commituj zmiany używając edytora z gita - space: przełącz zatwierdzenie - d: view 'discard changes' options + c: Zatwierdź zmiany + w: zatwierdź zmiany bez skryptu pre-commit + A: Zmień ostatni commit + C: Zatwierdź zmiany używając edytora + space: przełącz stan poczekalni + d: pokaż opcje porzucania zmian e: edytuj plik o: otwórz plik i: dodaj do .gitignore r: odśwież pliki - s: przechowaj pliki - S: view stash options - a: przełącz wszystkie zatwierdzenia - D: view reset options + s: przechowaj zmiany + S: wyświetl opcje schowka + a: przełącz stan poczekalni wszystkich + D: wyświetl opcje resetu enter: zatwierdź pojedyncze linie - f: fetch + f: pobierz ctrl+o: copy the file name to the clipboard g: view upstream reset options `: toggle file tree view @@ -202,43 +214,48 @@ b: view bulk submodule options-## Main Panel (Merging) +## Główne Panel (Scalanie)
+ H: scroll left + L: scroll right esc: wróć do panelu plików M: open external merge tool (git mergetool) - space: pick hunk - b: pick all hunks - ◄: select previous conflict - ►: select next conflict - ▲: select previous hunk - ▼: select next hunk + space: wybierz kawałek + b: wybierz wszystkie kawałki + ◄: poprzedni konflikt + ►: następny konflikt + ▲: wybierz poprzedni kawałek + ▼: wybierz następny kawałek z: cofnij-## Main Panel (Normal) +## Główne Panel (Zwykłe)
- Ő: scroll down (fn+up) - ő: scroll up (fn+down) + Ő: przewiń w dół (fn+up) + ő: przewiń w górę (fn+down)-## Main Panel (Patch Building) +## Główne Panel (Patch Building)
- esc: exit line-by-line mode + esc: wyście z trybu "linia po linii" o: otwórz plik - ▲: select previous line - ▼: select next line - ◄: select previous hunk - ►: select next hunk + ▲: poprzednia linia + ▼: następna linia + ◄: poprzedni kawałek + ►: następny kawałek + ctrl+o: copy the selected text to the clipboard space: add/remove line(s) to patch v: toggle drag select V: toggle drag select a: toggle select hunk + H: scroll left + L: scroll right-## Main Panel (Zatwierdzanie) +## Główne Panel (Poczekalnia)
esc: wróć do panelu plików @@ -246,18 +263,21 @@ d: delete change (git reset) tab: switch to other panel o: otwórz plik - ▲: select previous line - ▼: select next line - ◄: select previous hunk - ►: select next hunk + ▲: poprzednia linia + ▼: następna linia + ◄: poprzedni kawałek + ►: następny kawałek + ctrl+o: copy the selected text to the clipboard e: edytuj plik o: otwórz plik v: toggle drag select V: toggle drag select a: toggle select hunk - c: commituj zmiany - w: commit changes without pre-commit hook - C: commituj zmiany używając edytora z gita + H: scroll left + L: scroll right + c: Zatwierdź zmiany + w: zatwierdź zmiany bez skryptu pre-commit + C: Zatwierdź zmiany używając edytora## Menu Panel @@ -279,9 +299,9 @@ ## Status Panel
- e: edytuj plik konfiguracyjny - o: otwórz plik konfiguracyjny + e: edytuj konfigurację + o: otwórz konfigurację u: sprawdź aktualizacje enter: switch to a recent repo - a: pokazywać wszystkie logi branżowe + a: pokaż wszystkie logi gałęzidiff --git a/docs/keybindings/Keybindings_zh.md b/docs/keybindings/Keybindings_zh.md new file mode 100644 index 000000000..d0b297df3 --- /dev/null +++ b/docs/keybindings/Keybindings_zh.md @@ -0,0 +1,307 @@ +# This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/generate_cheatsheet.go` from the project root. + +# Lazygit 按键绑定 + +## 全局键绑定 + +
+ ctrl+r: 切换到最近的仓库 (+ +## 列表面板导航 + +) + pgup: 向上滚动主面板 (fn+up) + pgdown: 向下滚动主面板 (fn+down) + m: 查看 合并/变基 选项 + ctrl+p: 查看自定义补丁选项 + P: 推送 + p: 拉取 + R: 刷新 + x: 打开菜单 + z: (通过 reflog)撤销「实验功能」 + ctrl+z: (通过 reflog)重做「实验功能」 + +: 下一屏模式(正常/半屏/全屏) + _: 上一屏模式 + :: 执行自定义命令 + ctrl+s: 查看按路径过滤选项 + W: 打开 diff 菜单 + ctrl+e: 打开 diff 菜单 + @: 打开命令日志菜单 + }: Increase the size of the context shown around changes in the diff view + {: Decrease the size of the context shown around changes in the diff view +
+ .: 下一页 + ,: 上一页 + <: 滚动到顶部 + >: 滚动到底部 + /: 开始搜索 + ]: 下一个标签 + [: 上一个标签 ++ +## 分支 面板 (分支标签) + +
+ space: 检出 + o: 创建抓取请求 + O: 创建抓取请求选项 + ctrl+y: 将抓取请求 URL 复制到剪贴板 + c: 按名称检出 + F: 强制检出 + n: 新分支 + d: 删除分支 + r: 将已检出的分支变基到该分支 + M: 合并到当前检出的分支 + i: 显示 git-flow 选项 + f: 从上游快进此分支 + g: 查看重置选项 + R: 重命名分支 + ctrl+o: 将分支名称复制到剪贴板 + enter: 查看提交 ++ +## 分支 面板 (远程分支(在远程页面中)) + +
+ esc: 返回远程仓库列表 + g: 查看重置选项 + enter: 查看提交 + space: 检出 + n: 新分支 + M: 合并到当前检出的分支 + d: 删除分支 + r: 将已检出的分支变基到该分支 + u: 设置为检出分支的上游 ++ +## 分支 面板 (远程页面) + +
+ f: 抓取远程仓库 + n: 添加新的远程仓库 + d: 删除远程 + e: 编辑远程仓库 ++ +## 分支 面板 (子提交) + +
+ enter: 查看提交的文件 + space: 检出提交 + g: 查看重置选项 + n: 新分支 + c: 复制提交(拣选) + C: 复制提交范围(拣选) + ctrl+r: 重置已拣选(复制)的提交 + ctrl+o: 将提交的 SHA 复制到剪贴板 ++ +## 分支 面板 (标签页面) + +
+ space: 检出 + d: 删除标签 + P: 推送标签 + n: 创建标签 + g: 查看重置选项 + enter: 查看提交 ++ +## 提交文件 面板 + +
+ ctrl+o: 将提交的文件名复制到剪贴板 + c: 检出文件 + d: 放弃对此文件的提交更改 + o: 打开文件 + e: 编辑文件 + space: 补丁中包含的切换文件 + enter: 输入文件以将所选行添加到补丁中(或切换目录折叠) + `: 切换文件树视图 ++ +## 提交 面板 (提交) + +
+ ctrl+l: open log menu + s: 向下压缩 + r: 改写提交 + R: 使用编辑器重命名提交 + g: 重置为此提交 + f: 修正提交(fixup) + F: 为此提交创建修正 + S: 压缩在所选提交之上的所有“fixup!”提交(自动压缩) + d: 删除提交 + ctrl+j: 下移提交 + ctrl+k: 上移提交 + e: 编辑提交 + A: 用已暂存的更改来修补提交 + p: 选择提交(变基过程中) + t: 还原提交 + c: 复制提交(拣选) + ctrl+o: 将提交的 SHA 复制到剪贴板 + C: 复制提交范围(拣选) + v: 粘贴提交(拣选) + enter: 查看提交的文件 + space: 检出提交 + n: 从提交创建新分支 + T: 标签提交 + ctrl+r: 重置已拣选(复制)的提交 + ctrl+y: 将提交消息复制到剪贴板 + o: open commit in browser ++ +## 提交 面板 (Reflog) + +
+ enter: 查看提交的文件 + space: 检出提交 + g: 查看重置选项 + c: 复制提交(拣选) + C: 复制提交范围(拣选) + ctrl+r: 重置已拣选(复制)的提交 + ctrl+o: 将提交的 SHA 复制到剪贴板 ++ +## Extras 面板 + +
+ @: 打开命令日志菜单 ++ +## 文件 面板 + +
+ ctrl+b: 过滤提交文件 ++ +## 文件 面板 (文件) + +
+ c: 提交更改 + w: 提交更改而无需预先提交钩子 + A: 修补最后一次提交 + C: 提交更改(使用编辑器编辑提交信息) + space: 切换暂存状态 + d: 查看'放弃更改‘选项 + e: 编辑文件 + o: 打开文件 + i: 添加到 .gitignore + r: 刷新文件 + s: 将所有更改加入贮藏 + S: 查看隐藏选项 + a: 切换所有文件的暂存状态 + D: 查看重置选项 + enter: 暂存单个 块/行 用于文件, 或 折叠/展开 目录 + f: 抓取 + ctrl+o: 将文件名复制到剪贴板 + g: 查看上游重置选项 + `: 切换文件树视图 + M: 打开合并工具 + ctrl+w: 切换是否在差异视图中显示空白更改 ++ +## 文件 面板 (子模块) + +
+ ctrl+o: 将子模块名称复制到剪贴板 + enter: 输入子模块 + d: 查看重置和删除子模块选项 + u: 更新子模块 + n: 添加新的子模块 + e: 更新子模块 URL + i: 初始化子模块 + b: 查看批量子模块选项 ++ +## 主要 面板 (合并中) + +
+ H: scroll left + L: scroll right + esc: 返回文件面板 + M: 打开合并工具 + space: 选中区块 + b: 选中所有区块 + ◄: 选择上一个冲突 + ►: 选择下一个冲突 + ▲: 选择顶部块 + ▼: 选择底部块 + z: 撤销 ++ +## 主要 面板 (正常) + +
+ Ő: 向下滚动 (fn+up) + ő: 向上滚动 (fn+down) ++ +## 主要 面板 (构建补丁中) + +
+ esc: 退出逐行模式 + o: 打开文件 + ▲: 选择上一行 + ▼: 选择下一行 + ◄: 选择上一个区块 + ►: 选择下一个区块 + ctrl+o: copy the selected text to the clipboard + space: 添加/移除 行到补丁 + v: 切换拖动选择 + V: 切换拖动选择 + a: 切换选择区块 + H: scroll left + L: scroll right ++ +## 主要 面板 (正在暂存) + +
+ esc: 返回文件面板 + space: 切换行暂存状态 + d: 取消变更 (git reset) + tab: 切换到其他面板 + o: 打开文件 + ▲: 选择上一行 + ▼: 选择下一行 + ◄: 选择上一个区块 + ►: 选择下一个区块 + ctrl+o: copy the selected text to the clipboard + e: 编辑文件 + o: 打开文件 + v: 切换拖动选择 + V: 切换拖动选择 + a: 切换选择区块 + H: scroll left + L: scroll right + c: 提交更改 + w: 提交更改而无需预先提交钩子 + C: 提交更改(使用编辑器编辑提交信息) ++ +## 菜单 面板 + +
+ esc: 关闭菜单 ++ +## 贮藏 面板 + +
+ enter: 查看贮藏条目中的文件 + space: 应用 + g: 应用并删除 + d: 删除 + n: 新分支 ++ +## 状态 面板 + +
+ e: 编辑配置文件 + o: 打开配置文件 + u: 检查更新 + enter: 切换到最近的仓库 + a: 显示所有分支的日志 +diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go index e2200b694..fc188b6f9 100644 --- a/scripts/generate_cheatsheet.go +++ b/scripts/generate_cheatsheet.go @@ -18,6 +18,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/app" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/gui" + "github.com/jesseduffield/lazygit/pkg/i18n" ) type bindingSection struct { @@ -26,10 +27,10 @@ type bindingSection struct { } func main() { - langs := []string{"pl", "nl", "en"} - mConfig, _ := config.NewAppConfig("", "", "", "", "", true) + translationSetsByLang := i18n.GetTranslationSets() + mConfig := config.NewDummyAppConfig() - for _, lang := range langs { + for lang := range translationSetsByLang { os.Setenv("LC_ALL", lang) mApp, _ := app.NewApp(mConfig, "") file, err := os.Create(getProjectRoot() + "/docs/keybindings/Keybindings_" + lang + ".md") @@ -38,7 +39,9 @@ func main() { } bindingSections := getBindingSections(mApp) - content := formatSections(mApp, bindingSections) + content := formatSections(mApp.Tr, bindingSections) + content = fmt.Sprintf("# This file is auto-generated. To update, make the changes in the "+ + "pkg/i18n directory and then run `go run scripts/generate_cheatsheet.go` from the project root.\n\n%s", content) writeString(file, content) } } @@ -231,8 +234,8 @@ func addBinding(title string, bindingSections []*bindingSection, binding *gui.Bi return append(bindingSections, section) } -func formatSections(mApp *app.App, bindingSections []*bindingSection) string { - content := fmt.Sprintf("# Lazygit %s\n", mApp.Tr.Keybindings) +func formatSections(tr *i18n.TranslationSet, bindingSections []*bindingSection) string { + content := fmt.Sprintf("# Lazygit %s\n", tr.Keybindings) for _, section := range bindingSections { content += formatTitle(section.title)