Skip to content

Commit

Permalink
Added more messages and text issue: jesseduffield#137
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarkk committed Aug 13, 2018
1 parent 65eb378 commit f2dfcb6
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 13 deletions.
26 changes: 13 additions & 13 deletions files_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ func handleIgnoreFile(g *gocui.Gui, v *gocui.View) error {

func renderfilesOptions(g *gocui.Gui, gitFile *GitFile) error {
optionsMap := map[string]string{
"← → ↑ ↓": "navigate",
"S": "stash files",
"c": "commit changes",
"o": "open",
"i": "ignore",
"d": "delete",
"space": "toggle staged",
"R": "refresh",
"t": "add patch",
"e": "edit",
"PgUp/PgDn": "scroll",
"← → ↑ ↓": ShortLocalize("navigate", "navigate"),
"S": ShortLocalize("stashFiles", "stash files"),
"c": ShortLocalize("commitChanges", "commit changes"),
"o": ShortLocalize("open", "open"),
"i": ShortLocalize("ignore", "ignore"),
"d": ShortLocalize("delete", "delete"),
"space": ShortLocalize("toggleStaged", "toggle staged"),
"R": ShortLocalize("refresh", "refresh"),
"t": ShortLocalize("addPatch", "add patch"),
"e": ShortLocalize("edit", "edit"),
"PgUp/PgDn": ShortLocalize("scroll", "scroll"),
}
if state.HasMergeConflicts {
optionsMap["a"] = "abort merge"
optionsMap["m"] = "resolve merge conflicts"
optionsMap["a"] = ShortLocalize("abortMerge", "abort merge")
optionsMap["m"] = ShortLocalize("resolveMergeConflicts", "resolve merge conflicts")
}
if gitFile == nil {
return renderOptionsMap(g, optionsMap)
Expand Down
45 changes: 45 additions & 0 deletions i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ func getlocalizer() *i18n.Localizer {
var i18nObject = &i18n.Bundle{DefaultLanguage: language.English}
i18nObject.RegisterUnmarshalFunc("toml", toml.Unmarshal)

// To add more translations do:
// AddMessages(tag language.Tag, messages ...*Message)
// https://godoc.org/github.com/nicksnyder/go-i18n/v2/i18n#Bundle.AddMessages

// Dutch translation for some words
i18nObject.AddMessages(language.Dutch,
&i18n.Message{
Expand All @@ -31,10 +35,51 @@ func getlocalizer() *i18n.Localizer {
}, &i18n.Message{
ID: "CommitMessage",
Other: "Commit Bericht",
}, &i18n.Message{
ID: "CommitChanges",
Other: "Commit Veranderingen",
}, &i18n.Message{
ID: "StatusTitle",
Other: "Status",
}, &i18n.Message{
ID: "navigate",
Other: "navigeer",
}, &i18n.Message{
ID: "stashFiles",
Other: "stash-bestanden",
}, &i18n.Message{
ID: "open",
Other: "open",
}, &i18n.Message{
ID: "ignore",
Other: "negeren",
}, &i18n.Message{
ID: "delete",
Other: "verwijderen",
}, &i18n.Message{
ID: "toggleStaged",
Other: "toggle staged",
}, &i18n.Message{
ID: "refresh",
Other: "verversen",
}, &i18n.Message{
ID: "addPatch",
Other: "verandering toevoegen",
}, &i18n.Message{
ID: "edit",
Other: "veranderen",
}, &i18n.Message{
ID: "scroll",
Other: "scroll",
}, &i18n.Message{
ID: "abortMerge",
Other: "samenvoegen afbreken",
}, &i18n.Message{
ID: "resolveMergeConflicts",
Other: "verhelp samenvoegen fouten",
},

//
)

return i18n.NewLocalizer(i18nObject)
Expand Down

0 comments on commit f2dfcb6

Please sign in to comment.