Skip to content

Commit

Permalink
i18n: Avoid using the global logger
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Oct 28, 2018
1 parent 1c7b7b4 commit 95e72f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions i18n/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/gohugoio/hugo/helpers"

"github.com/nicksnyder/go-i18n/i18n/bundle"
jww "github.com/spf13/jwalterweatherman"
)

var (
Expand Down Expand Up @@ -62,7 +61,7 @@ func (t Translator) initFuncs(bndl *bundle.Bundle) {

defaultT, err := bndl.Tfunc(defaultContentLanguage)
if err != nil {
jww.WARN.Printf("No translation bundle found for default language %q", defaultContentLanguage)
t.logger.WARN.Printf("No translation bundle found for default language %q", defaultContentLanguage)
}

enableMissingTranslationPlaceholders := t.cfg.GetBool("enableMissingTranslationPlaceholders")
Expand All @@ -72,7 +71,7 @@ func (t Translator) initFuncs(bndl *bundle.Bundle) {
t.translateFuncs[currentLang] = func(translationID string, args ...interface{}) string {
tFunc, err := bndl.Tfunc(currentLang)
if err != nil {
jww.WARN.Printf("could not load translations for language %q (%s), will use default content language.\n", lang, err)
t.logger.WARN.Printf("could not load translations for language %q (%s), will use default content language.\n", lang, err)
}

translated := tFunc(translationID, args...)
Expand Down

0 comments on commit 95e72f5

Please sign in to comment.