AI translatePro
Translate a chat message where it sits: choose a language and each sentence is replaced in turn over a faded original, with the detected language, a switch back to the source text and a note naming the model.
oxyn add ai-translateThe launch moves to Tuesday so the EU tax check can finish. Please keep the pricing page in draft until then. I'll send the final copy on Monday afternoon.
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Read a message in your language: pick one and the translation streams in place, sentence by sentence over the dimmed original.
When not to use
- Replays a multi-agent run on one clock: use Agent timeline instead.
- One model at a glance: use Model card instead.
- A small automation on a single rail: use AI workflow instead.
Installation
AI translate is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add ai-translateUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
German
Translating to German.
The launch moves to Tuesday so the EU tax check can finish. Please keep the pricing page in draft until then. I'll send the final copy on Monday afternoon.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Side by side
Japanese beside the original (Oxyn extra).
The launch moves to Tuesday so the EU tax check can finish. Please keep the pricing page in draft until then. I'll send the final copy on Monday afternoon.
The launch moves to Tuesday so the EU tax check can finish. Please keep the pricing page in draft until then. I'll send the final copy on Monday afternoon.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Failed
Couldn't translate, with Try again.
The launch moves to Tuesday so the EU tax check can finish. Please keep the pricing page in draft until then. I'll send the final copy on Monday afternoon.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
AiTranslate
| Prop | Type | Default | Description |
|---|---|---|---|
nowrequired | ClockMs | — | Host clock. |
lang | usize | 1 | Starting language (0 original English, 1 German, 2 French, 3 Spanish, 4 Japanese, 5 Portuguese); anything but 0 translates on mount. |
fail | bool | Default::default() | The first translation fails (Retry demo). |
side | bool | Default::default() | Show the original and the translation side by side (Oxyn extra). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpaceor↓ | Open the language menu |
| ↑or↓ · HomeorEnd | Move in the menu |
| Enter | Pick a language |
| Escape | Close the menu |
Accessibility
- The menu is a listbox with aria-selected; the text carries a lang attribute for the language shown.
- Translating, done and errors are announced; the error uses role alert.
- Show original and side by side are toggle buttons.
From the spec
Language picker is a listbox; Show original is a switch; the status line is polite live. Every action returns the line the polite live region announces. The focus outline shows only for keyboard focus.
Motion & interaction
Each sentence replaces its dimmed original as it lands; the detected-language chip sits by the language picker.
Timing
Everything on screen is derived from the host clock now (no timers in the component), so playback, tests and the GPUI view agree.
| Transition | Duration | Easing |
|---|---|---|
| Think | 450 ms | — |
| Stream | 34 ms per tick | linear |
Reduced motion: streamed text and moves appear at their end state; progress still advances, without travel animation.
Responsive behaviour
- Each finished sentence replaces one dimmed sentence, so the card does not jump.
- Side by side stacks under 520 px.
Edge cases (spec)
Japanese and German lengths differ; the card grows smoothly. Side by side stacks under 640 px. Checked at 1440, 768 and 390 px in light and dark with no text overlap. Chrome is monochrome grey; colour is semantic only (success, warning, danger, info) plus the providers' coloured brand marks.
Notes for AI
- Import
AiTranslatefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
AiKitViewinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.