> 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-advanced-taxi-job/localization.md).

# Localization

Change any CAS Advanced Taxi Job text or add a new language with one locale file.

Every text the players see comes from one language file in `locales/`: prompts, notifications, telegrams, the office, the board, the tickets, passenger lines and the Discord log. English (`en.lua`) and Turkish (`tr.lua`) are included.

```lua
Config.Locale = 'en'
```

The NUI receives its texts from the same file when it starts, so changing a text needs no build. Restart the resource after an edit.

## Changing a text

Open the language file and change the text on the right. Keep the key on the left as it is.

```lua
ui_board_title = "CAB DISPATCH",
```

Keep the placeholders in the same order: `%s` is a text, `%d` a whole number, `%.2f` an amount. A text with a wrong placeholder falls back to the plain text.

A key missing from your language file falls back to English.

## Adding a language

1. Copy `locales/en.lua` to a new file, for example `locales/fr.lua`.
2. Change the first lines from `Locales.en = {` to `Locales.fr = {`.
3. Translate the texts.
4. Add the file to `fxmanifest.lua` under `shared_scripts`, after `locales/tr.lua`:

```lua
shared_scripts {
    'config.lua',
    'locales/en.lua',
    'locales/tr.lua',
    'locales/fr.lua',
    ...
}
```

5. Set `Config.Locale = 'fr'`.
6. Run `refresh` and then `ensure cas-taxi` in the server console. `refresh` is needed because the manifest changed.

## Passenger lines

NPC passengers speak by tone. The lines are the `say_<tone>_<moment>` keys, for example `say_posh_bump`. The tones are `posh`, `common` and `clergy`, the moments `greet`, `bump`, `slow`, `arrive` and `angry`. A passenger's tone is set in `Config.Passengers`.
