From 0f145093feee545f694c0969819a74d6b223c551 Mon Sep 17 00:00:00 2001 From: Mark Kopenga Date: Fri, 17 Aug 2018 17:22:30 +0200 Subject: Here i a fix for the error go complain on your pull --- pkg/i18n/dutch.go | 4 ++-- pkg/i18n/english.go | 4 ++-- pkg/i18n/i18n.go | 18 +++++++++++++++--- pkg/i18n/polish.go | 4 ++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index 0ba562a22..60133e662 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -6,10 +6,10 @@ import ( ) // addDutch will add all dutch translations -func addDutch(i18nObject *i18n.Bundle) { +func addDutch(i18nObject *i18n.Bundle) error { // add the translations - i18nObject.AddMessages(language.Dutch, + return i18nObject.AddMessages(language.Dutch, &i18n.Message{ ID: "NotEnoughSpace", Other: "Niet genoeg ruimte om de panelen te renderen", diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index d67bd9053..46c9bbd03 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -15,9 +15,9 @@ import ( "golang.org/x/text/language" ) -func addEnglish(i18nObject *i18n.Bundle) { +func addEnglish(i18nObject *i18n.Bundle) error { - i18nObject.AddMessages(language.English, + return i18nObject.AddMessages(language.English, &i18n.Message{ ID: "NotEnoughSpace", Other: "Not enough space to render panels", diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 03b79fc2e..eac8dc140 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -1,6 +1,8 @@ package i18n import ( + "log" + "github.com/Sirupsen/logrus" "github.com/cloudfoundry/jibber_jabber" "github.com/nicksnyder/go-i18n/v2/i18n" @@ -79,7 +81,17 @@ func (l *Localizer) GetLanguage() string { // add translation file(s) func addBundles(i18nBundle *i18n.Bundle) { - addPolish(i18nBundle) - addDutch(i18nBundle) - addEnglish(i18nBundle) + err := addPolish(i18nBundle) + if err != nil { + log.Fatal(err) + } + err = addDutch(i18nBundle) + if err != nil { + log.Fatal(err) + } + err = addEnglish(i18nBundle) + if err != nil { + log.Fatal(err) + } + } diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 2f1a72c87..9b9fa19e1 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -5,9 +5,9 @@ import ( "golang.org/x/text/language" ) -func addPolish(i18nObject *i18n.Bundle) { +func addPolish(i18nObject *i18n.Bundle) error { - i18nObject.AddMessages(language.Polish, + return i18nObject.AddMessages(language.Polish, &i18n.Message{ ID: "NotEnoughSpace", Other: "Za mało miejsca do wyświetlenia paneli", -- cgit v1.2.3