| name | azure-ai-translation-text-py |
| description | Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup. Use for translating text content in applications. |
| type | skill |
| created | 2026-02-27T00:00:00.000Z |
| domain | ai-ml |
| category | nlp |
| risk | unknown |
| source | community |
| tags | ["skill","ai-ml","nlp","azure","translation","text"] |
Azure AI Text Translation SDK for Python
Client library for Azure AI Translator text translation service for real-time text translation, transliteration, and language operations.
Installation
pip install azure-ai-translation-text
Environment Variables
AZURE_TRANSLATOR_KEY=<your-api-key>
AZURE_TRANSLATOR_REGION=<your-region>
AZURE_TRANSLATOR_ENDPOINT=https://<resource>.cognitiveservices.azure.com
Authentication
API Key with Region
import os
from azure.ai.translation.text import TextTranslationClient
from azure.core.credentials import AzureKeyCredential
key = os.environ["AZURE_TRANSLATOR_KEY"]
region = os.environ["AZURE_TRANSLATOR_REGION"]
credential = AzureKeyCredential(key)
client = TextTranslationClient(credential=credential, region=region)
API Key with Custom Endpoint
endpoint = os.environ["AZURE_TRANSLATOR_ENDPOINT"]
client = TextTranslationClient(
credential=AzureKeyCredential(key),
endpoint=endpoint
)
Entra ID (Recommended)
from azure.ai.translation.text import TextTranslationClient
from azure.identity import DefaultAzureCredential
client = TextTranslationClient(
credential=DefaultAzureCredential(),
endpoint=os.environ["AZURE_TRANSLATOR_ENDPOINT"]
)
Basic Translation
result = client.translate(
body=["Hello, how are you?", "Welcome to Azure!"],
to=["es"]
)
for item in result:
for translation in item.translations:
()
()