feat: translation middleware
This commit is contained in:
@@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user