Documentation ¶
Index ¶
- type DeeplTranslator
- type MultiLangString
- func (m *MultiLangString) Get(lang language.Tag) string
- func (m *MultiLangString) GetLanguages() []language.Tag
- func (m *MultiLangString) GetNativeLanguage() language.Tag
- func (m *MultiLangString) GetNativeLanguages() []language.Tag
- func (m *MultiLangString) GetStr(lang string) string
- func (m *MultiLangString) GetTranslatedLanguages() []language.Tag
- func (m *MultiLangString) MarshalJSON() ([]byte, error)
- func (m *MultiLangString) Remove(lang language.Tag)
- func (m *MultiLangString) Set(str string, lang language.Tag, translated bool)
- func (m *MultiLangString) SetLang(sourcetext string, lang language.Tag, b bool)
- func (m *MultiLangString) SetMultiString(strList []string) error
- func (m *MultiLangString) String() string
- func (m *MultiLangString) UnmarshalJSON(data []byte) error
- type Translator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeeplTranslator ¶
type DeeplTranslator struct {
// contains filtered or unexported fields
}
func (*DeeplTranslator) Translate ¶
func (t *DeeplTranslator) Translate(text *MultiLangString, targetLang []language.Tag) error
type MultiLangString ¶
type MultiLangString []multiLangString
func (*MultiLangString) GetLanguages ¶
func (m *MultiLangString) GetLanguages() []language.Tag
func (*MultiLangString) GetNativeLanguage ¶ added in v2.0.2
func (m *MultiLangString) GetNativeLanguage() language.Tag
func (*MultiLangString) GetNativeLanguages ¶
func (m *MultiLangString) GetNativeLanguages() []language.Tag
func (*MultiLangString) GetStr ¶ added in v2.0.5
func (m *MultiLangString) GetStr(lang string) string
func (*MultiLangString) GetTranslatedLanguages ¶
func (m *MultiLangString) GetTranslatedLanguages() []language.Tag
func (*MultiLangString) MarshalJSON ¶
func (m *MultiLangString) MarshalJSON() ([]byte, error)
func (*MultiLangString) Remove ¶
func (m *MultiLangString) Remove(lang language.Tag)
func (*MultiLangString) Set ¶
func (m *MultiLangString) Set(str string, lang language.Tag, translated bool)
func (*MultiLangString) SetLang ¶
func (m *MultiLangString) SetLang(sourcetext string, lang language.Tag, b bool)
func (*MultiLangString) SetMultiString ¶ added in v2.0.3
func (m *MultiLangString) SetMultiString(strList []string) error
func (*MultiLangString) String ¶
func (m *MultiLangString) String() string
func (*MultiLangString) UnmarshalJSON ¶
func (m *MultiLangString) UnmarshalJSON(data []byte) error
type Translator ¶
type Translator interface {
Translate(text *MultiLangString, targetLang []language.Tag) error
}
func NewDeeplTranslator ¶
func NewDeeplTranslator(deeplApiKey, deeplUrl string, badger *badger.DB, logger zLogger.ZLogger) Translator
Click to show internal directories.
Click to hide internal directories.