Skip to content

Commit 260b309

Browse files
committed
fix: ignore non-yaml file when translator initialization
1 parent 18f8944 commit 260b309

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

contrib/i18n/localizer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ func NewTranslator(bundleDir string) (i18n.Translator, error) {
7777
if file.IsDir() {
7878
continue
7979
}
80+
// ignore non-YAML file
81+
if filepath.Ext(file.Name()) != ".yaml" {
82+
continue
83+
}
8084

8185
// read the resource from single entry file
8286
buf, err := os.ReadFile(filepath.Join(bundleDir, file.Name()))

0 commit comments

Comments
 (0)