From c453bfeb32d90a4c9202e11e8179b9b500e1a73b Mon Sep 17 00:00:00 2001 From: skanehira Date: Sat, 16 Mar 2019 16:40:48 +0900 Subject: generate the cheatsheet for each supported language --- scripts/generate_cheatsheet.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go index f8beaa457..529f37da8 100644 --- a/scripts/generate_cheatsheet.go +++ b/scripts/generate_cheatsheet.go @@ -25,16 +25,18 @@ type bindingSection struct { } func main() { + langs := []string{"pl", "nl", "en"} 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) - - writeString(file, content) + bindingSections := getBindingSections(mApp) + content := formatSections(mApp, bindingSections) + writeString(file, content) + } } func writeString(file *os.File, str string) { -- cgit v1.2.3