Skip to content

Commit

Permalink
Fixed by CR suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmelserj committed Apr 26, 2023
1 parent c8e6816 commit 7d3f881
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
12 changes: 0 additions & 12 deletions internal/configurator/configurator.go

This file was deleted.

19 changes: 9 additions & 10 deletions ut.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ package ut
import (
"github.com/gozix/di"
"github.com/gozix/glue/v3"
"github.com/gozix/universal-translator/v3/internal/configurator"

"github.com/go-playground/locales"
"github.com/go-playground/locales/en"
ut "github.com/go-playground/universal-translator"
)

type (
// Configurator is type alias of configurator.Configurator.
Configurator = configurator.Configurator
)
// Bundle implements the glue.Bundle interface.
Bundle struct {
fallback locales.Translator
locales []locales.Translator
}

// Bundle implements the glue.Bundle interface.
type Bundle struct {
fallback locales.Translator
locales []locales.Translator
}
// Configurator configures universal translator after its creation.
Configurator func(*ut.UniversalTranslator) error
)

// Bundle implements the glue.Bundle interface.
var _ glue.Bundle = (*Bundle)(nil)
Expand Down Expand Up @@ -61,7 +60,7 @@ func (b *Bundle) Build(builder di.Builder) error {
)
}

func (b *Bundle) provideUT(append []locales.Translator, override []locales.Translator, configurators []configurator.Configurator) (_ *ut.UniversalTranslator, err error) {
func (b *Bundle) provideUT(append []locales.Translator, override []locales.Translator, configurators []Configurator) (_ *ut.UniversalTranslator, err error) {
var translator = ut.New(b.fallback, b.locales...)

for _, localeTranslator := range append {
Expand Down

0 comments on commit 7d3f881

Please sign in to comment.