feat: translation middleware

This commit is contained in:
2026-02-19 21:13:01 +01:00
parent bbae5b1c93
commit cbc2a1a803
35 changed files with 1500 additions and 82 deletions
+22
View File
@@ -0,0 +1,22 @@
package translate
type Translations map[string]string // key -> translation
type Service struct {
translations map[string]Translations // language -> translations
defaultLanguage string
}
func New() *Service {
return &Service{
defaultLanguage: "de",
translations: map[string]Translations{
"de": {
"home": "Startseite",
},
"en": {
"home": "Home",
},
},
}
}