diff options
Diffstat (limited to 'langs')
-rw-r--r-- | langs/config.go | 3 | ||||
-rw-r--r-- | langs/i18n/i18n.go | 6 | ||||
-rw-r--r-- | langs/i18n/i18n_test.go | 3 | ||||
-rw-r--r-- | langs/i18n/translationProvider.go | 2 | ||||
-rw-r--r-- | langs/language.go | 2 |
5 files changed, 1 insertions, 15 deletions
diff --git a/langs/config.go b/langs/config.go index 3afd15df0..3b1da89ec 100644 --- a/langs/config.go +++ b/langs/config.go @@ -35,7 +35,6 @@ type LanguagesConfig struct { } func LoadLanguageSettings(cfg config.Provider, oldLangs Languages) (c LanguagesConfig, err error) { - defaultLang := strings.ToLower(cfg.GetString("defaultContentLanguage")) if defaultLang == "" { defaultLang = "en" @@ -160,7 +159,6 @@ func LoadLanguageSettings(cfg config.Provider, oldLangs Languages) (c LanguagesC return c, errors.New("baseURL must be set on all or none of the languages") } } - } return c, nil @@ -172,7 +170,6 @@ func toSortedLanguages(cfg config.Provider, l map[string]interface{}) (Languages for lang, langConf := range l { langsMap, err := maps.ToStringMapE(langConf) - if err != nil { return nil, fmt.Errorf("Language config is not a map: %T", langConf) } diff --git a/langs/i18n/i18n.go b/langs/i18n/i18n.go index 31cb5d732..dab620be6 100644 --- a/langs/i18n/i18n.go +++ b/langs/i18n/i18n.go @@ -27,9 +27,7 @@ import ( type translateFunc func(translationID string, templateData interface{}) string -var ( - i18nWarningLogger = helpers.NewDistinctFeedbackLogger() -) +var i18nWarningLogger = helpers.NewDistinctFeedbackLogger() // Translator handles i18n translations. type Translator struct { @@ -60,7 +58,6 @@ func (t Translator) Func(lang string) translateFunc { return func(translationID string, args interface{}) string { return "" } - } func (t Translator) initFuncs(bndl *i18n.Bundle) { @@ -72,7 +69,6 @@ func (t Translator) initFuncs(bndl *i18n.Bundle) { currentLangKey := strings.ToLower(strings.TrimPrefix(currentLangStr, artificialLangTagPrefix)) localizer := i18n.NewLocalizer(bndl, currentLangStr) t.translateFuncs[currentLangKey] = func(translationID string, templateData interface{}) string { - var pluralCount interface{} if templateData != nil { diff --git a/langs/i18n/i18n_test.go b/langs/i18n/i18n_test.go index fa78f708c..7b5a10d67 100644 --- a/langs/i18n/i18n_test.go +++ b/langs/i18n/i18n_test.go @@ -244,7 +244,6 @@ func doTestI18nTranslate(t testing.TB, test i18nTest, cfg config.Provider) strin tp := prepareTranslationProvider(t, test, cfg) f := tp.t.Func(test.lang) return f(test.id, test.args) - } func prepareTranslationProvider(t testing.TB, test i18nTest, cfg config.Provider) *TranslationProvider { @@ -298,7 +297,6 @@ func getConfig() *viper.Viper { v.Set("allModules", modules.Modules{mod}) return v - } func TestI18nTranslate(t *testing.T) { @@ -339,5 +337,4 @@ func BenchmarkI18nTranslate(b *testing.B) { } }) } - } diff --git a/langs/i18n/translationProvider.go b/langs/i18n/translationProvider.go index 07bd9219a..302ca84c6 100644 --- a/langs/i18n/translationProvider.go +++ b/langs/i18n/translationProvider.go @@ -73,7 +73,6 @@ func (tp *TranslationProvider) Update(d *deps.Deps) error { d.Translate = tp.t.Func(d.Language.Lang) return nil - } const artificialLangTagPrefix = "art-x-" @@ -138,5 +137,4 @@ func errWithFileContext(inerr error, r source.File) error { herrors.SimpleLineMatcher) return err - } diff --git a/langs/language.go b/langs/language.go index 874bd3020..9fa22b05a 100644 --- a/langs/language.go +++ b/langs/language.go @@ -122,7 +122,6 @@ func (l Languages) Less(i, j int) bool { } return wj == 0 || wi < wj - } func (l Languages) Swap(i, j int) { l[i], l[j] = l[j], l[i] } @@ -256,5 +255,4 @@ func (l *Language) IsSet(key string) bool { } } return l.Cfg.IsSet(key) - } |