Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunI18nContract ¶
func RunI18nContract(t *testing.T, subject I18nContractSubject)
RunI18nContract executes shared i18n contract checks for adapter implementations.
Types ¶
type I18nContractAdapter ¶
type I18nContractAdapter interface {
DefaultLanguage() string
SupportedLanguages() []string
NormalizeLanguage(raw string) string
T(ctx context.Context, key string, templateData ...map[string]any) string
TC(ctx context.Context, key string, count any, templateData ...map[string]any) string
TS(ctx context.Context, key string, choice string, templateData ...map[string]any) string
}
I18nContractAdapter is the minimal adapter surface required by core i18n consumers.
type I18nContractSubject ¶
type I18nContractSubject struct {
Name string
Build func(t *testing.T) I18nContractAdapter
KnownDefaultKey string
KnownDefaultResult string
}
I18nContractSubject describes one adapter implementation to validate.
Click to show internal directories.
Click to hide internal directories.