Initialize translation set after reading user config

This allows having per-repo config files with different languages per repo. Now
granted, this is not an important use case that we need to support; however, the
goal is to eventually make all configs hot-reloadable (as opposed to loading
them only once at startup), so this is one step in that direction.
This commit is contained in:
Stefan Haller 2024-07-27 21:39:46 +02:00
parent 74ed1ac584
commit 2499a6c8a3
3 changed files with 20 additions and 6 deletions

View file

@ -63,6 +63,11 @@ func generateAtDir(cheatsheetDir string) {
if err != nil {
log.Fatal(err)
}
tr, err := i18n.NewTranslationSetFromConfig(common.Log, lang)
if err != nil {
log.Fatal(err)
}
common.Tr = tr
mApp, _ := app.NewApp(mConfig, nil, common)
path := cheatsheetDir + "/Keybindings_" + lang + ".md"
file, err := os.Create(path)