From 63a06da0c72025060ad0bbc2747ba7172a8d7611 Mon Sep 17 00:00:00 2001 From: "marko.tikvic" Date: Thu, 12 Jul 2018 15:04:36 +0200 Subject: [PATCH] automatic settings for default locale --- localization.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/localization.go b/localization.go index 69eb7e5..d02675c 100644 --- a/localization.go +++ b/localization.go @@ -55,6 +55,10 @@ func (d *Dictionary) AddTranslations(directory string) error { d.supported = append(d.supported, loc) } + if len(d.supported) > 0 { + d.setDefaultLocale(d.supported[0]) + } + return nil } -- 1.8.1.2