Official agent skill

Azure AI Translation Text Py

by microsoft in microsoft/skills

Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup.

OfficialMITAuto-check passedWriting & Content

Install Azure AI Translation Text Py

skills CLI
$ npx skills add microsoft/skills --skill azure-ai-translation-text-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills azure-ai-translation-text-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/azure-ai-translation-text-py .claude/skills/azure-ai-translation-text-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
azure-ai-translation-text-py
GitHub stars
3.1k
Token cost
~2.7k tokens
SKILL.md length
465 words
Files
3 (incl. references)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup.

  • Works in 9 steps: Pick sync OR async and stay consistent.… → Always use context managers for clients… → Batch translations — Send multiple texts… → …
  • Translating text content in applications
  • SKILL.md covers Installation, Environment Variables, Authentication & Lifecycle and Basic Translation, plus 13 more sections
  • Calls pip; reaches api.cognitive.microsofttranslator.com and learn.microsoft.com; needs AZURE_TOKEN_CREDENTIALS and AZURE_TRANSLATOR_KEY

What it does

Azure AI Translation Text Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup. Use for translating text content in applications. Triggers: "text translation", "translator", "translate text", "transliterate", "TextTranslationClient".

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/capabilities.md` and `references/non-hero-scenarios.md`).

It sits in Writing & Content, covering Translation. It works with Microsoft Azure, Azure AI Translator and Visual Studio Code. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Translating text content in applications
  • Tasks that involve Translation

Example prompts

  • “text translation”
  • “translator”
  • “translate text”
  • “/azure-ai-translation-text-py”

Requirements

  • Python 3
  • A credential in AZURE_TRANSLATOR_KEY

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose…
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with…
  3. Batch translations — Send multiple texts in one request (up to 100)
  4. Specify source language when known to improve accuracy
  5. Use async client for high-throughput scenarios
  6. Cache language list — Supported languages don't change frequently
  7. Handle profanity appropriately for your application
  8. Use html text_type when translating HTML content
  9. Include alignment for applications needing word mapping

What it can do on your machine

Read from SKILL.md and the folder at commit d5741a1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.cognitive.microsofttranslator.com
    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AZURE_TOKEN_CREDENTIALS
    • AZURE_TRANSLATOR_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Azure AI Translation Text Py loads about 2.7k tokens when it runs, and up to ~4.4k if it reads all its reference files. Until then it costs about 76 tokens; SKILL.md has 465 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit d5741a1, republished under its MIT licence (© microsoft). 465 words, ~2,718 tokens.

Download SKILL.mdSave it as .claude/skills/azure-ai-translation-text-py/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
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. Triggers: "text translation", "translator", "translate text", "transliterate", "TextTranslationClient".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
azure-ai-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

bash
pip install azure-ai-translation-text

Environment Variables

bash
AZURE_TRANSLATOR_ENDPOINT=https://<resource>.cognitiveservices.azure.com  # Required for Entra ID auth (must be a custom subdomain endpoint)
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production
# Only required for the legacy API-key auth path below:
AZURE_TRANSLATOR_KEY=<your-api-key>
AZURE_TRANSLATOR_REGION=<your-region>  # e.g., eastus, westus2; required when authenticating with a key against the global endpoint

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Prefer DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:
    • Sync: with <Client>(...) as client:
    • Async: async with <Client>(...) as client: and async with DefaultAzureCredential() as credential: (from azure.identity.aio)

Snippets may abbreviate this setup, but production code should always follow both rules.

python
import os
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential
from azure.ai.translation.text import TextTranslationClient

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()

with TextTranslationClient(
    endpoint=os.environ["AZURE_TRANSLATOR_ENDPOINT"],
    credential=credential,
) as client:
    result = client.translate(body=["Hello, world!"], to=["es"])
Legacy: API Key (existing keyed deployments)

New code should use DefaultAzureCredential above. The Translator service has two specifics that make API-key auth still common in existing deployments:

  • Token-credential auth requires a custom subdomain endpoint (https://<resource>.cognitiveservices.azure.com). If you only have the global endpoint (https://api.cognitive.microsofttranslator.com), you must either provision a custom subdomain or stay on the key-based path until you do.
  • Key + region is the canonical setup against the global endpoint. The region is sent as the Ocp-Apim-Subscription-Region header and is required whenever you use a multi-service or global Translator key.
python
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.translation.text import TextTranslationClient

# Key + region against the global endpoint (most common keyed setup)
with TextTranslationClient(
    credential=AzureKeyCredential(os.environ["AZURE_TRANSLATOR_KEY"]),
    region=os.environ["AZURE_TRANSLATOR_REGION"],
) as client:
    result = client.translate(body=["Hello, world!"], to=["es"])

# Key against a custom subdomain endpoint (no region required)
with TextTranslationClient(
    endpoint=os.environ["AZURE_TRANSLATOR_ENDPOINT"],
    credential=AzureKeyCredential(os.environ["AZURE_TRANSLATOR_KEY"]),
) as client:
    result = client.translate(body=["Hello, world!"], to=["es"])

Basic Translation

python
# Translate to a single language
result = client.translate(
    body=["Hello, how are you?", "Welcome to Azure!"],
    to=["es"]  # Spanish
)

for item in result:
    for translation in item.translations:
        print(f"Translated: {translation.text}")
        print(f"Target language: {translation.to}")

Translate to Multiple Languages

python
result = client.translate(
    body=["Hello, world!"],
    to=["es", "fr", "de", "ja"]  # Spanish, French, German, Japanese
)

for item in result:
    print(f"Source: {item.detected_language.language if item.detected_language else 'unknown'}")
    for translation in item.translations:
        print(f"  {translation.to}: {translation.text}")

Specify Source Language

python
result = client.translate(
    body=["Bonjour le monde"],
    from_parameter="fr",  # Source is French
    to=["en", "es"]
)

Language Detection

python
result = client.translate(
    body=["Hola, como estas?"],
    to=["en"]
)

for item in result:
    if item.detected_language:
        print(f"Detected language: {item.detected_language.language}")
        print(f"Confidence: {item.detected_language.score:.2f}")

Transliteration

Convert text from one script to another:

python
result = client.transliterate(
    body=["konnichiwa"],
    language="ja",
    from_script="Latn",  # From Latin script
    to_script="Jpan"      # To Japanese script
)

for item in result:
    print(f"Transliterated: {item.text}")
    print(f"Script: {item.script}")

Dictionary Lookup

Find alternate translations and definitions:

python
result = client.lookup_dictionary_entries(
    body=["fly"],
    from_parameter="en",
    to="es"
)

for item in result:
    print(f"Source: {item.normalized_source} ({item.display_source})")
    for translation in item.translations:
        print(f"  Translation: {translation.normalized_target}")
        print(f"  Part of speech: {translation.pos_tag}")
        print(f"  Confidence: {translation.confidence:.2f}")

Dictionary Examples

Get usage examples for translations:

python
from azure.ai.translation.text.models import DictionaryExampleTextItem

result = client.lookup_dictionary_examples(
    body=[DictionaryExampleTextItem(text="fly", translation="volar")],
    from_parameter="en",
    to="es"
)

for item in result:
    for example in item.examples:
        print(f"Source: {example.source_prefix}{example.source_term}{example.source_suffix}")
        print(f"Target: {example.target_prefix}{example.target_term}{example.target_suffix}")

Get Supported Languages

python
# Get all supported languages
languages = client.get_supported_languages()

# Translation languages
print("Translation languages:")
for code, lang in languages.translation.items():
    print(f"  {code}: {lang.name} ({lang.native_name})")

# Transliteration languages
print("\nTransliteration languages:")
for code, lang in languages.transliteration.items():
    print(f"  {code}: {lang.name}")
    for script in lang.scripts:
        print(f"    {script.code} -> {[t.code for t in script.to_scripts]}")

# Dictionary languages
print("\nDictionary languages:")
for code, lang in languages.dictionary.items():
    print(f"  {code}: {lang.name}")

Break Sentence

Identify sentence boundaries:

python
result = client.find_sentence_boundaries(
    body=["Hello! How are you? I hope you are well."],
    language="en"
)

for item in result:
    print(f"Sentence lengths: {item.sent_len}")

Translation Options

python
result = client.translate(
    body=["Hello, world!"],
    to=["de"],
    text_type="html",           # "plain" or "html"
    profanity_action="Marked",  # "NoAction", "Deleted", "Marked"
    profanity_marker="Asterisk", # "Asterisk", "Tag"
    include_alignment=True,      # Include word alignment
    include_sentence_length=True # Include sentence boundaries
)

for item in result:
    translation = item.translations[0]
    print(f"Translated: {translation.text}")
    if translation.alignment:
        print(f"Alignment: {translation.alignment.proj}")
    if translation.sent_len:
        print(f"Sentence lengths: {translation.sent_len.src_sent_len}")

Async Client

python
from azure.ai.translation.text.aio import TextTranslationClient
from azure.identity.aio import DefaultAzureCredential

async def translate_text():
    async with DefaultAzureCredential() as credential:
        async with TextTranslationClient(
            credential=credential,
            endpoint=endpoint,
        ) as client:
            result = await client.translate(
                body=["Hello, world!"],
                to=["es"]
            )
            print(result[0].translations[0].text)
Show full SKILL.md (192 more words)Show less

Client Methods

MethodDescription
translateTranslate text to one or more languages
transliterateConvert text between scripts
detectDetect language of text
find_sentence_boundariesIdentify sentence boundaries
lookup_dictionary_entriesDictionary lookup for translations
lookup_dictionary_examplesGet usage examples
get_supported_languagesList supported languages

Best Practices

  1. Pick sync OR async and stay consistent. Do not mix azure.xxx sync clients with azure.xxx.aio async clients in the same call path. Choose one mode per module.
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with Client(...) as client: (async). For async DefaultAzureCredential from azure.identity.aio, also use async with credential: so tokens and transports are cleaned up.
  3. Batch translations — Send multiple texts in one request (up to 100)
  4. Specify source language when known to improve accuracy
  5. Use async client for high-throughput scenarios
  6. Cache language list — Supported languages don't change frequently
  7. Handle profanity appropriately for your application
  8. Use html text_type when translating HTML content
  9. Include alignment for applications needing word mapping

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.
references/non-hero-scenarios.mdDedicated non-hero examples for secondary/advanced scenarios.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .github/plugins/azure-sdk-python/skills/azure-ai-translation-text-py of microsoft/skills.

  • SKILL.md
  • references/capabilities.md
  • references/non-hero-scenarios.md

Open the folder on GitHubat commit d5741a1

Compare with similar skills

Azure AI Translation Text Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Azure AI Translation Text Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Azure AI Translation Text Py this skillmicrosoft/skills3.1k—~2.7kAutomated safety check: PassMIT
Azure AI Translation Text Pyaiskillstore/marketplace4334 repos~1.9kAutomated safety check: PassNone
Azure Immersive ReaderMicrosoftDocs/Agent-Skills776—~1.4kAutomated safety check: PassCC-BY-4.0
Azure TranslatorMicrosoftDocs/Agent-Skills776—~4.4kAutomated safety check: PassCC-BY-4.0
Roo Translationzgsm-ai/costrict4.5k—~1.8kAutomated safety check: PassApache-2.0
Azure AI Translation TSaiskillstore/marketplace4334 repos~1.9kAutomated safety check: PassNone

Similar skills

  • Azure AI Translation Text Py

    aiskillstore/marketplace

    Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup.

    433 GitHub starsUsed in 4 repos~1.9k tokens
    Writing & ContentAuto-check passed
  • Azure Immersive Reader

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure AI Immersive Reader development including best practices, limits & quotas, security, configuration, and integrations & coding patterns.

    776 GitHub stars~1.4k tokensUpdated 5 days ago
    Writing & ContentAuto-check passed
  • Azure Translator

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Translator development including troubleshooting, best practices, decision making, limits & quotas, security, configuration, integrations & coding patterns, and deployment.

    776 GitHub stars~4.4k tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed
  • Roo Translation

    zgsm-ai/costrict

    Provides comprehensive guidelines for translating and localizing CoStrict extension strings.

    4.5k GitHub stars~1.8k tokensUpdated 11 days ago
    Writing & ContentAuto-check passed
  • Azure AI Translation TS

    aiskillstore/marketplace

    Text and document translation with REST-style clients. An agent skill from aiskillstore/marketplace.

    433 GitHub starsUsed in 4 repos~1.9k tokens
    Writing & ContentAuto-check passed
  • Oraclecloud Migration Deep Dive

    jeremylongshore/tons-of-skills-marketplace

    Migrate workloads from AWS or Azure to OCI — IAM translation, networking mapping, compute image import, and data migration.

    2.8k GitHub stars~3k tokensUpdated yesterday
    Writing & ContentAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Official

    Builds podcast-style audio narration from text with Azure OpenAI's GPT Realtime Mini over WebSocket, from a Python FastAPI backend to a React player.

    3.1k GitHub starsUsed in 1 repo~947 tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 5 repos~496 tokens
    Auto-check passed
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub stars~2.8k tokensUpdated 2 days ago
    Auto-check passed
  • Skill Creator

    microsoft/skills

    Official

    Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services.

    3.1k GitHub starsUsed in 5 repos~17k tokens
    Auto-check passed

Questions about Azure AI Translation Text Py

What does Azure AI Translation Text Py do?

Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup. Azure AI Translation Text Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Azure AI Text Translation SDK for real-time text translation, transliteration, language detection, and dictionary lookup.

When should I use Azure AI Translation Text Py?

Azure AI Translation Text Py fits situations like: translating text content in applications; tasks that involve Translation.

How do I install Azure AI Translation Text Py in Claude Code?

Run `npx skills add microsoft/skills --skill azure-ai-translation-text-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-ai-translation-text-py in microsoft/skills) into .claude/skills/azure-ai-translation-text-py in your project. Claude Code loads it when a task matches its description.

How do I install Azure AI Translation Text Py in Codex?

Run `npx skills add microsoft/skills --skill azure-ai-translation-text-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/azure-ai-translation-text-py in microsoft/skills) into .agents/skills/azure-ai-translation-text-py in your project. Codex loads it when a task matches its description.

Can I use Azure AI Translation Text Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill azure-ai-translation-text-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/azure-ai-translation-text-py, .gemini/skills/azure-ai-translation-text-py, .github/skills/azure-ai-translation-text-py and .opencode/skills/azure-ai-translation-text-py in your project.

What does Azure AI Translation Text Py need to run?

Going by SKILL.md and its folder, Azure AI Translation Text Py needs the command-line tools its instructions call (pip) and credentials named AZURE_TOKEN_CREDENTIALS and AZURE_TRANSLATOR_KEY. Our summary lists: Python 3; A credential in AZURE_TRANSLATOR_KEY.

Does Azure AI Translation Text Py access the network?

SKILL.md names 2 domains. In commands or code: api.cognitive.microsofttranslator.com and learn.microsoft.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Azure AI Translation Text Py safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Azure AI Translation Text Py use?

Azure AI Translation Text Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Azure AI Translation Text Py use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.7k tokens, read only when the agent opens those files.

What are the alternatives to Azure AI Translation Text Py?

Skills that share tags, products or a category with Azure AI Translation Text Py: Azure AI Translation Text Py (aiskillstore/marketplace, 433 stars), Azure Immersive Reader (MicrosoftDocs/Agent-Skills, 776 stars), Azure Translator (MicrosoftDocs/Agent-Skills, 776 stars) and Roo Translation (zgsm-ai/costrict, 4.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Azure AI Translation Text Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,097 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 9, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.