generate the cheatsheet for each supported language

This commit is contained in:
skanehira 2019-03-16 16:40:48 +09:00 committed by Jesse Duffield
parent f6ca450d36
commit c453bfeb32

View file

@ -25,16 +25,18 @@ type bindingSection struct {
} }
func main() { func main() {
langs := []string{"pl", "nl", "en"}
mConfig, _ := config.NewAppConfig("", "", "", "", "", true) mConfig, _ := config.NewAppConfig("", "", "", "", "", true)
mApp, _ := app.NewApp(mConfig)
lang := mApp.Tr.GetLanguage()
file, _ := os.Create("Keybindings_" + lang + ".md")
bindingSections := getBindingSections(mApp) for _, lang := range langs {
os.Setenv("LC_ALL", lang)
mApp, _ := app.NewApp(mConfig)
file, _ := os.Create("Keybindings_" + lang + ".md")
content := formatSections(mApp, bindingSections) bindingSections := getBindingSections(mApp)
content := formatSections(mApp, bindingSections)
writeString(file, content) writeString(file, content)
}
} }
func writeString(file *os.File, str string) { func writeString(file *os.File, str string) {