diff options
author | Mark Kopenga <mkopenga@gmail.com> | 2018-08-14 12:56:11 +0200 |
---|---|---|
committer | Mark Kopenga <mkopenga@gmail.com> | 2018-08-14 12:56:11 +0200 |
commit | 6e518142b48f70fc63b0c72d00754733accd23f2 (patch) | |
tree | 26ee06fe5f3183d79c68c4311589f8507194b84a | |
parent | 0c39347224335998fd38cdad2feb23f55d3a5516 (diff) |
added some commands
-rw-r--r-- | pkg/i18n/dutch.go | 5 | ||||
-rw-r--r-- | pkg/i18n/i18n.go | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index 10d01c6df..12cbc8f43 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -5,7 +5,10 @@ import ( "golang.org/x/text/language" ) +// addDutch will add all the translations func addDutch(i18nObject *i18n.Bundle) *i18n.Bundle { + + // add the translations i18nObject.AddMessages(language.Dutch, &i18n.Message{ ID: "NotEnoughSpace", @@ -75,5 +78,7 @@ func addDutch(i18nObject *i18n.Bundle) *i18n.Bundle { Other: "uitchecken", }, ) + + // return the new i18nObject return i18nObject } diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index ffd77fde6..a62f50c1e 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -9,12 +9,16 @@ import ( // the function to setup the localizer func getlocalizer() *i18n.Localizer { + // detect the user's language userLang, _ := jibber_jabber.DetectLanguage() + + // create a i18n bundle that can be used to add translations and other things var i18nObject = &i18n.Bundle{DefaultLanguage: language.English} // add translation file(s) i18nObject = addDutch(i18nObject) + // return the new localizer that can be used to translate text return i18n.NewLocalizer(i18nObject, userLang) } |