> For the complete documentation index, see [llms.txt](https://doc.var-fivem.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.var-fivem.com/coins-shop/configuration/languages.md).

# Languages

Var Coins Shop ships with FR / EN / ES translations. Adding a language is a 2-step process.

### Configure available languages

In `shared/config.lua`:

```lua
Language = {
  Default = "en",
  Fallback = "en",
  AllowClientSelection = false, -- true = the player can change language from the UI
  Available = {
    fr = { label = "Francais" },
    en = { label = "English" },
    es = { label = "Espanol" },
  }
}
```

| Key                    | Effect                                                  |
| ---------------------- | ------------------------------------------------------- |
| `Default`              | Locale used for new accounts                            |
| `Fallback`             | Locale used when a translation key is missing           |
| `AllowClientSelection` | If false, the player cannot change language from the UI |
| `Available`            | Map of locale code → label shown in UI                  |

### Add a new language

Example: add German.

**Step 1.** Add the entry in `Available`:

```lua
Available = {
  fr = { label = "Francais" },
  en = { label = "English" },
  es = { label = "Espanol" },
  de = { label = "Deutsch" }, -- new
}
```

**Step 2.** In `shared/locales.lua`, copy the existing `en = { ... }` block and translate it:

```lua
de = {
  shop = {
    title = "Cash-Shop",
    -- ...
  },
  errors = {
    insufficientFunds = "Nicht genug Coins.",
    -- ...
  },
}
```

The script will automatically pick up the new locale on resource restart.

### Per-player locale persistence

Each player's locale is stored in `coins_shop_accounts.locale`. It is updated when:

* The player switches language from the UI (only if `AllowClientSelection = true`)
* You call the server event `var-shop:setLocale` from a custom flow

The `localeUpdate` webhook is fired on every change.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.var-fivem.com/coins-shop/configuration/languages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
