mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
update keybindings
This commit is contained in:
parent
e361a42995
commit
799245da38
5 changed files with 190 additions and 10 deletions
57
docs/keybindings/Keybindings_en.md
Normal file
57
docs/keybindings/Keybindings_en.md
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# Lazydocker menu
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>e</kbd>: edit config container
|
||||||
|
<kbd>o</kbd>: open config container
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Containers
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove
|
||||||
|
<kbd>s</kbd>: stop
|
||||||
|
<kbd>r</kbd>: restart
|
||||||
|
<kbd>a</kbd>: attach
|
||||||
|
<kbd>D</kbd>: prune exited containers
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
<kbd>c</kbd>: run predefined custom command
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Services
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>d</kbd>: remove containers
|
||||||
|
<kbd>s</kbd>: stop
|
||||||
|
<kbd>r</kbd>: restart
|
||||||
|
<kbd>a</kbd>: attach
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>R</kbd>: view restart options
|
||||||
|
<kbd>c</kbd>: run predefined custom command
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Images
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove image
|
||||||
|
<kbd>D</kbd>: prune unused images
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Volumes
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove volume
|
||||||
|
<kbd>D</kbd>: prune unused volumes
|
||||||
|
</pre>
|
||||||
57
docs/keybindings/Keybindings_nl.md
Normal file
57
docs/keybindings/Keybindings_nl.md
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# Lazydocker menu
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>e</kbd>: edit config container
|
||||||
|
<kbd>o</kbd>: open config container
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Containers
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove
|
||||||
|
<kbd>s</kbd>: stop
|
||||||
|
<kbd>r</kbd>: restart
|
||||||
|
<kbd>a</kbd>: attach
|
||||||
|
<kbd>D</kbd>: prune exited containers
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
<kbd>c</kbd>: run predefined custom command
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Services
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>d</kbd>: remove containers
|
||||||
|
<kbd>s</kbd>: stop
|
||||||
|
<kbd>r</kbd>: restart
|
||||||
|
<kbd>a</kbd>: attach
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>R</kbd>: view restart options
|
||||||
|
<kbd>c</kbd>: run predefined custom command
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Images
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove image
|
||||||
|
<kbd>D</kbd>: prune unused images
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Volumes
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove volume
|
||||||
|
<kbd>D</kbd>: prune unused volumes
|
||||||
|
</pre>
|
||||||
57
docs/keybindings/Keybindings_pl.md
Normal file
57
docs/keybindings/Keybindings_pl.md
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# Lazydocker menu
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>e</kbd>: edit config container
|
||||||
|
<kbd>o</kbd>: open config container
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Containers
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove
|
||||||
|
<kbd>s</kbd>: stop
|
||||||
|
<kbd>r</kbd>: restart
|
||||||
|
<kbd>a</kbd>: attach
|
||||||
|
<kbd>D</kbd>: prune exited containers
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
<kbd>c</kbd>: run predefined custom command
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Services
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>d</kbd>: remove containers
|
||||||
|
<kbd>s</kbd>: stop
|
||||||
|
<kbd>r</kbd>: restart
|
||||||
|
<kbd>a</kbd>: attach
|
||||||
|
<kbd>m</kbd>: view logs
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>R</kbd>: view restart options
|
||||||
|
<kbd>c</kbd>: run predefined custom command
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Images
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove image
|
||||||
|
<kbd>D</kbd>: prune unused images
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Volumes
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>[</kbd>: previous tab
|
||||||
|
<kbd>]</kbd>: next tab
|
||||||
|
<kbd>d</kbd>: remove volume
|
||||||
|
<kbd>D</kbd>: prune unused volumes
|
||||||
|
</pre>
|
||||||
|
|
@ -6,6 +6,8 @@ type TranslationSet struct {
|
||||||
ErrorMessage string
|
ErrorMessage string
|
||||||
NotEnoughSpace string
|
NotEnoughSpace string
|
||||||
StatusTitle string
|
StatusTitle string
|
||||||
|
MainTitle string
|
||||||
|
GlobalTitle string
|
||||||
Navigate string
|
Navigate string
|
||||||
Menu string
|
Menu string
|
||||||
Execute string
|
Execute string
|
||||||
|
|
@ -123,6 +125,8 @@ func englishSet() TranslationSet {
|
||||||
AnonymousReportingTitle: "Help make lazydocker better",
|
AnonymousReportingTitle: "Help make lazydocker better",
|
||||||
AnonymousReportingPrompt: "Would you like to enable anonymous reporting data to help improve lazydocker? (enter/esc)",
|
AnonymousReportingPrompt: "Would you like to enable anonymous reporting data to help improve lazydocker? (enter/esc)",
|
||||||
|
|
||||||
|
GlobalTitle: "Global",
|
||||||
|
MainTitle: "Main",
|
||||||
StatusTitle: "Status",
|
StatusTitle: "Status",
|
||||||
ServicesTitle: "Services",
|
ServicesTitle: "Services",
|
||||||
ContainersTitle: "Containers",
|
ContainersTitle: "Containers",
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,10 @@ type bindingSection struct {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
langs := []string{"pl", "nl", "en"}
|
langs := []string{"pl", "nl", "en"}
|
||||||
mConfig, _ := config.NewAppConfig("", "", "", "", "", true)
|
mConfig, err := config.NewAppConfig("lazydocker", "", "", "", "", true)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
for _, lang := range langs {
|
for _, lang := range langs {
|
||||||
os.Setenv("LC_ALL", lang)
|
os.Setenv("LC_ALL", lang)
|
||||||
|
|
@ -49,12 +52,6 @@ func writeString(file *os.File, str string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func localisedTitle(mApp *app.App, str string) string {
|
|
||||||
return ""
|
|
||||||
// viewTitle := strings.Title(str) + "Title"
|
|
||||||
// return mApp.Tr.ViewTitle // FIXME: this used to be dynamic but we can't make this dynamic again without reflection since we're now using a struct of translation strings
|
|
||||||
}
|
|
||||||
|
|
||||||
func formatTitle(title string) string {
|
func formatTitle(title string) string {
|
||||||
return fmt.Sprintf("\n## %s\n\n", title)
|
return fmt.Sprintf("\n## %s\n\n", title)
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +63,6 @@ func formatBinding(binding *gui.Binding) string {
|
||||||
func getBindingSections(mApp *app.App) []*bindingSection {
|
func getBindingSections(mApp *app.App) []*bindingSection {
|
||||||
bindingSections := []*bindingSection{}
|
bindingSections := []*bindingSection{}
|
||||||
|
|
||||||
// TODO: add context-based keybindings
|
|
||||||
for _, binding := range mApp.Gui.GetInitialKeybindings() {
|
for _, binding := range mApp.Gui.GetInitialKeybindings() {
|
||||||
if binding.Description == "" {
|
if binding.Description == "" {
|
||||||
continue
|
continue
|
||||||
|
|
@ -76,9 +72,18 @@ func getBindingSections(mApp *app.App) []*bindingSection {
|
||||||
if viewName == "" {
|
if viewName == "" {
|
||||||
viewName = "global"
|
viewName = "global"
|
||||||
}
|
}
|
||||||
title := localisedTitle(mApp, viewName)
|
|
||||||
|
|
||||||
bindingSections = addBinding(title, bindingSections, binding)
|
titleMap := map[string]string{
|
||||||
|
"global": mApp.Tr.GlobalTitle,
|
||||||
|
"main": mApp.Tr.MainTitle,
|
||||||
|
"status": mApp.Tr.StatusTitle,
|
||||||
|
"services": mApp.Tr.ServicesTitle,
|
||||||
|
"containers": mApp.Tr.ContainersTitle,
|
||||||
|
"images": mApp.Tr.ImagesTitle,
|
||||||
|
"volumes": mApp.Tr.VolumesTitle,
|
||||||
|
}
|
||||||
|
|
||||||
|
bindingSections = addBinding(titleMap[viewName], bindingSections, binding)
|
||||||
}
|
}
|
||||||
|
|
||||||
// for view, contexts := range mApp.Gui.GetContextMap() {
|
// for view, contexts := range mApp.Gui.GetContextMap() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue