infrastructure

package
v3.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL