Skip to content

Commit

Permalink
Translated pkg/gui/view_helpers.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarkk committed Aug 15, 2018
1 parent 295093a commit 50b41bf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
38 changes: 33 additions & 5 deletions pkg/gui/view_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error {
break
}
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
}
}
Expand All @@ -52,7 +59,14 @@ func (gui *Gui) previousView(g *gocui.Gui, v *gocui.View) error {
break
}
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
}
}
Expand Down Expand Up @@ -87,7 +101,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
case "stash":
return gui.handleStashEntrySelect(g, v)
default:
panic("No view matching newLineFocused switch statement")
panic(gui.Tr.SLocalize("NoViewMachingNewLineFocusedSwitchStatement", "No view matching newLineFocused switch statement"))
}
}

Expand All @@ -105,11 +119,25 @@ func (gui *Gui) switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
// we should never stack confirmation panels
if oldView != nil && oldView.Name() != "confirmation" {
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()
}
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 {
return err
}
Expand Down
12 changes: 12 additions & 0 deletions pkg/i18n/dutch.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@ func addDutch(i18nObject *i18n.Bundle) {
}, &i18n.Message{
ID: "StashChanges",
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}}",
},
)
}

0 comments on commit 50b41bf

Please sign in to comment.