{"id":"1d4a4d37-920a-4afa-8bed-5ae9b7f56f52","shortId":"SDxRNy","kind":"skill","title":"azure-ai-translation-ts","tagline":"Text and document translation with REST-style clients.","description":"# Azure Translation SDKs for TypeScript\n\nText and document translation with REST-style clients.\n\n## Installation\n\n```bash\n# Text translation\nnpm install @azure-rest/ai-translation-text @azure/identity\n\n# Document translation\nnpm install @azure-rest/ai-translation-document @azure/identity\n```\n\n## Environment Variables\n\n```bash\nTRANSLATOR_ENDPOINT=https://api.cognitive.microsofttranslator.com\nTRANSLATOR_SUBSCRIPTION_KEY=<your-api-key>\nTRANSLATOR_REGION=<your-region>  # e.g., westus, eastus\n```\n\n## Text Translation Client\n\n### Authentication\n\n```typescript\nimport TextTranslationClient, { TranslatorCredential } from \"@azure-rest/ai-translation-text\";\n\n// API Key + Region\nconst credential: TranslatorCredential = {\n  key: process.env.TRANSLATOR_SUBSCRIPTION_KEY!,\n  region: process.env.TRANSLATOR_REGION!,\n};\nconst client = TextTranslationClient(process.env.TRANSLATOR_ENDPOINT!, credential);\n\n// Or just credential (uses global endpoint)\nconst client2 = TextTranslationClient(credential);\n```\n\n### Translate Text\n\n```typescript\nimport TextTranslationClient, { isUnexpected } from \"@azure-rest/ai-translation-text\";\n\nconst response = await client.path(\"/translate\").post({\n  body: {\n    inputs: [\n      {\n        text: \"Hello, how are you?\",\n        language: \"en\",  // source (optional, auto-detect)\n        targets: [\n          { language: \"es\" },\n          { language: \"fr\" },\n        ],\n      },\n    ],\n  },\n});\n\nif (isUnexpected(response)) {\n  throw response.body.error;\n}\n\nfor (const result of response.body.value) {\n  for (const translation of result.translations) {\n    console.log(`${translation.language}: ${translation.text}`);\n  }\n}\n```\n\n### Translate with Options\n\n```typescript\nconst response = await client.path(\"/translate\").post({\n  body: {\n    inputs: [\n      {\n        text: \"Hello world\",\n        language: \"en\",\n        textType: \"Plain\",  // or \"Html\"\n        targets: [\n          {\n            language: \"de\",\n            profanityAction: \"NoAction\",  // \"Marked\" | \"Deleted\"\n            tone: \"formal\",  // LLM-specific\n          },\n        ],\n      },\n    ],\n  },\n});\n```\n\n### Get Supported Languages\n\n```typescript\nconst response = await client.path(\"/languages\").get();\n\nif (isUnexpected(response)) {\n  throw response.body.error;\n}\n\n// Translation languages\nfor (const [code, lang] of Object.entries(response.body.translation || {})) {\n  console.log(`${code}: ${lang.name} (${lang.nativeName})`);\n}\n```\n\n### Transliterate\n\n```typescript\nconst response = await client.path(\"/transliterate\").post({\n  body: { inputs: [{ text: \"这是个测试\" }] },\n  queryParameters: {\n    language: \"zh-Hans\",\n    fromScript: \"Hans\",\n    toScript: \"Latn\",\n  },\n});\n\nif (!isUnexpected(response)) {\n  for (const t of response.body.value) {\n    console.log(`${t.script}: ${t.text}`);  // Latn: zhè shì gè cè shì\n  }\n}\n```\n\n### Detect Language\n\n```typescript\nconst response = await client.path(\"/detect\").post({\n  body: { inputs: [{ text: \"Bonjour le monde\" }] },\n});\n\nif (!isUnexpected(response)) {\n  for (const result of response.body.value) {\n    console.log(`Language: ${result.language}, Score: ${result.score}`);\n  }\n}\n```\n\n## Document Translation Client\n\n### Authentication\n\n```typescript\nimport DocumentTranslationClient from \"@azure-rest/ai-translation-document\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst endpoint = \"https://<translator>.cognitiveservices.azure.com\";\n\n// TokenCredential\nconst client = DocumentTranslationClient(endpoint, new DefaultAzureCredential());\n\n// API Key\nconst client2 = DocumentTranslationClient(endpoint, { key: \"<api-key>\" });\n```\n\n### Single Document Translation\n\n```typescript\nimport DocumentTranslationClient from \"@azure-rest/ai-translation-document\";\nimport { writeFile } from \"node:fs/promises\";\n\nconst response = await client.path(\"/document:translate\").post({\n  queryParameters: {\n    targetLanguage: \"es\",\n    sourceLanguage: \"en\",  // optional\n  },\n  contentType: \"multipart/form-data\",\n  body: [\n    {\n      name: \"document\",\n      body: \"Hello, this is a test document.\",\n      filename: \"test.txt\",\n      contentType: \"text/plain\",\n    },\n  ],\n}).asNodeStream();\n\nif (response.status === \"200\") {\n  await writeFile(\"translated.txt\", response.body);\n}\n```\n\n### Batch Document Translation\n\n```typescript\nimport { ContainerSASPermissions, BlobServiceClient } from \"@azure/storage-blob\";\n\n// Generate SAS URLs for source and target containers\nconst sourceSas = await sourceContainer.generateSasUrl({\n  permissions: ContainerSASPermissions.parse(\"rl\"),\n  expiresOn: new Date(Date.now() + 24 * 60 * 60 * 1000),\n});\n\nconst targetSas = await targetContainer.generateSasUrl({\n  permissions: ContainerSASPermissions.parse(\"rwl\"),\n  expiresOn: new Date(Date.now() + 24 * 60 * 60 * 1000),\n});\n\n// Start batch translation\nconst response = await client.path(\"/document/batches\").post({\n  body: {\n    inputs: [\n      {\n        source: { sourceUrl: sourceSas },\n        targets: [\n          { targetUrl: targetSas, language: \"fr\" },\n        ],\n      },\n    ],\n  },\n});\n\n// Get operation ID from header\nconst operationId = new URL(response.headers[\"operation-location\"])\n  .pathname.split(\"/\").pop();\n```\n\n### Get Translation Status\n\n```typescript\nimport { isUnexpected, paginate } from \"@azure-rest/ai-translation-document\";\n\nconst statusResponse = await client.path(\"/document/batches/{id}\", operationId).get();\n\nif (!isUnexpected(statusResponse)) {\n  const status = statusResponse.body;\n  console.log(`Status: ${status.status}`);\n  console.log(`Total: ${status.summary.total}`);\n  console.log(`Success: ${status.summary.success}`);\n}\n\n// List documents with pagination\nconst docsResponse = await client.path(\"/document/batches/{id}/documents\", operationId).get();\nconst documents = paginate(client, docsResponse);\n\nfor await (const doc of documents) {\n  console.log(`${doc.id}: ${doc.status}`);\n}\n```\n\n### Get Supported Formats\n\n```typescript\nconst response = await client.path(\"/document/formats\").get();\n\nif (!isUnexpected(response)) {\n  for (const format of response.body.value) {\n    console.log(`${format.format}: ${format.fileExtensions.join(\", \")}`);\n  }\n}\n```\n\n## Key Types\n\n```typescript\n// Text Translation\nimport type {\n  TranslatorCredential,\n  TranslatorTokenCredential,\n} from \"@azure-rest/ai-translation-text\";\n\n// Document Translation\nimport type {\n  DocumentTranslateParameters,\n  StartTranslationDetails,\n  TranslationStatus,\n} from \"@azure-rest/ai-translation-document\";\n```\n\n## Best Practices\n\n1. **Auto-detect source** - Omit `language` parameter to auto-detect\n2. **Batch requests** - Translate multiple texts in one call for efficiency\n3. **Use SAS tokens** - For document translation, use time-limited SAS URLs\n4. **Handle errors** - Always check `isUnexpected(response)` before accessing body\n5. **Regional endpoints** - Use regional endpoints for lower latency\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["azure","translation","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows"],"capabilities":["skill","source-sickn33","skill-azure-ai-translation-ts","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-ai-translation-ts","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34928 github stars · SKILL.md body (7,271 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T18:50:28.708Z","embedding":null,"createdAt":"2026-04-18T21:32:04.120Z","updatedAt":"2026-04-24T18:50:28.708Z","lastSeenAt":"2026-04-24T18:50:28.708Z","tsv":"'/ai-translation-document':47,297,329,464,561 '/ai-translation-text':38,75,115,549 '/detect':265 '/document':339 '/document/batches':426,469,496 '/document/formats':523 '/documents':498 '/languages':200 '/translate':120,167 '/transliterate':226 '1':564 '1000':403,418 '2':576 '200':367 '24':400,415 '3':587 '4':600 '5':610 '60':401,402,416,417 'access':608 'action':631 'ai':3 'alway':603 'api':76,312 'api.cognitive.microsofttranslator.com':54 'applic':625 'ask':669 'asnodestream':364 'authent':66,289 'auto':134,566,574 'auto-detect':133,565,573 'await':118,165,198,224,263,337,368,391,406,424,467,494,507,521 'azur':2,15,36,45,73,113,295,327,462,547,559 'azure-ai-translation-t':1 'azure-rest':35,44,72,112,294,326,461,546,558 'azure/identity':39,48,301 'azure/storage-blob':380 'bash':30,51 'batch':372,420,577 'best':562 'blobservicecli':378 'bodi':122,169,228,267,350,353,428,609 'bonjour':270 'boundari':677 'call':584 'check':604 'clarif':671 'clear':644 'client':14,28,65,90,288,307,504 'client.path':119,166,199,225,264,338,425,468,495,522 'client2':102,315 'code':211,217 'cognitiveservices.azure.com':304 'console.log':156,216,249,281,479,482,485,512,533 'const':79,89,101,116,147,152,163,196,210,222,245,261,277,302,306,314,335,389,404,422,443,465,476,492,501,508,519,529 'contain':388 'containersaspermiss':377 'containersaspermissions.parse':394,409 'contenttyp':348,362 'credenti':80,94,97,104 'criteria':680 'cè':256 'date':398,413 'date.now':399,414 'de':182 'defaultazurecredenti':299,311 'delet':186 'describ':632,648 'detect':135,258,567,575 'doc':509 'doc.id':513 'doc.status':514 'docsrespons':493,505 'document':8,22,40,286,320,352,359,373,489,502,511,550,592 'documenttranslateparamet':554 'documenttranslationcli':292,308,316,324 'e.g':60 'eastus':62 'effici':586 'en':130,175,346 'endpoint':53,93,100,303,309,317,612,615 'environ':49,660 'environment-specif':659 'error':602 'es':138,344 'execut':627 'expert':665 'expireson':396,411 'filenam':360 'formal':188 'format':517,530 'format.fileextensions.join':535 'format.format':534 'fr':140,437 'fromscript':237 'fs/promises':334 'generat':381 'get':192,201,438,453,472,500,515,524 'global':99 'gè':255 'han':236,238 'handl':601 'header':442 'hello':125,172,354 'html':179 'id':440,470,497 'import':68,108,291,298,323,330,376,457,541,552 'input':123,170,229,268,429,674 'instal':29,34,43 'isunexpect':110,142,203,242,274,458,474,526,605 'key':57,77,82,85,313,318,536 'lang':212 'lang.name':218 'lang.nativename':219 'languag':129,137,139,174,181,194,208,233,259,282,436,570 'latenc':618 'latn':240,252 'le':271 'limit':597,636 'list':488 'llm':190 'llm-specif':189 'locat':450 'lower':617 'mark':185 'match':645 'miss':682 'mond':272 'multipart/form-data':349 'multipl':580 'name':351 'new':310,397,412,445 'noaction':184 'node':333 'npm':33,42 'object.entries':214 'omit':569 'one':583 'oper':439,449 'operation-loc':448 'operationid':444,471,499 'option':132,161,347 'output':654 'overview':635 'pagin':459,491,503 'paramet':571 'pathname.split':451 'permiss':393,408,675 'plain':177 'pop':452 'post':121,168,227,266,341,427 'practic':563 'process.env.translator':83,87,92 'profanityact':183 'queryparamet':232,342 'region':59,78,86,88,611,614 'request':578 'requir':673 'respons':117,143,164,197,204,223,243,262,275,336,423,520,527,606 'response.body':371 'response.body.error':145,206 'response.body.translation':215 'response.body.value':150,248,280,532 'response.headers':447 'response.status':366 'rest':12,26,37,46,74,114,296,328,463,548,560 'rest-styl':11,25 'result':148,278 'result.language':283 'result.score':285 'result.translations':155 'review':666 'rl':395 'rwl':410 'safeti':676 'sas':382,589,598 'scope':647 'score':284 'sdks':17 'shì':254,257 'singl':319 'skill':623,639 'skill-azure-ai-translation-ts' 'sourc':131,385,430,568 'source-sickn33' 'sourcecontainer.generatesasurl':392 'sourcelanguag':345 'sourcesa':390,432 'sourceurl':431 'specif':191,661 'start':419 'starttranslationdetail':555 'status':455,477,480 'status.status':481 'status.summary.success':487 'status.summary.total':484 'statusrespons':466,475 'statusresponse.body':478 'stop':667 'style':13,27 'subscript':56,84 'substitut':657 'success':486,679 'support':193,516 't.script':250 't.text':251 'target':136,180,387,433 'targetcontainer.generatesasurl':407 'targetlanguag':343 'targetsa':405,435 'targeturl':434 'task':643 'test':358,663 'test.txt':361 'text':6,20,31,63,106,124,171,230,269,539,581 'text/plain':363 'texttranslationcli':69,91,103,109 'texttyp':176 'throw':144,205 'time':596 'time-limit':595 'token':590 'tokencredenti':305 'tone':187 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'toscript':239 'total':483 'translat':4,9,16,23,32,41,52,55,58,64,105,153,159,207,287,321,340,374,421,454,540,551,579,593 'translated.txt':370 'translation.language':157 'translation.text':158 'translationstatus':556 'translatorcredenti':70,81,543 'translatortokencredenti':544 'transliter':220 'treat':652 'ts':5 'type':537,542,553 'typescript':19,67,107,162,195,221,260,290,322,375,456,518,538 'url':383,446,599 'use':98,588,594,613,621,637 'valid':662 'variabl':50 'westus':61 'workflow':629 'world':173 'writefil':331,369 'zh':235 'zh-han':234 'zhè':253 '这是个测试':231","prices":[{"id":"8bc876cd-aae4-4147-b085-7196c2facbc9","listingId":"1d4a4d37-920a-4afa-8bed-5ae9b7f56f52","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:32:04.120Z"}],"sources":[{"listingId":"1d4a4d37-920a-4afa-8bed-5ae9b7f56f52","source":"github","sourceId":"sickn33/antigravity-awesome-skills/azure-ai-translation-ts","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-translation-ts","isPrimary":false,"firstSeenAt":"2026-04-18T21:32:04.120Z","lastSeenAt":"2026-04-24T18:50:28.708Z"}],"details":{"listingId":"1d4a4d37-920a-4afa-8bed-5ae9b7f56f52","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"azure-ai-translation-ts","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34928,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-24T06:41:17Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"5b856fa309735c454bf54f716bf9781e0227411d","skill_md_path":"skills/azure-ai-translation-ts/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-translation-ts"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"azure-ai-translation-ts","description":"Text and document translation with REST-style clients."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-ai-translation-ts"},"updatedAt":"2026-04-24T18:50:28.708Z"}}