Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTranslator ¶
func NewTranslator(subscriptionKey string) translator.Translator
NewTranslator returns a struct that implements the Translator interface by exposing a Translate and a Languages function that are backed by Microsoft's translation API. The function takes the subscriptionKey for a registered Text Translation Service. Details on how to get such a key: http://docs.microsofttranslator.com/text-translate.html.
Types ¶
type LanguageCatalog ¶
type LanguageCatalog interface {
Languages() ([]translator.Language, error)
}
The LanguageCatalog provides a slice of languages representing all languages supported by Microsoft's Translation API.
type LanguageProvider ¶
type LanguageProvider interface { Codes() ([]string, error) Names(codes []string) ([]string, error) }
The LanguageProvider retrieves the names and codes of all languages supported by Microsoft's Translation API.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.