Local translation preview
With @linguanahq/vite, local preview is on by default during vite dev when a development token is configured. It works with React, Vue, Svelte, Solid, and TanStack Start, including CLI template apps in connected mode. Next.js does not support local preview; its development server never uploads or requests translations. Select a target language in your app, then edit a heading or button. Source text renders immediately; validated translations arrive through Vite's live connection. No rebuild, page reload, or release is required.
linguana({
adapter: linguanaReact(), // Or vue(), svelte(), solid(). TanStack Start uses react().
projectId: "your-project",
environment: "development",
token: process.env.LINGUANA_PROJECT_TOKEN,
// hotReload: false, // Explicit local opt-out.
// previewMaxChargeMicros: 50_000, // Optional lower per-request ceiling: $0.05.
})Keep the token in the Vite server process. Never name it with a VITE_ prefix or pass it to the browser provider. The provider uses the same project ID and development environment. Enable target languages in the dashboard. The previous @linguanahq/compiler plugin is deprecated; migrate to @linguanahq/vite for local preview.
Preview controls
The small Local preview bar shows the selected language, completed strings, and progress. Show original compares source wording in place. Refresh reads saved corrections and retries after a resolved failure or spending block. Hide preview controls dismisses the bar for that page session. Your application state and URL stay intact.
In Projects → Manage project → Local translation preview, editors, admins, and owners can switch preview off. The project setting is on by default. hotReload: false always disables it locally, including when the dashboard allows it. upload: false, a missing token, a non-development environment, or a production build also disable preview.
The dashboard change reaches active development servers within approximately five seconds; the worker checks it again immediately before each provider attempt. Work already in flight may finish and be billed. Disabling preview prevents new attempts and removes the local overlay wording once the setting refreshes.
Speed and cost
The dev server collects only loaded modules, debounces edits for 250 ms, and submits changed strings for the language being viewed. It starts small batches of up to 20 strings and approximately 2,500 source characters, with at most two pending batches per dev server. A single longer string can use up to 12,000 source characters. Validated memory hits can appear while a job is still queued; generated results appear progressively. Saved human corrections are checked every five seconds.
Generation uses normal new target character pricing, not a separate token price. Exact compatible memory hits do not call the model or create a character charge. The default maximum per request is $0.10, subordinate to the organization monthly cap. Only the owner can change that dashboard ceiling. A local previewMaxChargeMicros can lower it. The request ceiling applies to each small batch, not the entire development session; the organization cap bounds aggregate spending.
The page never waits for generation. A preview provider attempt has a 20-second timeout and no automatic transport retry; a structural repair can use one further attempt. Preview jobs have their own bounded worker queue so long CI catalog jobs do not occupy their slots. Queue and provider latency still vary. On a failure or spending block, the page retains valid existing wording or source and the bar explains the state. Fix the cause, then refresh. Preview never waits for an entire project or every language to finish.
Review and release
Preview text is a validated draft, visible only through the authenticated development integration. Publishable keys cannot read it. Preview does not create a release catalog or change development, staging, or production release pointers. A later normal build reuses compatible translation memory; review and publish through the existing release workflow.
Context or glossary activation starts compatible preview work on the next settings refresh, without changing current published catalogs. Source snapshots and scope checks prevent late responses from applying after a source or language change. SSR still hydrates the original locale, time zone, direction, and embedded catalog; preview updates begin after the browser mounts.
API content continues to use the public runtime catalog and its separate publication policy. Local preview in this release covers compiler-discovered interface copy, including explicit t() and rich-text messages; it does not expose unpublished API content to public browser keys.
See validated translations in your running app without rebuilding or publishing.
Last updated October 6, 2026
Did this page get you to a working result?