summaryrefslogtreecommitdiffstats
path: root/langs/language.go
diff options
context:
space:
mode:
Diffstat (limited to 'langs/language.go')
-rw-r--r--langs/language.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/langs/language.go b/langs/language.go
index c4cba15bf..3bb131be1 100644
--- a/langs/language.go
+++ b/langs/language.go
@@ -21,10 +21,10 @@ import (
"github.com/pkg/errors"
- translators "github.com/gohugoio/localescompressed"
- "github.com/gohugoio/locales"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/config"
+ "github.com/gohugoio/locales"
+ translators "github.com/gohugoio/localescompressed"
)
// These are the settings that should only be looked up in the global Viper
@@ -70,7 +70,7 @@ type Language struct {
// These are params declared in the [params] section of the language merged with the
// site's params, the most specific (language) wins on duplicate keys.
- params map[string]interface{}
+ params map[string]any
paramsMu sync.Mutex
paramsSet bool
@@ -93,7 +93,7 @@ func (l *Language) String() string {
func NewLanguage(lang string, cfg config.Provider) *Language {
// Note that language specific params will be overridden later.
// We should improve that, but we need to make a copy:
- params := make(map[string]interface{})
+ params := make(map[string]any)
for k, v := range cfg.GetStringMap("params") {
params[k] = v
}
@@ -212,7 +212,7 @@ func (l Languages) IsMultihost() bool {
// SetParam sets a param with the given key and value.
// SetParam is case-insensitive.
-func (l *Language) SetParam(k string, v interface{}) {
+func (l *Language) SetParam(k string, v any) {
l.paramsMu.Lock()
defer l.paramsMu.Unlock()
if l.paramsSet {
@@ -224,7 +224,7 @@ func (l *Language) SetParam(k string, v interface{}) {
// GetLocal gets a configuration value set on language level. It will
// not fall back to any global value.
// It will return nil if a value with the given key cannot be found.
-func (l *Language) GetLocal(key string) interface{} {
+func (l *Language) GetLocal(key string) any {
if l == nil {
panic("language not set")
}
@@ -235,7 +235,7 @@ func (l *Language) GetLocal(key string) interface{} {
return nil
}
-func (l *Language) Set(k string, v interface{}) {
+func (l *Language) Set(k string, v any) {
k = strings.ToLower(k)
if globalOnlySettings[k] {
return
@@ -244,7 +244,7 @@ func (l *Language) Set(k string, v interface{}) {
}
// Merge is currently not supported for Language.
-func (l *Language) Merge(key string, value interface{}) {
+func (l *Language) Merge(key string, value any) {
panic("Not supported")
}