diff options
Diffstat (limited to 'hugolib/multilingual.go')
-rw-r--r-- | hugolib/multilingual.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/hugolib/multilingual.go b/hugolib/multilingual.go index c09e3667e..6f744f3a5 100644 --- a/hugolib/multilingual.go +++ b/hugolib/multilingual.go @@ -1,4 +1,4 @@ -// Copyright 2016-present The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -62,10 +62,10 @@ func newMultiLingualFromSites(cfg config.Provider, sites ...*Site) (*Multilingua languages := make(langs.Languages, len(sites)) for i, s := range sites { - if s.Language == nil { - return nil, errors.New("Missing language for site") + if s.language == nil { + return nil, errors.New("missing language for site") } - languages[i] = s.Language + languages[i] = s.language } defaultLang := cfg.GetString("defaultContentLanguage") @@ -78,19 +78,15 @@ func newMultiLingualFromSites(cfg config.Provider, sites ...*Site) (*Multilingua } -func newMultiLingualForLanguage(language *langs.Language) *Multilingual { - languages := langs.Languages{language} - return &Multilingual{Languages: languages, DefaultLang: language} -} func (ml *Multilingual) enabled() bool { return len(ml.Languages) > 1 } func (s *Site) multilingualEnabled() bool { - if s.owner == nil { + if s.h == nil { return false } - return s.owner.multilingual != nil && s.owner.multilingual.enabled() + return s.h.multilingual != nil && s.h.multilingual.enabled() } func toSortedLanguages(cfg config.Provider, l map[string]interface{}) (langs.Languages, error) { |