Skip to content
caliper ui pro docs

AI translate

A text and its AI translation side by side, paragraph by paragraph. Pick a language and the translation writes in; pointing at a paragraph marks its partner on the other side. Translations are kept per language, so switching back is instant.

Pro
Detected: French

Bonjour, nous utilisons votre outil depuis trois mois dans notre agence et l'équipe l'adore. La création des devis est deux fois plus rapide qu'avant.

Par contre, l'export PDF coupe parfois le tableau des prix sur deux pages, ce qui fait mauvaise impression auprès des clients.

Est-ce qu'une correction est prévue ? Merci d'avance.

Translating to English

When to use

  • Support replies, product reviews and messages from customers in other languages.
  • Content teams checking a translation against its source before publishing.

When not to use

  • Interface strings; those belong in your localisation files.
  • Legal text that needs a certified translation.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/ai-translate

Adds its 6 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

AiTranslate

6 props
PropTypeDefaultDescription
paragraphs *readonly string[]—The original text, one string per paragraph.
sourceLanguage *string—Name of the original's language, such as “English” or “Detected: Portuguese”.
languages *readonly TranslateLanguage[]—
defaultLanguagestring—
onTranslate *(paragraphs: readonly string[], language: string, signal: AbortSignal) => Promise<readonly string[]>—Translates every paragraph, in order. Abort when the signal fires; throw to show an error.
classNamestring—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes group, alert and status semantics, with aria-label, aria-hidden and aria-busy kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/ai-translate.md

The index of every part is at /llms.txt.

More in Assistant screens