1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00

Added more messages and text issue: #137

This commit is contained in:
Mark Kopenga 2018-08-13 22:00:44 +02:00
parent 65eb3780a0
commit f2dfcb6e12
2 changed files with 58 additions and 13 deletions

View File

@ -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)

45
i18n.go
View File

@ -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{
@ -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)