Skip to content

Commit

Permalink
fix(i18n): set "locales" as root dir (#847)
Browse files Browse the repository at this point in the history
go-i18n loads files from the root "locales" directory.
This should be the root when walking the file tree.
  • Loading branch information
Enda authored Jul 28, 2021
1 parent f17f3b4 commit 5ecbf82
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/localize/goi18n/go_i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5ecbf82

Please sign in to comment.