feat: translation middleware

This commit is contained in:
2026-03-02 22:37:11 +01:00
parent dd5e32cc4d
commit 9a1f7e0d99
35 changed files with 1467 additions and 83 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",
},
},
}
}