mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-27 12:32:37 +02:00
Translated pkg/gui/view_helpers.go
This commit is contained in:
parent
295093a432
commit
50b41bfccc
@ -29,7 +29,14 @@ func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if i == len(cyclableViews)-1 {
|
if i == len(cyclableViews)-1 {
|
||||||
gui.Log.Info(v.Name() + " is not in the list of views")
|
message := gui.Tr.TemplateLocalize(
|
||||||
|
"IssntListOfViews",
|
||||||
|
"{{.name}} is not in the list of views",
|
||||||
|
map[string]interface{}{
|
||||||
|
"name": v.Name(),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
gui.Log.Info(message)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,7 +59,14 @@ func (gui *Gui) previousView(g *gocui.Gui, v *gocui.View) error {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if i == len(cyclableViews)-1 {
|
if i == len(cyclableViews)-1 {
|
||||||
gui.Log.Info(v.Name() + " is not in the list of views")
|
message := gui.Tr.TemplateLocalize(
|
||||||
|
"IssntListOfViews",
|
||||||
|
"{{.name}} is not in the list of views",
|
||||||
|
map[string]interface{}{
|
||||||
|
"name": v.Name(),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
gui.Log.Info(message)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,7 +101,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
|
|||||||
case "stash":
|
case "stash":
|
||||||
return gui.handleStashEntrySelect(g, v)
|
return gui.handleStashEntrySelect(g, v)
|
||||||
default:
|
default:
|
||||||
panic("No view matching newLineFocused switch statement")
|
panic(gui.Tr.SLocalize("NoViewMachingNewLineFocusedSwitchStatement", "No view matching newLineFocused switch statement"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,11 +119,25 @@ func (gui *Gui) switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
|
|||||||
// we should never stack confirmation panels
|
// we should never stack confirmation panels
|
||||||
if oldView != nil && oldView.Name() != "confirmation" {
|
if oldView != nil && oldView.Name() != "confirmation" {
|
||||||
oldView.Highlight = false
|
oldView.Highlight = false
|
||||||
gui.Log.Info("setting previous view to:", oldView.Name())
|
message := gui.Tr.TemplateLocalize(
|
||||||
|
"settingPreviewsViewTo",
|
||||||
|
"setting previous view to: {{.oldViewName}}",
|
||||||
|
map[string]interface{}{
|
||||||
|
"oldViewName": oldView.Name(),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
gui.Log.Info(message)
|
||||||
gui.State.PreviousView = oldView.Name()
|
gui.State.PreviousView = oldView.Name()
|
||||||
}
|
}
|
||||||
newView.Highlight = true
|
newView.Highlight = true
|
||||||
gui.Log.Info("new focused view is " + newView.Name())
|
message := gui.Tr.TemplateLocalize(
|
||||||
|
"newFocusedViewIs",
|
||||||
|
"new focused view is {{.newFocusedView}}",
|
||||||
|
map[string]interface{}{
|
||||||
|
"newFocusedView": newView.Name(),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
gui.Log.Info(message)
|
||||||
if _, err := g.SetCurrentView(newView.Name()); err != nil {
|
if _, err := g.SetCurrentView(newView.Name()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -265,6 +265,18 @@ func addDutch(i18nObject *i18n.Bundle) {
|
|||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "StashChanges",
|
ID: "StashChanges",
|
||||||
Other: "Stash veranderingen",
|
Other: "Stash veranderingen",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "IssntListOfViews",
|
||||||
|
Other: "{{.name}} is niet in de lijst van weergaves",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "NoViewMachingNewLineFocusedSwitchStatement",
|
||||||
|
Other: "Er machen geen weergave met de newLineFocused switch declaratie",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "settingPreviewsViewTo",
|
||||||
|
Other: "vorige weergave instellen op: {{.oldViewName}}",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "newFocusedViewIs",
|
||||||
|
Other: "nieuw gefocussed weergave is {{.newFocusedView}}",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user