Documentation
¶
Index ¶
- func GetLanguageFromContext(ctx context.Context) string
- func LanguageMiddleware() gin.HandlerFunc
- func SetLanguage(lang string) error
- func T(key string) string
- func TFromContext(ctx context.Context, key string) string
- func TWithData(key string, data map[string]string) string
- func TWithDataFromContext(ctx context.Context, key string, data map[string]string) string
- type Localizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLanguageFromContext ¶
GetLanguageFromContext extracts the language from the request context
func LanguageMiddleware ¶
func LanguageMiddleware() gin.HandlerFunc
LanguageMiddleware detects the user's language preference and sets it in context
func TFromContext ¶
TFromContext translates a key using the language from context
Types ¶
Click to show internal directories.
Click to hide internal directories.