Fixed 'Error parsing template: template: privacy.html:27: function "translate"'
Some checks failed
Run Integration Tests / test (push) Failing after 39s

This commit is contained in:
partisan 2025-05-30 17:04:57 +02:00
parent 8e0682cb43
commit 66414952e8
3 changed files with 11 additions and 17 deletions

17
main.go
View file

@ -282,20 +282,5 @@ func handlePrivacyPage(w http.ResponseWriter, r *http.Request) {
LanguageOptions: languageOptions,
}
// Parse the template
tmpl, err := template.New("privacy.html").ParseFiles("templates/privacy.html")
if err != nil {
log.Printf("Error parsing template: %v", err)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
return
}
// Set the response content type
w.Header().Set("Content-Type", "text/html; charset=utf-8")
// Execute the template
if err := tmpl.Execute(w, data); err != nil {
log.Printf("Error executing template: %v", err)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
}
renderTemplate(w, "privacy.html", toMap(data))
}