{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/azure-ai-translation-text-py",
  "version": "1.0.1",
  "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.\nTriggers: \"text translation\", \"translator\", \"translate text\", \"transliterate\", \"TextTranslationClient\".",
  "system_prompt_fragment": "# Azure AI Text Translation SDK for Python\n\nClient library for Azure AI Translator text translation service for real-time text translation, transliteration, and language operations.\n\n## Installation\n\n```bash\npip install azure-ai-translation-text\n```\n\n## Environment Variables\n\n```bash\nAZURE_TRANSLATOR_KEY=<your-api-key>\nAZURE_TRANSLATOR_REGION=<your-region>  # e.g., eastus, westus2\n# Or use custom endpoint\nAZURE_TRANSLATOR_ENDPOINT=https://<resource>.cognitiveservices.azure.com\n```\n\n## Authentication\n\n### API Key with Region\n\n```python\nimport os\nfrom azure.ai.translation.text import TextTranslationClient\nfrom azure.core.credentials import AzureKeyCredential\n\nkey = os.environ[\"AZURE_TRANSLATOR_KEY\"]\nregion = os.environ[\"AZURE_TRANSLATOR_REGION\"]\n\n# Create credential with region\ncredential = AzureKeyCredential(key)\nclient = TextTranslationClient(credential=credential, region=region)\n```\n\n### API Key with Custom Endpoint\n\n```python\nendpoint = os.environ[\"AZURE_TRANSLATOR_ENDPOINT\"]\n\nclient = TextTranslationClient(\n    credential=AzureKeyCredential(key),\n    endpoint=endpoint\n)\n```\n\n### Entra ID (Recommended)\n\n```python\nfrom azure.ai.translation.text import TextTranslationClient\nfrom azure.identity import DefaultAzureCredential\n\nclient = TextTranslationClient(\n    credential=DefaultAzureCredential(),\n    endpoint=os.environ[\"AZURE_TRANSLATOR_ENDPOINT\"]\n)\n```\n\n## Basic Translation\n\n```python\n# Translate to a single language\nresult = client.translate(\n    body=[\"Hello, how are you?\", \"Welcome to Azure!\"],\n    to=[\"es\"]  # Spanish\n)\n\nfor item in result:\n    for translation in item.translations:\n        print(f\"Translated: {translation.text}\")\n        print(f\"Target language: {translation.to}\")\n```\n\n## Translate to Multiple Languages\n\n```python\nresult = client.translate(\n    body=[\"Hello, world!\"],\n    to=[\"es\", \"fr\", \"de\", \"ja\"]  # Spanish, French, German, Japanese\n)\n\nfor item in result:\n    print(f\"Source: {item.detected_language.language if item.detected_language else 'unknown'}\")\n    for translation in item.translations:\n        print(f\"  {translation.to}: {translation.text}\")\n```\n\n## Specify Source Language\n\n```python\nresult = client.translate(\n    body=[\"Bonjour le monde\"],\n    from_parameter=\"fr\",  # Source is French\n    to=[\"en\", \"es\"]\n)\n```\n\n## Language Detection\n\n```python\nresult = client.translate(\n    body=[\"Hola, como estas?\"],\n    to=[\"en\"]\n)\n\nfor item in result:\n    if item.detected_language:\n        print(f\"Detected language: {item.detected_language.language}\")\n        print(f\"Confidence: {item.detected_language.score:.2f}\")\n```\n\n## Transliteration\n\nConvert text from one script to another:\n\n```python\nresult = client.transliterate(\n    body=[\"konnichiwa\"],\n    language=\"ja\",\n    from_script=\"Latn\",  # From Latin script\n    to_script=\"Jpan\"      # To Japanese script\n)\n\nfor item in result:\n    print(f\"Transliterated: {item.text}\")\n    print(f\"Script: {item.script}\")\n```\n\n## Dictionary Lookup\n\nFind alternate translations and definitions:\n\n```python\nresult = client.lookup_dictionary_entries(\n    body=[\"fly\"],\n    from_parameter=\"en\",\n    to=\"es\"\n)\n\nfor item in result:\n    print(f\"Source: {item.normalized_source} ({item.display_source})\")\n    for translation in item.translations:\n        print(f\"  Translation: {translation.normalized_target}\")\n        print(f\"  Part of speech: {translation.pos_tag}\")\n        print(f\"  Confidence: {translation.confidence:.2f}\")\n```\n\n## Dictionary Examples\n\nGet usage examples for translations:\n\n```python\nfrom azure.ai.translation.text.models import DictionaryExampleTextItem\n\nresult = client.lookup_dictionary_examples(\n    body=[DictionaryExampleTextItem(text=\"fly\", translation=\"volar\")],\n    from_parameter=\"en\",\n    to=\"es\"\n)\n\nfor item in result:\n    for example in item.examples:\n        print(f\"Source: {example.source_prefix}{example.source_term}{example.source_suffix}\")\n        print(f\"Target: {example.target_prefix}{example.target_term}{example.target_suffix}\")\n```\n\n## Get Supported Languages\n\n```python\n# Get all supported languages\nlanguages = client.get_supported_languages()\n\n# Translation languages\nprint(\"Translation languages:\")\nfor code, lang in languages.translation.items():\n    print(f\"  {code}: {lang.name} ({lang.native_name})\")\n\n# Transliteration languages\nprint(\"\\nTransliteration languages:\")\nfor code, lang in languages.transliteration.items():\n    print(f\"  {code}: {lang.name}\")\n    for script in lang.scripts:\n        print(f\"    {script.code} -> {[t.code for t in script.to_scripts]}\")\n\n# Dictionary languages\nprint(\"\\nDictionary languages:\")\nfor code, lang in languages.dictionary.items():\n    print(f\"  {code}: {lang.name}\")\n```\n\n## Break Sentence\n\nIdentify sentence boundaries:\n\n```python\nresult = client.find_sentence_boundaries(\n    body=[\"Hello! How are you? I hope you are well.\"],\n    language=\"en\"\n)\n\nfor item in result:\n    print(f\"Sentence lengths: {item.sent_len}\")\n```\n\n## Translation Options\n\n```python\nresult = client.translate(\n    body=[\"Hello, world!\"],\n    to=[\"de\"],\n    text_type=\"html\",           # \"plain\" or \"html\"\n    profanity_action=\"Marked\",  # \"NoAction\", \"Deleted\", \"Marked\"\n    profanity_marker=\"Asterisk\", # \"Asterisk\", \"Tag\"\n    include_alignment=True,      # Include word alignment\n    include_sentence_length=True # Include sentence boundaries\n)\n\nfor item in result:\n    translation = item.translations[0]\n    print(f\"Translated: {translation.text}\")\n    if translation.alignment:\n        print(f\"Alignment: {translation.alignment.proj}\")\n    if translation.sent_len:\n        print(f\"Sentence lengths: {translation.sent_len.src_sent_len}\")\n```\n\n## Async Client\n\n```python\nfrom azure.ai.translation.text.aio import TextTranslationClient\nfrom azure.core.credentials import AzureKeyCredential\n\nasync def translate_text():\n    async with TextTranslationClient(\n        credential=AzureKeyCredential(key),\n        region=region\n    ) as client:\n        result = await client.translate(\n            body=[\"Hello, world!\"],\n            to=[\"es\"]\n        )\n        print(result[0].translations[0].text)\n```\n\n## Client Methods\n\n| Method | Description |\n|--------|-------------|\n| `translate` | Translate text to one or more languages |\n| `transliterate` | Convert text between scripts |\n| `detect` | Detect language of text |\n| `find_sentence_boundaries` | Identify sentence boundaries |\n| `lookup_dictionary_entries` | Dictionary lookup for translations |\n| `lookup_dictionary_examples` | Get usage examples |\n| `get_supported_languages` | List supported languages |\n\n## Best Practices\n\n1. **Batch translations** — Send multiple texts in one request (up to 100)\n2. **Specify source language** when known to improve accuracy\n3. **Use async client** for high-throughput scenarios\n4. **Cache language list** — Supported languages don't change frequently\n5. **Handle profanity** appropriately for your application\n6. **Use html text_type** when translating HTML content\n7. **Include alignment** for applications needing word mapping\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.",
  "applicable_domains": [
    "devops"
  ],
  "category": "devops",
  "invocation": [
    "/azure-ai-translation-text-py"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/azure-ai-translation-text-py",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/azure-ai-translation-text-py",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists."
  },
  "tags": [
    "claudeskills",
    "devops"
  ],
  "lifecycle": "draft"
}