Help us improve
Share bugs, ideas, or general feedback.
From web-ai-skills
Implements and debugs browser Translator API integrations in JS/TS web apps: support checks, language-pair availability, model download UX, session creation, translate()/translateStreaming() calls, input-usage measurement, and permissions-policy handling.
npx claudepluginhub webmaxru/ai-native-dev --plugin web-ai-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/web-ai-skills:translator-apiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Step 1: Identify the browser integration surface**
Implements browser Language Detector API integrations in JS/TS web apps: support checks, model download flows, session creation, detect() calls, input-usage measurement, permissions-policy handling, and compatibility fallbacks.
Translates text, docs, comments, or UI strings between languages using GitHub Copilot CLI (free GPT-4.1 tier) with Claude Code review. Automatically falls back to Claude Code if Copilot is rate-limited.
Translates plain text synchronously (fast mode) or processes batch text files asynchronously (batch mode) using the Zoom AI Services API. Includes JWT auth, webhook-driven status updates, and one-target-language workflows.
Share bugs, ideas, or general feedback.
Step 1: Identify the browser integration surface
node scripts/find-translator-targets.mjs . to inventory likely frontend files and existing Translator API markers when a Node runtime is available.package.json, HTML entry point, and framework bootstrap files manually to identify the browser app boundary.Step 2: Confirm API viability and choose the integration shape
references/translator-reference.md before writing code.references/examples.md when the feature needs a session wrapper, download-progress UI, streaming output, cancellation, or cleanup shape.references/compatibility.md when preview flags, browser channels, iframe rules, or environment constraints matter.references/troubleshooting.md when support checks, session creation, translation, or cleanup fail.Window context.translator permissions-policy feature.Translator.create() for a fixed language pair and full-result translationcreate() when the UI must surface model download progresstranslateStreaming() when the UI should reveal translated output incrementallymeasureInputUsage() when quota or input-size budgeting affects the flowStep 3: Implement a guarded translator session
assets/translator-session.template.ts and adapt it to the framework, state model, and file layout in the workspace.globalThis.isSecureContext, Translator, and the same sourceLanguage and targetLanguage shape the feature will use at runtime.Translator.availability() using the same language pair that will be passed to Translator.create().availability() as a capability check, not a guarantee that creation will succeed without download time, policy approval, or user activation.monitor option during create() when the product needs download progress.AbortController for cancelable create(), translate(), translateStreaming(), or measureInputUsage() calls, and call destroy() when the session is no longer needed.sourceLanguage or targetLanguage after creation; session options are fixed per instance.allow="translator".Step 4: Wire UX and fallback behavior
translate() when downstream logic needs the full result before continuing, and use translateStreaming() when the UI should reveal translated text incrementally.measureInputUsage() when large inputs can exceed session quota.Step 5: Validate behavior
node scripts/find-translator-targets.mjs . to confirm that the intended app boundary and Translator API markers still resolve to the edited integration surface.Translator feature detection, and availability() behavior before debugging deeper runtime failures.create() plus translate() flow with representative user text for the target language pair.translateStreaming() separately and confirm partial output stops cleanly on abort.measureInputUsage() behavior before sending large input.references/compatibility.md before treating failures as application bugs.Translator is missing, keep a non-AI fallback and confirm secure-context, browser, channel, and flag requirements before changing product logic.availability() returns downloadable or downloading, require user-driven session creation before promising that translation is ready.create() throws NotAllowedError, check permissions-policy constraints, missing user activation for downloads, browser policy restrictions, or user rejection.create() throws OperationError, treat model initialization as failed and retry only after checking browser state, required flags, and download readiness.QuotaExceededError, reduce the input size or measure usage before retrying.NotReadableError or UnknownError, surface a visible fallback instead of retrying blindly with the same input.