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

# Markets & languages

> Answer each visitor from their market's content plus shared content. URL rules set the market and, when a page doesn't declare one, the language; every conversation then follows one language.

If your site serves more than one market, you can tag your knowledge so the chatbot answers each visitor with the content meant for them.

<Note>
  **Most sites don't need this.** If one set of answers serves everyone, skip this page. The chatbot already replies in whatever language the visitor writes in.
</Note>

## Two separate things

<CardGroup cols={2}>
  <Card title="Market" icon="users">
    **Where** the content applies: a country or region that you define. Germany and Austria are two markets.
  </Card>

  <Card title="Language" icon="globe">
    **What** a page is written in. It's read from the page itself, so you don't set it on knowledge.
  </Card>
</CardGroup>

A market has no language of its own. One market can span several: Switzerland can be one market with rules for `/ch-de`, `/ch-fr` and `/ch-it`, and each page keeps its own language.

<Tip>
  Anything without a market is used for **every** visitor. That's how one shared English page keeps working in every market.
</Tip>

## Set up markets

Say your site is English at `example.com`, German at `example.com/de` and Swedish at `example.com/sv`.

<Steps>
  <Step title="Create a market for each country">
    Go to **Settings → Markets** and create one market per country:

    | Code | Label |
    | - | - |
    | `de` | Germany |
    | `sv` | Sweden |

    Don't create one for English. Content without a market is shared: everyone gets it.
  </Step>

  <Step title="Crawl your whole site once">
    Under **Knowledge → Web pages**, add one entry for `example.com` with **All markets**. No exclude paths are needed.

    Each page gets its language from the page itself (`<html lang="de">`) and its market from the rules in the next step. Files, articles and Q\&As get their market on the form where you create them.
  </Step>

  <Step title="Add a rule per market">
    On your chatbot's **Localization** tab, under **Detect market and language from URL**, add a rule per market:

    | Match | Market | Language |
    | - | - | - |
    | Path starts with `/de` | Germany | Language from page |
    | Path starts with `/sv` | Sweden | Language from page |

    Rules are checked top to bottom, and the first match wins. A rule sets a market, a language, or both. The same rules tag your crawled pages, and saving them retags pages you've already crawled.
  </Step>
</Steps>

## What each visitor gets

| Visitor is on | Answers come from |
| - | - |
| `/de/preise` | Germany's pages **+ shared pages** |
| `/sv/priser` | Sweden's pages **+ shared pages** |
| `/pricing` | Shared pages, plus one market's pages when it's the only market with content in the visitor's language |

A visitor never gets another market's content. If Germany and Austria both have German content, a German-writing visitor on `/pricing` gets shared pages only.

Language doesn't decide which facts are used, only which pages are linked. The chatbot links a page only when it's written in the visitor's language or in the language of the page they're on. Other pages can still inform the answer. Help center articles link to their public page.

## Which language the widget speaks

Each conversation has one language. Before the visitor types, it's the first of these that gives one:

1. The language of the URL rule that matched
2. The language your page declares (`<html lang="sv">`)
3. A language at the start of the page's path (`/sv/…` or `/sv-SE/…`)
4. The visitor's browser language
5. Your default widget language

Your greeting, teaser and suggested questions use that language if you've enabled it, and your default widget language otherwise.

The AI replies in the conversation's language. It switches only when the visitor clearly writes in another language — a short "ok" or "thanks" doesn't count.

The widget's own buttons and labels follow the conversation's language and switch with it, in English or Swedish. In any other language they show in English. Your greeting and other texts stay in the language the conversation started with.

## Common questions

<AccordionGroup>
  <Accordion title="Should a rule set a market, a language, or both?">
    A market when that part of your site is a different market: it decides which knowledge is used.

    A language only when those pages don't declare one in `<html lang>`. It sets where the conversation starts and which pages can be linked, and never leaves content out of answers.
  </Accordion>

  <Accordion title="Why is Delete greyed out on a market?">
    Because knowledge is still tagged with it. The **Usage** column on that row is the count.

    Open those items and set them back to **All markets**, then delete.
  </Accordion>

  <Accordion title="My market's language isn't one of my widget languages">
    The chatbot still answers from that market's knowledge, in the visitor's language. Only your greeting, teaser and suggested questions fall back to your default widget language.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.