Fix defaultContentLanguageInSubdir with only 1 language

Fixes #10064
This commit is contained in:
Bjørn Erik Pedersen
2023-07-07 18:41:10 +02:00
parent 6c9ea022a9
commit 92e86702ea
12 changed files with 154 additions and 101 deletions

View File

@@ -470,16 +470,11 @@ func (s *Site) IsMultiLingual() bool {
}
func (s *Site) LanguagePrefix() string {
conf := s.s.Conf
if !conf.IsMultiLingual() {
prefix := s.GetLanguagePrefix()
if prefix == "" {
return ""
}
if !conf.DefaultContentLanguageInSubdir() && s.language.Lang == conf.DefaultContentLanguage() {
return ""
}
return "/" + s.language.Lang
return "/" + prefix
}
// Returns the identity of this site.