Documentation
¶
Overview ¶
Package translation provides AWS Translate integration with caching for multilingual content support.
Index ¶
- type LanguageInfo
- type Service
- func (s *Service) DetectLanguage(ctx context.Context, text string) (string, float32, error)
- func (s *Service) GetSupportedLanguages(ctx context.Context) ([]LanguageInfo, error)
- func (s *Service) TranslateHTML(ctx context.Context, html, sourceLang, targetLang string) (string, string, error)
- func (s *Service) TranslateText(ctx context.Context, text, sourceLang, targetLang string) (string, string, error)
- type TranslationCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LanguageInfo ¶
LanguageInfo contains information about a language
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides translation functionality using AWS Translate
func NewService ¶
func NewService(ctx context.Context, cfg *lesserconfig.Config, store storagecore.RepositoryStorage, logger *zap.Logger, cacheEnabled bool) (*Service, error)
NewService creates a new translation service.
func (*Service) DetectLanguage ¶
DetectLanguage detects the language of the given text
func (*Service) GetSupportedLanguages ¶
func (s *Service) GetSupportedLanguages(ctx context.Context) ([]LanguageInfo, error)
GetSupportedLanguages returns the list of supported language pairs
Click to show internal directories.
Click to hide internal directories.