Case Study

How a Next.js App Added Internationalization Without Rebuilding Routing

Published September 13, 2026

How a Next.js App Added Internationalization Without Rebuilding Routing

How a Next.js App Added Internationalization Without Rebuilding Routing

Company: GlobalTech SaaS (fictional) – a B2B productivity tool built with Next.js 13.

Challenge:
- Reach new markets in Europe and Asia.
- Existing routing was static; adding i18n folders would require a full rebuild and SEO downtime.
- Budget constraints prevented hiring a dedicated translation agency.

Solution: Deploy SiteLocaleAI, a self‑hosted JavaScript library that translates any web page on the fly, localizes prices, and pre‑renders SEO‑friendly HTML via its CLI. The library works with any framework, so the team could keep their existing Next.js routing untouched.


1. Quick Integration – Drop‑In Script

The team added the library as a single script tag in pages/_app.js. No Node.js build step was needed for the translation layer.

// pages/_app.js
import { useEffect } from 'react';

function MyApp({ Component, pageProps }) {
  useEffect(() => {
    // Initialize SiteLocaleAI with the LLM API key (Claude, GPT‑4o‑mini, etc.)
    window.SiteLocaleAI.init({
      apiKey: process.env.NEXT_PUBLIC_SITELocaleAI_API_KEY,
      defaultLang: 'en',
      supportedLangs: ['en', 'fr', 'de', 'es', 'ja', 'zh'],
      priceRounding: true, // psychological rounding per currency
    });
  }, []);

  return <Component {...pageProps} />;
}

export default MyApp;

The script automatically scans the DOM, sends text nodes to the configured LLM, and replaces them with the translated version. Because the library runs client‑side, the original English markup stays intact for existing users.


2. SEO Pre‑Rendering with the CLI

Search engines need crawlable HTML. SiteLocaleAI’s CLI generates static, translated snapshots that can be served to bots.

# Generate SEO‑friendly pages for French and German
n localeai prerender \
  --src ./out \
  --langs fr,de \
  --output ./out_localized

The command reads the built static files (./out), translates them, applies price rounding (e.g., €9.99 → €9.95), and writes the localized HTML to ./out_localized. The Next.js next.config.js was updated to serve the correct folder based on the Accept‑Language header, without any routing changes.

// next.config.js
module.exports = {
  async rewrites() {
    return [
      {
        source: '/:path*',
        destination: (req) => {
          const lang = req.headers['accept-language']?.split(',')[0].slice(0,2) || 'en';
          return `/${lang}${req.url}`;
        },
      },
    ];
  },
};

The rewrite simply prefixes the URL with the language folder that the CLI created. No new [lang] dynamic route or i18n config was required.


3. Price Localization & Psychological Rounding

SiteLocaleAI’s priceRounding option applies market‑tested rounding rules (e.g., $9.99 → $9.95, ¥1,200 → ¥1,199). The team saw a 3% lift in conversion on the Japanese market because the prices felt “right” to local shoppers.


4. Measurable ROI

Metric Before SiteLocaleAI After 3 Months % Change
International organic traffic 12 k visits/mo 36 k visits/mo +200%
Avg. conversion rate (global) 1.8% 2.6% +44%
Revenue from non‑English markets $8 k/mo $11.6 k/mo +45%
Translation cost (internal) $2 k (manual) $0 (LLM API only) -100%
Development time to launch 6 weeks (routing overhaul) 2 weeks (drop‑in) ‑66%

The payback period was under one month: the $5 Indie plan (or $49 Starter for higher traffic) covered the LLM API usage, and the revenue lift paid for the next tier within weeks.


5. Why SiteLocaleAI Won Over Traditional i18n Solutions

  • Framework‑agnostic: Works with Next.js, React, Vue, WordPress, Shopify, etc. No need to refactor existing components.
  • Self‑hosted LLM keys: Companies keep data privacy by using their own Claude or GPT‑4o‑mini keys.
  • SEO‑ready: CLI pre‑renders fully translated HTML, eliminating the “client‑only” translation penalty.
  • Price psychology: Built‑in rounding per currency boosts perceived value.

6. Lessons Learned & Best Practices

  1. Cache translated fragments – SiteLocaleAI supports a CDN cache layer; the team set a 24‑hour TTL to keep API costs low.
  2. Test price rounding – Run A/B tests per market; the default rounding works for most, but fine‑tuning can add another 1‑2% lift.
  3. Combine with static generation – For high‑traffic landing pages, pre‑render at build time; for dynamic dashboards, rely on the client‑side script.

7. Next Steps for Your Project

If you’re running a Next.js (or any) web app and want instant multilingual support without a routing overhaul, try SiteLocaleAI today. The Indie plan starts at $5/mo, perfect for pilots, while Starter and Growth tiers scale with traffic.

Ready to go global?

👉 Start a free trial and see how quickly you can add international SEO, price localization, and LLM‑powered translation to your site.


For detailed integration steps, see the official docs:
- https://sitelocaleai.com/docs/quick-start
- https://sitelocaleai.com/docs/seo-prerender