> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-redm-cars/localization.md).

# Localization

Translate CAS RedM Cars. Where every player-visible text lives and how to add a language.

Every text players see comes from a locale file. English ships.

## Where the texts are

| Script         | Game texts (prompts, notices, map names) | Interface texts          |
| -------------- | ---------------------------------------- | ------------------------ |
| cas-car1910    | `locales/en.lua`                         |                          |
| cas-carpack    | `locales/en.lua`                         |                          |
| cas-fuel       | `locales/en.lua`                         |                          |
| cas-dealership | `locales/en.lua`                         | The showroom page        |
| cas-garage     | `locales/en.lua`                         | The garage page          |
| cas-vehiclehud | `locales/en.lua`                         | The HUD and its settings |
| cas-carrepair  | `locales/en.lua`                         | The repair panel         |

Car names, class names and paint colour names are part of each script's config (`Config.Vehicles`, `Config.Categories`, the paint lists), so you can rename them there directly.

## Adding a language to the game texts

1. Copy `locales/en.lua` to `locales/<code>.lua` in the same folder (for example `locales/de.lua`).
2. Change the table name to your code (`Locales.de = { ... }`) and translate the texts.
   * Keep every `%s`, `%d` and `%.2f` in its place: they are filled in by the script.
   * A key you leave out falls back to English.
3. Set the language in the script's config:
   * `Config.Locale = "de"`;
   * for cas-car1910: `locale = 'de'` in `shared/config.lua`.

## Interface texts

The showroom, garage, HUD and repair pages are built web pages: their English texts are compiled into them. For another language on these pages, contact us with your translation and we send you the rebuilt pages.
