Documentation
¶
Index ¶
- func ExtractLanguageFromGrpcRequest(ctx context.Context) []string
- func ExtractLanguageFromHTTPHeader(req http.Header) []string
- func ExtractLanguageFromHTTPRequest(req *http.Request) []string
- func FromContext(ctx context.Context) []string
- func FromMap(m map[string]string) []string
- func ToContext(ctx context.Context, lang []string) context.Context
- func ToMap(m map[string]string, lang []string) map[string]string
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext extracts language from the supplied context if any exist.
Types ¶
type Manager ¶
type Manager interface {
Bundle() *i18n.Bundle
Translate(ctx context.Context, request any, messageID string) string
TranslateWithMap(
ctx context.Context,
request any,
messageID string,
variables map[string]any,
) string
TranslateWithMapAndCount(
ctx context.Context,
request any,
messageID string,
variables map[string]any,
count int,
) string
}
func NewManager ¶
NewManager Option to initialize/loadOIDC different language packs.
Click to show internal directories.
Click to hide internal directories.