# Test SSR/SSG for all languages

- Check 27.09 · Development and accessibility by language · Important
- Source: https://checklist-seo-geo.com/en/development-accessibility-language/test-ssr-ssg-all-languages
- Check that every language version is rendered on the server or prerendered at build time, with Next.js, Nuxt, Astro, WordPress, Shopify or Laravel.
- Updated on 2026-11-25
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/development-accessibility-language/test-ssr-ssg-all-languages.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

A site can be perfectly server-rendered in its main language and still deliver empty shells, or text in the wrong language, on its secondary versions. The task is to check, for each language and each template, that the HTML returned by the server already contains the translated text, the right `lang` attribute and the language's metadata. SSR (Server-Side Rendering, rendered on each request) and SSG (Static Site Generation, rendered at build time) are both valid: what matters is that no language depends on JavaScript running in the browser.

## Why it matters

Gaps between languages are common because tests almost always cover the default language. Typical causes:

- the function that lists the pages to prerender returns only the main language's URLs; the others are rendered on demand, or not at all;
- translations are loaded by a network call after display, in a client component;
- the call to the CMS (Content Management System) fails for one language at build time, and the page is generated empty or with the default language's content;
- a fallback mechanism shows the French text under a German URL, with a 200 status code.

Google runs JavaScript, but with a delay, and its rendering service keeps neither cookies nor local storage from one page to the next: a translation that depends on a stored state will never be seen. Generative engine crawlers are even more demanding: an analysis published by Vercel in December 2024 observed no JavaScript execution by any of the major AI crawlers it tracked (OpenAI, Anthropic, Perplexity). A client-rendered language does not exist for them.

The problem stays invisible in a browser: the script runs and the page displays correctly. Only reading the raw HTML, language by language, reveals it.

## What it improves

- **Indexing of secondary languages**: the translated text is available as soon as the page is crawled, without waiting for Google's rendering queue.
- **Citations in AI answers**: every language becomes readable by crawlers that do not run JavaScript. A necessary condition, never a sufficient one.
- **hreflang**: the annotations connect pages that are actually translated, not identical shells.
- **Performance**: a prerendered or server-rendered page displays its content sooner, which helps LCP (Largest Contentful Paint).
- **Rankings**: no direct effect; the gain comes from each version being indexed correctly.

## How to check

Take one URL per language and read the HTML returned by the server, without running JavaScript:

```bash
curl -s https://example.com/de/preise/ | grep -o -i '<html[^>]*lang="[^"]*"'
curl -s https://example.com/de/preise/ | grep -c "Monatliche Zahlung"
```

Expected result: `lang="de"`, and at least one occurrence of a sentence from the main content in German. Pick a sentence from the body of the page, not from the title: the title is often rendered on the server when the body is not. Avoid sentences with apostrophes or quotation marks, which HTML sometimes encodes as entities.

Other checks:

- **Browser without JavaScript**: developer tools, command menu, "Disable JavaScript", then reload the page in each language. The text must still be there, in the right language.
- **Search Console**: URL Inspection on one URL per language, "Test live URL", then "View tested page". Compare the rendered HTML and the screenshot. See [test rendering in Search Console](https://checklist-seo-geo.com/en/javascript-html-rendering/test-rendering-search-console).
- **Crawl without rendering**: run Screaming Frog in text-only mode (JavaScript rendering off) on all languages, then compare the word count per language for the same template. A language whose pages have ten times fewer words gives away client-side rendering.
- **Build output**: for a static site, count the pages generated per language. A large gap between languages points to forgotten routes.

```bash
find out -name "index.html" | cut -d/ -f2 | sort | uniq -c
```

## How to implement

### Before you start

Build a test sample: for each language, one URL from each template (home page, category, product or service page, article, legal page, 404 page). Note one sentence from the main content of each. Store the sample in a `urls.csv` file, one line per URL: `url;expected language;expected sentence`.

```txt
https://example.com/fr/tarifs/;fr;Paiement mensuel
https://example.com/de/preise/;de;Monatliche Zahlung
https://example.com/en/pricing/;en;Monthly payment
https://example.com/de/blog/neue-funktionen/;de;Seit Version 4
```

This script reads the sample and produces a check table:

```bash
#!/usr/bin/env bash
# Usage: bash test-rendu-langues.sh urls.csv
printf 'code\texpected\tlang\ttext\turl\n'

while IFS=';' read -r url lang expected; do
  body=$(mktemp)
  code=$(curl -s -o "$body" -w '%{http_code}' "$url")
  found=$(grep -o -i '<html[^>]*lang="[^"]*"' "$body" | head -n 1 | sed -E 's/.*lang="([^"]*)".*/\1/')

  if grep -q -F "$expected" "$body"; then
    text="yes"
  else
    text="NO"
  fi

  printf '%s\t%s\t%s\t%s\t%s\n' "$code" "$lang" "${found:-missing}" "$text" "$url"
  rm -f "$body"
done < "$1"
```

A passing line shows `200`, the same language in the "expected" and "lang" columns, and `yes`. Copy the results into a tracking table:

| URL | Language | Code | `lang` | Text in the HTML | Rendering mode | Action |
|---|---|---|---|---|---|---|
| /fr/tarifs/ | fr | 200 | fr | yes | SSG | None |
| /de/preise/ | de | 200 | de | NO | Client | Load translations on the server |
| /de/blog/neue-funktionen/ | de | 404 | missing | NO | Not generated | Add the language to the prerendered routes |

Run this script again after each deployment, or add it to your continuous integration pipeline: see [integrate SEO, performance and accessibility tests into CI/CD](https://checklist-seo-geo.com/en/automation-quality-control/integrate-seo-performance-accessibility-tests-into-ci-cd).

### Next.js

Versions: Next.js 15.5 and 16. The method depends on the router: App Router or Pages Router.

The summary printed by `next build` shows, route by route, whether it is prerendered or rendered on demand: check that each language's routes are listed.

#### App Router

Pages under `app/[lang]/` are Server Components by default: translations loaded in these components end up in the HTML. Two points to check.

Every language must be listed in `generateStaticParams`, at the root layout level:

```tsx
// app/[lang]/layout.tsx
const locales = ['fr', 'de', 'en'];

export async function generateStaticParams() {
  return locales.map((lang) => ({ lang }));
}

export default async function RootLayout({ children, params }: LayoutProps<'/[lang]'>) {
  const { lang } = await params;

  return (
    <html lang={lang}>
      <body>{children}</body>
    </html>
  );
}
```

For a nested dynamic route, the child function is called once for each language generated by the parent: fetch the slugs of each language.

```tsx
// app/[lang]/blog/[slug]/page.tsx
import { notFound } from 'next/navigation';
import { getPost, getPostSlugs } from '@/lib/cms';

export async function generateStaticParams({ params }: { params: { lang: string } }) {
  const slugs = await getPostSlugs(params.lang);

  return slugs.map((slug) => ({ slug }));
}

export default async function Page({ params }: PageProps<'/[lang]/blog/[slug]'>) {
  const { lang, slug } = await params;
  const post = await getPost(lang, slug);

  if (!post) {
    notFound();
  }

  return <article>{/* post content */}</article>;
}
```

Next, components marked `'use client'` must not load their text with a `useEffect` or a `fetch` in the browser: pass them the translated strings as props from the parent Server Component.

#### Pages Router

For a dynamic route with `getStaticProps`, `getStaticPaths` must return every language: without a `locale` field, only the default language is generated.

```js
// pages/blog/[slug].js
export async function getStaticPaths({ locales }) {
  const paths = [];

  for (const locale of locales) {
    const slugs = await getPostSlugs(locale);
    slugs.forEach((slug) => paths.push({ params: { slug }, locale }));
  }

  return { paths, fallback: 'blocking' };
}
```

`fallback: 'blocking'` renders pages missing from the list on the server, on the first request, instead of sending a loading page. The Pages Router's `i18n` routing does not work with `output: 'export'`.

### Nuxt

Versions: Nuxt 4 with the @nuxtjs/i18n 10 module.

Nuxt renders on the server by default. First check that `ssr: false` is not set in `nuxt.config.ts`, then that the `@nuxtjs/i18n` module uses a prefixed strategy (`prefix` or `prefix_except_default`), not `no_prefix`, which serves every language under the same URLs.

With static generation, `nuxt generate` prerenders the root and the pages it links to. Languages are only discovered if the language switcher is made of real links. Declare them explicitly to leave nothing to chance:

```ts
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/i18n'],
  i18n: {
    strategy: 'prefix_except_default',
    defaultLocale: 'fr',
    locales: [
      { code: 'fr', language: 'fr-FR', file: 'fr.json' },
      { code: 'de', language: 'de-DE', file: 'de.json' },
      { code: 'en', language: 'en-GB', file: 'en.json' },
    ],
  },
  routeRules: {
    '/': { prerender: true },
    '/de': { prerender: true },
    '/en': { prerender: true },
  },
  hooks: {
    async 'prerender:routes'(ctx) {
      for (const locale of ['de', 'en']) {
        const slugs: string[] = await fetch(`https://cms.example.com/slugs?locale=${locale}`).then((res) => res.json());
        slugs.forEach((slug) => ctx.routes.add(`/${locale}/blog/${slug}`));
      }
    },
  },
});
```

Adapt the CMS call. Load page data with `useAsyncData` or `useFetch`, which run on the server, not in `onMounted`, which only runs in the browser.

### Astro

Versions: Astro 5 and 6 (Content Layer API content collections).

Astro generates static pages by default. Pages for each language placed in folders (`src/pages/de/`) are rendered without configuration. For a dynamic route, `getStaticPaths` must return every language:

```astro
---
// src/pages/[lang]/blog/[...slug].astro
import { getCollection, render } from 'astro:content';

export async function getStaticPaths() {
  const posts = await getCollection('blog');

  return posts.map((post) => {
    const [lang, ...rest] = post.id.split('/');

    return { params: { lang, slug: rest.join('/') }, props: { post } };
  });
}

const { post } = Astro.props;
const { Content } = await render(post);
---
<Content />
```

Articles are stored in `src/content/blog/fr/`, `src/content/blog/de/`, and so on. If you configure `i18n.fallback`, Astro generates, for untranslated pages, a redirect to the fallback language (the default behavior) or, with `fallbackType: 'rewrite'`, a page that shows the other language's content under the requested URL. In the second case, check the `lang` attribute and the hreflang annotations of these pages: see [check untranslated URLs and fallbacks](https://checklist-seo-geo.com/en/multilingual-indexing-sitemaps/check-untranslated-urls-fallbacks).

### WordPress

Versions: WordPress 6.8 to 7.1, with WPML, Polylang or TranslatePress.

WordPress renders its pages on the server, in PHP. WPML, Polylang and TranslatePress serve the translated text in the HTML. The risks come from elsewhere:

- **Script-based translation**: some plugins, often in their free version, translate the page in the browser. The curl test from the "How to check" section reveals it immediately.
- **Page builders and dynamic blocks**: widgets that load their text with JavaScript (tabs, carousels, FAQs) can stay in the default language.
- **Headless WordPress**: rendering depends on the front-end framework; follow the matching section.

Test with the page cache cleared, then a second time with the cache warm: a misconfigured cache can serve the language of another URL.

### Shopify

Versions: Online Store 2.0 Liquid themes, Translate & Adapt app and Hydrogen, November 2026.

Liquid themes are rendered on the server, and translations published with Translate & Adapt or with an app that relies on Shopify's native languages end up in the HTML. Check apps that translate the store with JavaScript in the browser: the HTML then stays in the original language. With Hydrogen, the framework handles server-side rendering; check that the language is read from the URL before the Storefront API request.

### Laravel

Versions: Laravel 11 to 13, Inertia 2 and 3.

Blade and Livewire views are rendered on the server. Check that the language is set from the URL before rendering, by a middleware, and not afterwards by a script.

With Inertia (Vue or React), check that server-side rendering is enabled. With Inertia 3, the Vite plugin enables it with no extra configuration; with Inertia 2, you need an SSR entry point and a dedicated SSR build. In both cases, run `php artisan inertia:start-ssr` in production under a process manager (Supervisor, for example), and pass the current language's translations in the shared props, so that the rendering server has the text:

```php
// app/Http/Middleware/HandleInertiaRequests.php
public function share(Request $request): array
{
    return [
        ...parent::share($request),
        'locale' => app()->getLocale(),
        'translations' => fn (): array => trans('front'),
    ];
}
```

`trans('front')` returns the array from the `lang/{locale}/front.php` file. Then test each language with the script: a stopped SSR server silently makes Inertia fall back to client-side rendering.

### React, Vue or Angular without server rendering

A single-page application rendered in the browser fails the test in every language. Two options: prerender each route in each language at build time, or move to a server-rendering framework (Next.js, Nuxt, Angular SSR). See [prefer SSR/SSG for critical content if relevant](https://checklist-seo-geo.com/en/javascript-html-rendering/prefer-ssr-ssg-critical-content-if-relevant).

## Common mistakes

- **Testing only the default language**: routes forgotten in `generateStaticParams` or `getStaticPaths` almost always belong to the other languages.
- **Silent fallback to the default language**: a German page with no translation returns 200 with the French text, under a `/de/` URL.
- **Empty page generated at build time**: the CMS API failed for one language, and the build succeeded anyway. Make the build fail when a page has no content.
- **Translations loaded in `useEffect` or `onMounted`**: the server HTML contains the translation keys or the default text.
- **Language-specific hydration errors**: dates and numbers formatted differently on the server and the client (time zone, Node.js default locale). Set the locale and time zone in `Intl` calls. See [fix JS and hydration errors](https://checklist-seo-geo.com/en/javascript-html-rendering/fix-js-hydration-errors).
- **Testing with a cache warmed by another test**: clear the caches before the first pass.

## Frequently asked questions

### Should every language be prerendered at build time?

Not necessarily. On-demand server rendering, with or without incremental regeneration, works too: what matters is that the returned HTML contains the translated text. Prerendering everything at build time gets expensive when the number of languages multiplies the number of pages. Prerender the important pages of each language and let the server render the others on the first request, with no intermediate loading page.

### How can you tell whether a translated page is rendered on the server?

Download the page with curl, which does not run JavaScript, and look for a sentence from the main content in the URL's language, as well as the lang attribute of the html tag. If the sentence is missing although the browser displays it, the translation is applied by a script. Repeat the test for each language and each template: gaps between languages are common.

### Google runs JavaScript: is client-side rendering enough for secondary languages?

It is risky. Google renders JavaScript with a delay and keeps neither cookies nor local storage between pages: a translation that depends on a stored state or on an interaction will not be seen. According to published observations, most generative engine crawlers do not run JavaScript. Serve the translated text in the server HTML so that you depend on no engine.

### What should you do when a page does not exist in a language?

Do not generate a page that shows another language's text under the translated URL with a 200 status code. Return a localized 404 error, or redirect to the equivalent page in an available language, and remove the URL from the hreflang annotations and the sitemap. The choice depends on your fallback strategy, which should be decided once for the whole site.

## Resources

- [Google Search Central: Fix Search-related JavaScript problems](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript?hl=en)
- [Google Search Central: Understand the JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics?hl=en)
- [Next.js: Internationalization (App Router)](https://nextjs.org/docs/app/guides/internationalization) and [generateStaticParams](https://nextjs.org/docs/app/api-reference/functions/generate-static-params)
- [Next.js: Internationalization and static generation (Pages Router)](https://nextjs.org/docs/pages/guides/internationalization)
- [Nuxt: Prerendering](https://nuxt.com/docs/4.x/getting-started/prerendering) and [the @nuxtjs/i18n module](https://i18n.nuxtjs.org/)
- [Astro: Internationalization (i18n) routing](https://docs.astro.build/en/guides/internationalization/)
- [Inertia: Server-side rendering](https://inertiajs.com/server-side-rendering)
- [Vercel: The rise of the AI crawler (December 2024)](https://vercel.com/blog/the-rise-of-the-ai-crawler)

Next steps: [test multilingual dynamic routes](https://checklist-seo-geo.com/en/development-accessibility-language/test-multilingual-dynamic-routes) and [check per-language cache handling](https://checklist-seo-geo.com/en/development-accessibility-language/check-per-language-cache-handling).
