Seatext library

How to Migrate from Another Translation Tool to SeaText in Vue.js

Run both translation tools in parallel during the transition, map your existing translation keys to SeaText selectors, use feature flags to gradually shift traffic, and remove the old tool only after validating SeaText covers...

Why migrate safely matters

Changing a translation system can break a Vue app in surprising places. A missing string may appear as a raw key. A modal may load before the new translator is ready. A route guard may block content. A safe migration keeps visitors protected while you prove the new setup works.

SeaText is a good fit for this kind of handover because it works as a second layer. The script loads asynchronously. It rewrites text in the browser after the page renders. Your existing i18n tool can stay active during the transition. You compare output, fix gaps, and only then remove the old tool.

The core rule is simple: never remove the old tool until SeaText covers every string your users can see.

Quick migration overview

The migration path has six steps:

  1. Add the SeaText snippet.
  2. Export and map existing translation keys.
  3. Run both tools under a feature flag.
  4. Validate coverage and quality.
  5. Shift traffic gradually.
  6. Retire the old tool.

This works for Vue 2.6+, Vue 3+, and Nuxt apps. The SeaText installation guide lists Vue as one of the supported SPA frameworks.

Prerequisites before you start

  • A SeaText account with a project ID.
  • Node.js 14+ and Vue 2.6+ or Vue 3+.
  • Vite, Webpack, or Nuxt.
  • Access to your current translation files or dashboard.
  • A clear map of your entry file: main.ts, main.js, or index.html.
  • A feature flag system, or a simple boolean in localStorage.

You do not need a SeaText Vue plugin. The snippet is framework-agnostic.

Step 1: Add the SeaText snippet alongside your existing i18n

Paste the snippet in the body of index.html, or in the main JavaScript file before Vue mounts. The script tag includes the async attribute, so it loads without blocking the page.

The script stores an ID in localStorage. Make sure your Content Security Policy allows script loading and local storage access for the SeaText domain.

Do not delete the old i18n initialization. Keep it mounted. Open DevTools and check the Network tab. The SeaText script should load with no console errors.

Test one route. If the page renders normally, move to the mapping step.

Step 2: Export and map your existing translation keys

Export all keys from your current tool. JSON, CSV, and PO files are common formats. Put the keys in a spreadsheet.

The next task is to map each key to the DOM element it controls. SeaText finds text nodes by selector. The selector must match the element after Vue renders it, not before.

Here is a concrete mapping example:

Old keyRendered elementSeaText selector
checkout.title<h1 class='checkout-title'>Secure checkout</h1>.checkout-title
product.addToCart<button data-i18n='product.addToCart'>Add to cart</button>[data-i18n='product.addToCart']
footer.rights<div data-seatext='footer.rights'>All rights reserved</div>[data-seatext='footer.rights']

Data attributes are more stable than CSS class names. If your component library generates hashed classes, add a data-* attribute to the element in the template.

Keep a master list that links old key, selector, and language codes. One selector can map to many languages. One component can reuse the same selector across routes.

If a key does not appear in the DOM on the first page, find the component that renders it. Common examples are cart drawers, account menus, and error messages. Map those selectors before you start the rollout.

Step 3: Run both tools in parallel with a feature flag

Create a feature flag called useSeaText. Start with a small set of low-risk pages, such as a static marketing page or the checkout landing page. Example check:

const useSeaText = window.APP_FLAGS.useSeaText === true

When the flag is true, keep the old translation tool loaded but do not let it rewrite the selectors SeaText controls. The exact mechanism depends on your old library. Check with the vendor for the right setting.

If you cannot disable a single renderer, the safest option is to use the old tool for fallback strings only. That means removing the old tool's direct control on mapped elements.

Run the flagged pages in staging. Compare the rendered output side by side. Look for missing strings, plural differences, and duplicate text.

Step 4: Validate coverage and quality

Open the SeaText variant editor. Review auto-generated translations for each language. Activate the Translation Agent for the markets you serve. The Translation Agent localizes pages into up to 125 languages.

Run automated visual regression tests. Tools like Chromatic or Percy can compare the old output with SeaText output on flagged pages.

Test dynamic behavior. Open a product page, navigate to another product, then return. Check that text updates on route changes. In a Vue SPA, async components and nested routes change the DOM; SeaText must respond to those changes.

Check edge cases per language: zero, one, and many; right-to-left text; long strings; HTML inside translated text. Add manual variants when the auto translation is not right.

Step 5: Gradually shift traffic and retire the old tool

Increase the rollout in controlled steps: 10 percent, then 50 percent, then 100 percent. Monitor console errors, translation latency, and user-reported issues.

Keep a rollback plan. If 50 percent shows problems, set the flag back to false for the affected route or locale. Both tools remain installed until you are confident.

After a full release cycle with no missing strings, remove the old i18n package, its locale files, and the flag code. Update CI/CD and remove unused dependencies. This is the final step of a safe migration.

Common migration pitfalls

  • Hard-coded strings in components. SeaText can only translate text it can select in the DOM. Move inline strings to template slots or data attributes.
  • Pluralization and ICU syntax. Old tools often use ICU MessageFormat. SeaText handles plurals through variants. Test zero, one, two, and many for each language.
  • Strict Content Security Policy. The snippet loads from the SeaText domain and stores an ID in localStorage. Allow both in your CSP.
  • Server-side rendering in Nuxt. The snippet runs client-side. Translated text may flash after first paint. Pre-render critical copy or accept the brief flash.
  • Generated CSS class names. Hashed classes change between builds. Use data attributes as stable selectors.
  • Double translation. If the old tool runs after SeaText, it may overwrite the new text. Coordinate load order and test in staging.

How SeaText translation works in a Vue SPA

SeaText injects a lightweight script that observes the DOM. When Vue mounts or updates components, SeaText matches its configured selectors against the live DOM and swaps text nodes with the active variant for the visitor's language.

No Vue plugin, composable, or store integration is required. The same snippet works for React, Angular, and vanilla JavaScript. This keeps migration work focused on selectors, not on rewriting components.

Because the snippet is async, the rest of the app loads normally. If the script fails, the Vue-rendered text stays visible.

Key facts

CapabilityDetail
Installation methodAsync script snippet in index.html or bootstrap file
Framework supportVue 2.6+, Vue 3+, Nuxt (client-side only)
Languages supportedUp to 125
Translation controlDashboard variant editor; CSS selector mapping
Dynamic content handlingRe-scans DOM on route changes
LocalStorage usageStores anonymous ID; requires CSP allowance
Programming required after installNone — activation via dashboard toggle

Limitations and when this approach does not apply

  • If you need server-rendered translated HTML for SEO, the client-side swap will not help search crawlers. Keep SSR translations for meta tags and structured data.
  • Complex ICU plural rules or gender agreements may need manual variant creation.
  • If your CSP blocks third-party scripts without a script-src exception, SeaText cannot load.
  • Migration effort depends on the number of unique selectors. Stable component classes and data attributes move faster than inline styles.
  • Very large catalog sites with hundreds of dynamic views need extra QA time. Plan for multiple validation cycles.

FAQ

Can I keep vue-i18n for date/number formatting while SeaText handles copy?

Yes. SeaText only rewrites text nodes it selects. Date and number formatting from vue-i18n or the Intl API continues to work.

Does SeaText translate content loaded via API after mount?

It is designed for dynamic SPAs. Test async content in staging. Once the content appears in the DOM, the observer should apply the matching selector. Confirm each async view before rollout.

How do I handle A/B test variants during migration?

SeaText has a variant editor and supports A/B testing. You can create multiple translations per selector. Keep your old tool's A/B framework disabled on flagged pages to avoid conflicts.

What happens if the SeaText script fails to load?

The snippet loads asynchronously. If it fails, the original Vue-rendered text remains visible. Monitor the Network tab and add a fallback log if needed.

Can I migrate language by language instead of all at once?

Yes. Enable the Translation Agent for one locale, validate it, then add the next. The feature flag can be locale-aware.

Is there a cost to run both tools during migration?

SeaText starts with a free pilot. You pay only after the product proves conversion lift. Your existing tool's pricing remains the same until you cancel it.

Can I use other translators, like Google Translate, together with SeaText?

The documentation lists this as a common question. The main risk is double translation. If you keep another translator, disable it on the selectors SeaText controls. Test the combination in staging before rolling out.

Hypothetical scenario: migrating a Vue 3 e-commerce checkout

Imagine a Vue 3 shop using vue-i18n with 400 keys across 8 languages. The team adds the SeaText snippet to index.html, exports all keys to CSV, and maps each key to a selector. For the checkout title they use .checkout-title. For the add-to-cart button they use [data-i18n='product.addToCart'].

They enable the useSeaText flag for the cart page only. QA compares screenshots. SeaText misses two Russian plural forms. They add those variants in the dashboard, re-test, then roll the flag to 100 percent of cart traffic.

After one week with zero issues, they delete vue-i18n, its JSON files, and the flag. The checkout now serves 125 languages without maintaining translation files. The team keeps the feature flag code in version control for future rollbacks.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Further reading and comparison sources

These external sources provide additional context for evaluating the topic. Their inclusion is not an endorsement.

Learn more

Visit the website for more information.