adding locale support is a tedious task by hand but rubik has its own config management system to leverage from.
idea is:
config/locale/{langabbr}.toml can be the language specific configutaration used.
- language
struct declaration can be inside config/lang.go
- headers to pick up from can be
lang
- default language can be set from config using
lang top level field
- and a new type of transport key called
locale can be introduced to inject language specific configurations
Code:
type MyEntity struct {
Locale LocaleConfig `rubik:"|locale"`
}
adding locale support is a tedious task by hand but rubik has its own config management system to leverage from.
idea is:
config/locale/{langabbr}.tomlcan be the language specific configutaration used.structdeclaration can be insideconfig/lang.golanglangtop level fieldlocalecan be introduced to inject language specific configurationsCode: