summaryrefslogtreecommitdiffstats
path: root/pkg/i18n/i18n.go
diff options
context:
space:
mode:
authorAnthony HAMON <anthony.hamon@iadvize.com>2018-08-20 21:18:15 +0200
committerAnthony HAMON <anthony.hamon@iadvize.com>2018-08-20 21:18:50 +0200
commit4972a4c21828220c60b6ca2d62be43930a639884 (patch)
tree17cb462ecaac62ba6a91803b4ca15478a1b0eb45 /pkg/i18n/i18n.go
parente4070ccb4f2de10f873561a0794bbae1a0513a29 (diff)
rewrite addBundles
Diffstat (limited to 'pkg/i18n/i18n.go')
-rw-r--r--pkg/i18n/i18n.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go
index e46cb3fcb..bb97cc9a0 100644
--- a/pkg/i18n/i18n.go
+++ b/pkg/i18n/i18n.go
@@ -61,19 +61,18 @@ func (l *Localizer) GetLanguage() string {
// add translation file(s)
func addBundles(log *logrus.Logger, i18nBundle *i18n.Bundle) {
- 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)
+ fs := []func(*i18n.Bundle) error{
+ addPolish,
+ addDutch,
+ addEnglish,
}
+ for _, f := range fs {
+ if err := f(i18nBundle); err != nil {
+ log.Fatal(err)
+
+ }
+ }
}
// detectLanguage extracts user language from environment