diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-26 15:46:18 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-26 16:53:31 +1000 |
commit | 540edc0c35e97393d9a01c927f7ac962bcbf6d37 (patch) | |
tree | f9f93b1905828f0c665fc25819400e16f4cbc27e /pkg/i18n/i18n.go | |
parent | 93ab892bdd1226f9a519a938c8b28590e71e54f3 (diff) |
anonymous reporting data
Diffstat (limited to 'pkg/i18n/i18n.go')
-rw-r--r-- | pkg/i18n/i18n.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 898a13906..1628df707 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -1,9 +1,9 @@ package i18n import ( - "github.com/sirupsen/logrus" "github.com/cloudfoundry/jibber_jabber" "github.com/nicksnyder/go-i18n/v2/i18n" + "github.com/sirupsen/logrus" "golang.org/x/text/language" ) @@ -14,11 +14,11 @@ type Teml map[string]interface{} type Localizer struct { i18nLocalizer *i18n.Localizer language string - Log *logrus.Logger + Log *logrus.Entry } // NewLocalizer creates a new Localizer -func NewLocalizer(log *logrus.Logger) *Localizer { +func NewLocalizer(log *logrus.Entry) *Localizer { userLang := detectLanguage(jibber_jabber.DetectLanguage) log.Info("language: " + userLang) @@ -60,7 +60,7 @@ func (l *Localizer) GetLanguage() string { } // add translation file(s) -func addBundles(log *logrus.Logger, i18nBundle *i18n.Bundle) { +func addBundles(log *logrus.Entry, i18nBundle *i18n.Bundle) { fs := []func(*i18n.Bundle) error{ addPolish, addDutch, @@ -85,7 +85,7 @@ func detectLanguage(langDetector func() (string, error)) string { } // setupLocalizer creates a new localizer using given userLang -func setupLocalizer(log *logrus.Logger, userLang string) *Localizer { +func setupLocalizer(log *logrus.Entry, userLang string) *Localizer { // create a i18n bundle that can be used to add translations and other things i18nBundle := &i18n.Bundle{DefaultLanguage: language.English} |