Microsoft Translator Go samples (v3)
This repository includes Go code samples for Microsoft Translator. Each sample corresponds to a Quickstart activity on doc.microsoft.com, including:
- Translating text
- Transliterating text
- Identifying the language of source text
- Getting alternate translations
- Getting a complete list of supported languages
- Determining sentence length
- You'll need to install the Go distribution in order to run this code. The sample code uses only core libraries, so there are no external dependencies.
- An Azure subscription - Sign-up for a free account!
- A Translator resource - Create a Translator resource
The code in this repository contains examples for all of the Microsoft Text Translator V3 API methods. Each file demonstrates a single method. To try out a method:
- Create a new Go project in your favorite code editor.
- Add the code provided below.
- Replace the
subscriptionKeyvalue with an access key valid for your subscription.
- Save the file with a '.go' extension.
- Open a command prompt on a computer with Go installed.
- Build the file, for example: 'go build example-code.go'.
- Run the file, for example: 'example-code'.