Skip to content

Commit

Permalink
Load yml files too
Browse files Browse the repository at this point in the history
  • Loading branch information
fullpipe committed Sep 8, 2024
1 parent e0f608e commit 949042f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mf/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (b *bundle) LoadDir(dir fs.FS) error {
return nil
}

if path.Ext(f.Name()) != ".yaml" {
if path.Ext(f.Name()) != ".yaml" || path.Ext(f.Name()) != ".yml" {
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions mf/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ func TestBundle_LoadDir(t *testing.T) {
require.NoError(t, b.LoadDir(fstest.MapFS{
"messages.en.yaml": {Data: []byte("foo: bar")},
"messages.es.yaml": {Data: []byte("foo: bar")},
"messages.ru.yml": {Data: []byte("foo: bar")},
}), "no error on normal yaml files")
assert.NotNil(t, b.dictionaries[language.English])
assert.NotNil(t, b.dictionaries[language.Spanish])
assert.NotNil(t, b.dictionaries[language.Russian])
}

func TestBundle_Translator(t *testing.T) {
Expand Down

0 comments on commit 949042f

Please sign in to comment.