Documentation ¶
Index ¶
- Constants
- func DetectUrl() *url.URL
- func LanguagesUrl(scopes ...string) *url.URL
- func NewTranslator(hc *http.Client, key string) (polyglot.Translator, error)
- func TranslateUrl(from, to string, format polyglot.TranslateFormat) *url.URL
- type DetectResponse
- type TextData
- type Translation
- type TranslationLanguage
- type TranslationLanguagesResponse
- type TranslationsResponse
- type Translator
- func (t *Translator) Detect(content string) (string, error)
- func (t *Translator) IsHTMLSupported() bool
- func (t *Translator) Languages(language string) (map[string]string, error)
- func (t *Translator) Translate(source, target string, format polyglot.TranslateFormat, query ...string) ([]string, error)
Constants ¶
View Source
const ( TranslationScope = "translation" TransliterationScope = "transliteration" DictionaryScope = "dictionary" )
Variables ¶
This section is empty.
Functions ¶
func LanguagesUrl ¶
func NewTranslator ¶
func TranslateUrl ¶
func TranslateUrl(from, to string, format polyglot.TranslateFormat) *url.URL
Types ¶
type DetectResponse ¶
type Translation ¶
type TranslationLanguage ¶
type TranslationLanguagesResponse ¶
type TranslationLanguagesResponse struct {
Translation map[string]TranslationLanguage `json:"translation"`
}
func TranslationLanguages ¶
func TranslationLanguages(hc *http.Client, acceptLanguage string) (*TranslationLanguagesResponse, error)
type TranslationsResponse ¶
type TranslationsResponse struct {
Translations []Translation `json:"translations"`
}
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
func (*Translator) IsHTMLSupported ¶
func (t *Translator) IsHTMLSupported() bool
func (*Translator) Languages ¶
func (t *Translator) Languages(language string) (map[string]string, error)
func (*Translator) Translate ¶
func (t *Translator) Translate(source, target string, format polyglot.TranslateFormat, query ...string) ([]string, error)
Click to show internal directories.
Click to hide internal directories.