> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hadoseo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-lingual App Pre-rendered in Wrong Language

> Fix language detection issues when pre-rendering multi-language apps

If your app supports multiple languages but pre-renders always show one language (usually English), the language detection isn't working for bots.

## Why This Happens

Many apps detect language using:

* Browser `Accept-Language` header
* User's saved preference (cookies/localStorage)
* Geolocation

Bots don't have these signals, so they see the default language.

## Solutions

<AccordionGroup>
  <Accordion title="Use URL-based language routing (Recommended)" icon="link">
    The most reliable solution is putting the language in the URL:

    ```
    https://example.com/en/about
    https://example.com/ja/about
    https://example.com/es/about
    ```

    Benefits:

    * Each language version has a unique URL
    * Google can index each version separately
    * Pre-rendering works correctly
    * Users can share links in specific languages
  </Accordion>

  <Accordion title="Add hreflang tags" icon="globe">
    Tell Google about language versions:

    ```html theme={null}
    <link rel="alternate" hreflang="en" href="https://example.com/en/about" />
    <link rel="alternate" hreflang="ja" href="https://example.com/ja/about" />
    <link rel="alternate" hreflang="x-default" href="https://example.com/about" />
    ```
  </Accordion>

  <Accordion title="Set a default pre-rendering language in Hado SEO" icon="gear">
    You can set a **default pre-rendering language** for your domain in your [Domain Settings](/dashboard/domain-settings). The renderer will use this language when pre-rendering your pages, so you don't need to change any code.

    This is the simplest option if your site primarily serves one language to search engines.
  </Accordion>

  <Accordion title="Detect HadoBot in your app code" icon="robot">
    If you need more control, you can detect Hado SEO's renderer and serve a specific language:

    ```javascript theme={null}
    const isHadoBot = /HadoBot/i.test(navigator.userAgent);
    const language = isHadoBot ? 'en' : detectUserLanguage();
    ```

    Hado SEO's renderer identifies itself with `HadoBot/1.0` in the user agent string.

    This is less ideal because:

    * Only one language version gets pre-rendered per URL
    * You can't have separate Google listings per language
  </Accordion>
</AccordionGroup>

## Sitemap for Multi-lingual Sites

Create separate sitemap entries for each language version:

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://example.com/en/about</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/about"/>
    <xhtml:link rel="alternate" hreflang="ja" href="https://example.com/ja/about"/>
  </url>
  <url>
    <loc>https://example.com/ja/about</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/about"/>
    <xhtml:link rel="alternate" hreflang="ja" href="https://example.com/ja/about"/>
  </url>
</urlset>
```
