How to Add Internationalization to a Next.js App Without Rebuilding Routing
You've built a Next.js app with clean, SEO-friendly routes. Now you want to add multilingual support. The usual advice? Refactor your entire routing structure to include locale prefixes (/en/, /fr/, etc.), configure middleware, and manage locale detection everywhere. That's a lot of work — especially if your app is already live.
But what if you could add internationalization (i18n) without touching your routing? In this post, we'll compare the common Next.js i18n approaches and show how SiteLocaleAI provides a drop-in alternative that localizes content, prices, and SEO — all while keeping your existing routes intact.
The Routing Problem in Next.js i18n
Next.js's built-in i18n support (via next.config.js) and third-party libraries like next-i18next typically require locale-prefixed routes. For example:
/aboutbecomes/en/about,/fr/about, etc.- You need middleware to detect the user's locale and redirect.
- Every
<Link>and programmatic navigation must include the locale.
This approach works, but it comes with significant trade-offs:
- Refactoring overhead: You must restructure your entire routing tree and update every link.
- Middleware complexity: Locale detection, fallbacks, and cookie management add moving parts.
- SEO challenges: Duplicate content across locale prefixes requires careful hreflang setup.
- Time and risk: For existing apps, it's a high-effort migration.
Alternative Approaches to Next.js i18n
1. Next.js Built-in i18n + next-i18next
Pros: Official support, mature ecosystem.
Cons: Requires routing changes, JSON-based translation files, manual content updates.
2. Manual Translation with Context/State
Pros: No routing changes.
Cons: Doesn't localize URLs, poor SEO (search engines see default language), no price localization.
3. CMS-Based Localization
Pros: Centralized content management.
Cons: Only works for CMS content, not UI strings or dynamic prices; often expensive.
4. SiteLocaleAI: The Drop-In Approach
SiteLocaleAI is a self-hosted JavaScript library that translates your website's content on the fly using your own LLM API keys. It doesn't require locale-prefixed routes, middleware, or a CMS. You keep your routing exactly as it is.
Why SiteLocaleAI Wins for This Use Case
No Routing Changes Needed
SiteLocaleAI operates at the content level. It detects and translates text, prices, and metadata directly in the DOM or during server-side rendering — all without altering your URL structure. Your existing routes stay clean and stable.
Framework Agnostic
Whether you're using the Next.js App Router, Pages Router, or even a mix — SiteLocaleAI works. It's also compatible with React, Vue, WordPress, Shopify, and any other web framework. No lock-in.
Self-Hosted & Cost-Effective
You bring your own LLM API keys (Claude, GPT-4o-mini, etc.), so you control costs and data privacy. Plans start at just $5 for indie projects, scaling to $249 for enterprises.
Price Localization with Psychological Rounding
SiteLocaleAI automatically localizes prices and applies psychological rounding per currency. For example, $49.99 might become €49 in Europe or ¥5,500 in Japan — culturally appropriate and conversion-friendly.
SEO Pre-rendering via CLI
Search engines need fully translated pages to index them properly. SiteLocaleAI includes a CLI that pre-renders localized versions of your pages (without locale prefixes!) so search engines see the translated content under your existing URLs. This boosts international SEO without hreflang headaches.
WordPress Plugin Without Node.js
If you're running a headless Next.js frontend with WordPress as a backend, SiteLocaleAI's WordPress plugin works without Node.js — simplifying your stack.
Quick Example: Adding SiteLocaleAI to a Next.js App
- Install the library:
npm install @sitelocaleai/client
- Initialize with your LLM API key (server-side):
// lib/sitelocale.js
import { createClient } from '@sitelocaleai/client';
export const siteLocale = createClient({
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY,
defaultLocale: 'en',
supportedLocales: ['en', 'fr', 'es', 'de', 'ja'],
});
- Wrap your app (App Router example):
// app/layout.js
import { SiteLocaleProvider } from '@sitelocaleai/react';
import { siteLocale } from '@/lib/sitelocale';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<SiteLocaleProvider client={siteLocale}>
{children}
</SiteLocaleProvider>
</body>
</html>
);
}
- Use the translation hook in components:
import { useTranslation } from '@sitelocaleai/react';
export default function Hero() {
const { t } = useTranslation();
return <h1>{t('Welcome to our store')}</h1>;
}
That's it. No route changes. No middleware. The library handles content detection, LLM translation, and price localization automatically. For advanced setup, check the official docs.
Real-World Impact
A mid-size e-commerce site using Next.js added SiteLocaleAI in under an hour. They kept their existing /product/[slug] routes, localized prices for 12 currencies, and saw a 34% increase in international organic traffic within two months — thanks to SEO pre-rendering and properly translated meta tags.
Conclusion
Rebuilding your Next.js routing for i18n is painful. SiteLocaleAI offers a faster, safer path: drop in the library, connect your LLM API key, and let it handle translation, price localization, and SEO pre-rendering — all without touching your routes.
Ready to localize your Next.js app without the routing headache? Try SiteLocaleAI today and see the difference.