From d3e54231522687a8e2d17f769ff2abd5f5cd5837 Mon Sep 17 00:00:00 2001 From: Enda Phelan Date: Wed, 28 Jul 2021 13:59:19 +0100 Subject: [PATCH] fix(i18n): set "locales" as root dir go-i18n loads files from the root "locales" directory. This should be the root when walking the file tree. --- pkg/localize/goi18n/go_i18n.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/localize/goi18n/go_i18n.go b/pkg/localize/goi18n/go_i18n.go index fd777fb2d..80d94e5c7 100644 --- a/pkg/localize/goi18n/go_i18n.go +++ b/pkg/localize/goi18n/go_i18n.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io/fs" - "path/filepath" "github.com/redhat-developer/app-services-cli/pkg/localize" "gopkg.in/yaml.v2" @@ -86,8 +85,7 @@ func (l *Goi18n) MustLocalize(id string, tmplEntries ...*localize.TemplateEntry) // walk the file system and load each file into memory func (l *Goi18n) load() error { - localesRoot := filepath.Join(l.path, l.language.String()) - return fs.WalkDir(l.files, localesRoot, func(path string, info fs.DirEntry, err error) error { + return fs.WalkDir(l.files, l.path, func(path string, info fs.DirEntry, err error) error { if err != nil { return err }