> For the complete documentation index, see [llms.txt](https://atiysus-organization.gitbook.io/aty-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atiysus-organization.gitbook.io/aty-scripts/zone-creator/guide/localization-tr-en.md).

# Localization (TR / EN)

One config key drives **both** the admin panel (NUI) **and** every in-game notification (Lua), so the whole resource speaks one language.

```lua
-- config.lua
Config.Language = 'en'   -- 'en' | 'tr'
```

Ships with **English** and **Turkish**. A missing translation falls back to English, so nothing ever shows blank.

### How it works

| Side                            | Where the strings live                                                         |
| ------------------------------- | ------------------------------------------------------------------------------ |
| **In-game notifications** (Lua) | `shared/locale.lua` — the `L('key', ...)` function.                            |
| **Admin panel** (NUI)           | `web/src/i18n/locales/<code>.js` — gettext-style, the English text is the key. |

The server sends the active language to the panel in its `open` payload, so both sides always match `Config.Language`.

### Adding a new language (e.g. German)

#### 1. In-game notifications

In `shared/locale.lua`, copy the `Locales.en` table to `Locales.de` and translate the values — **keep the `%s` / `%d` placeholders in the same order** (Lua `string.format` is positional).

#### 2. Panel

Create `web/src/i18n/locales/de.js` exporting a map of *English phrase → German*, then register it in `web/src/i18n/index.js`:

```js
import de from './locales/de'
const dictionaries = { tr, de }
```

#### 3. Rebuild the panel

```bash
cd web
npm install   # first time only
npm run build
```

Then set `Config.Language = 'de'` and restart the resource.

{% hint style="info" %}
Panel UI text is translated at the leaf components, so **field labels, hints and dropdown options all localize automatically** — you only maintain one dictionary file per language. Technical values (weapon hashes, weather codes, ped models, job names) are intentionally left untranslated.
{% endhint %}

### What is / isn't translated

* **Translated:** panel chrome, all 15 section labels + hints, dropdown options, buttons, HUD, warnings, toasts, and in-game notifications/kick reasons.
* **Not translated:** audit-log entries and game identifiers (see the note above).
