> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-dm-tennis/leaderboard-and-languages.md).

# Leaderboard And Languages

What the leaderboard records, where it is stored, and how to translate the resource.

### Leaderboard

With `Config.Stats.enabled = true` the server records, for every player:

* **Wins** and matches played
* **Aces** and **winners**
* **Longest rally**
* **Fastest serve**

The **Leaderboard** tab in every court terminal lists the best players, up to `Config.Stats.leaderboardSize`, and highlights the player reading it.

Stats are keyed by the player's license identifier, so they follow the player across characters and name changes. Computer players are never recorded.

#### Storage

Stats are kept in the resource's own **KVP storage** on the server. There is no SQL table and nothing to import.

* Records live under the keys `dmt:index` (the list of players) and `dmt:p:<license>` (one per player) in the server's KVP store, which FiveM keeps inside your server data folder. They survive restarts and resource updates.
* To turn stats off without deleting them, set `Config.Stats.enabled = false`. The Leaderboard tab disappears and nothing new is recorded.
* To start the leaderboard fresh, ask in the DevMosaic Discord for the reset snippet; there is no in-game command, so it cannot be triggered by accident.

### Languages

Every text the resource shows comes from one file per language in:

```
locales/
```

`en.lua` (English) and `ar.lua` (Arabic) are included. `Config.Locale` picks the one in use.

#### Adding A Language

1. Copy `locales/en.lua` to `locales/<code>.lua`, for example `locales/de.lua`.
2. Change the language code at the top of the file to match.
3. Translate the right-hand side of each line. Keep the keys on the left and any `%s` placeholders.
4. Set `Config.Locale = 'de'` and restart the resource.

The terminal screen, the scoreboard, the calls, the key hints in **Settings > Key Bindings > FiveM** and the result board on the court all follow the chosen language. Match-length buttons use the `format_*` keys, so a new entry in `Config.Formats` needs a matching line in each locale file.
