feat(template): First templates

This commit is contained in:
2024-12-03 15:04:10 +01:00
parent ba7e02fa30
commit 3eb914d640
6 changed files with 420 additions and 1 deletions

37
templates/templates.go Normal file
View File

@@ -0,0 +1,37 @@
package templates
import (
_ "embed"
)
//go:embed card/en.html
var CardTemplateEn string
//go:embed card/de.html
var CardTemplateDe string
//go:embed contract/en.html
var ContractTemplateEn string
//go:embed contract/de.html
var ContractTemplateDe string
func GetTemplate(locale, template string) string {
switch template {
case "card":
switch locale {
case "en":
return CardTemplateEn
case "de":
return CardTemplateDe
}
case "contract":
switch locale {
case "en":
return ContractTemplateEn
case "de":
return ContractTemplateDe
}
}
return ""
}