diff options
Diffstat (limited to 'pkg/i18n/i18n.go')
-rw-r--r-- | pkg/i18n/i18n.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index c743218f8..ffd77fde6 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -1,7 +1,7 @@ package lang import ( - "github.com/BurntSushi/toml" + "github.com/cloudfoundry/jibber_jabber" "github.com/nicksnyder/go-i18n/v2/i18n" "golang.org/x/text/language" ) @@ -9,15 +9,13 @@ import ( // the function to setup the localizer func getlocalizer() *i18n.Localizer { - // TODO: currently the system language issn't detected - // I'm not sure how to detect it - var i18nObject = &i18n.Bundle{DefaultLanguage: language.Dutch} - i18nObject.RegisterUnmarshalFunc("toml", toml.Unmarshal) + userLang, _ := jibber_jabber.DetectLanguage() + var i18nObject = &i18n.Bundle{DefaultLanguage: language.English} // add translation file(s) i18nObject = addDutch(i18nObject) - return i18n.NewLocalizer(i18nObject) + return i18n.NewLocalizer(i18nObject, userLang) } // setup the localizer for later use |