Documentation ¶
Index ¶
- type TranslationService
- func (ts *TranslationService) AllTranslationKeys(localeCode string) []string
- func (ts *TranslationService) Inject(logger flamingo.Logger, config ...)
- func (ts *TranslationService) Translate(key string, defaultLabel string, localeCode string, count int, ...) string
- func (ts *TranslationService) TranslateLabel(label domain.Label) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TranslationService ¶
type TranslationService struct {
// contains filtered or unexported fields
}
TranslationService is the default TranslationService implementation
func (*TranslationService) AllTranslationKeys ¶ added in v3.1.0
func (ts *TranslationService) AllTranslationKeys(localeCode string) []string
AllTranslationKeys returns all keys for a given locale code
func (*TranslationService) Inject ¶
func (ts *TranslationService) Inject( logger flamingo.Logger, config *struct { DevMode bool `inject:"config:flamingo.debug.mode"` TranslationFile string `inject:"config:core.locale.translationFile,optional"` TranslationFiles config.Slice `inject:"config:core.locale.translationFiles,optional"` }, )
Inject dependencies
func (*TranslationService) Translate ¶
func (ts *TranslationService) Translate(key string, defaultLabel string, localeCode string, count int, translationArguments map[string]interface{}) string
Translate returns the result for translating a key, with a default label for a given locale code
func (*TranslationService) TranslateLabel ¶
func (ts *TranslationService) TranslateLabel(label domain.Label) string
TranslateLabel returns the result for translating a Label
Click to show internal directories.
Click to hide internal directories.