diff --git a/pages/index.go b/pages/index.go index 7bacf54..e47b4b2 100644 --- a/pages/index.go +++ b/pages/index.go @@ -95,7 +95,7 @@ func HandleIndex(c *fiber.Ctx) error { defaultLang := os.Getenv("MOZHI_DEFAULT_SOURCE_LANG") preferAutoDetect := os.Getenv("MOZHI_DEFAULT_PREFER_AUTODETECT") defaultLangTarget := os.Getenv("MOZHI_DEFAULT_TARGET_LANG") - if defaultLang == "" || preferAutoDetect == "true" { + if defaultLang == "" || (preferAutoDetect == "true" && sourceLanguages[0].Id == "auto") { defaultLang = "auto" } if defaultLangTarget == "" { diff --git a/views/index.html b/views/index.html index 05dc39c..cc68bf2 100644 --- a/views/index.html +++ b/views/index.html @@ -21,11 +21,11 @@