# localization

## Overview

The script supports multiple languages. Translation files are located in:

```
data/
└── language/
    ├── en.json
    └── pl.json
```

***

## Changing Language

Open `shared/config.lua` and change the locale:

```lua
Config.Locale = 'en' -- 'pl' or 'en'
```

***

## Available Languages

| Code | Language |
| ---- | -------- |
| en   | English  |
| pl   | Polish   |

***

## Translation Structure

### DUI Showroom

```json
{
    "dui": {
        "header_title": "Check out your dream vehicle now",
        "category_all": "All",
        "category_select": "Select Vehicle Category",
        "stock_available": "In Stock",
        "stock_count": "In Stock: {0}",
        "stock_unavailable": "Out of Stock"
    }
}
```

| Key                | Description                         |
| ------------------ | ----------------------------------- |
| header\_title      | Main title on DUI showroom          |
| category\_all      | "All categories" filter option      |
| category\_select   | Category dropdown placeholder       |
| stock\_available   | Badge text when in stock            |
| stock\_count       | Stock count with number placeholder |
| stock\_unavailable | Badge text when out of stock        |

***

### Target Interactions

```json
{
    "target": {
        "enter_showroom": "Check Offer Vehicles",
        "exit_showroom": "Exit Showroom",
        "set_random_tuning": "Set Random Tuning",
        "open_catalog": "Open Vehicle Catalog"
    }
}
```

| Key                 | Description                        |
| ------------------- | ---------------------------------- |
| enter\_showroom     | Target label for entering showroom |
| exit\_showroom      | Target label for exit interaction  |
| set\_random\_tuning | Target label for random tuning     |
| open\_catalog       | Target label for NUI catalog       |

***

### Tuning Menu

```json
{
    "tuning": {
        "bone_bonnet": "Hood",
        "bone_boot": "Trunk",
        "bone_door_driver_front": "Driver Door",
        "bone_door_passenger_front": "Passenger Door",
        "bone_door_driver_rear": "Rear Door (L)",
        "bone_door_passenger_rear": "Rear Door (R)",
        "bone_wheels": "Wheels and Tires",
        "bone_exhaust": "Exhaust",
        "bone_bumper_front": "Front Bumper",
        "bone_bumper_rear": "Rear Bumper",
        "no_mods_available": "No modifications available for this part",
        "stock": "Stock (Original)",
        "currently_applied": "Currently applied",
        "click_to_apply": "Click to apply",
        "restore_original": "Restore original",
        "reset_to_stock": "Reset to stock",
        "applied": "Applied: {0}",
        "random_colors_applied": "Random colors applied",
        "color": "Color: {0}",
        "window_tint": "Window Tint: {0}",
        "toggle_on": "Turn On {0}",
        "toggle_off": "Turn Off {0}",
        "is_installed": "{0} is installed",
        "install": "Install {0}",
        "turned_on": "{0} turned on",
        "turned_off": "{0} turned off",
        "level": "{0} Level {1}",
        "primary_color": "Primary Color",
        "secondary_color": "Secondary Color",
        "pearlescent_color": "Pearlescent Color",
        "random_colors": "Random Colors"
    }
}
```

***

### NUI Interface

```json
{
    "ui": {
        "search_placeholder": "Search vehicle...",
        "selected": "Selected",
        "category": "Category",
        "price": "Price",
        "max_speed": "Max. Speed",
        "production_year": "Production Year",
        "speed": "Speed",
        "acceleration": "Acceleration",
        "handling": "Handling",
        "braking": "Braking",
        "in_stock": "In Stock",
        "out_of_stock": "Out of Stock",
        "no_return": "Purchased vehicle is non-refundable",
        "random_tuning": "Apply Random Tuning",
        "buy_vehicle": "Buy Vehicle",
        "test_drive": "Test Drive"
    }
}
```

***

### Vehicle Categories

```json
{
    "categories": {
        "All": "All",
        "Compacts": "Compacts",
        "Sedans": "Sedans",
        "SUVs": "SUVs",
        "Coupes": "Coupes",
        "Muscles": "Muscles",
        "Sports Classics": "Sports Classics",
        "Sports": "Sports",
        "Super": "Super",
        "Motorcycles": "Motorcycles",
        "Off-Road": "Off-Road",
        "Vans": "Vans",
        "Cycles": "Cycles",
        "Boats": "Boats"
    }
}
```

***

### Test Drive

```json
{
    "testdrive": {
        "time_remaining": "TIME REMAINING",
        "started": "Test Drive Started",
        "started_desc": "Return the vehicle to the marked zone before time runs out",
        "return_zone": "Return Zone",
        "return_zone_desc": "Press E to return the vehicle",
        "returned": "Vehicle Returned",
        "returned_desc": "Thank you for returning the vehicle",
        "expired": "Test Drive Expired",
        "expired_desc": "You did not return the vehicle in time",
        "penalty": "Penalty Applied",
        "penalty_desc": "You have been charged for not returning the vehicle"
    }
}
```

***

### Notifications

```json
{
    "notifications": {
        "purchase_success": "Vehicle Purchased",
        "purchase_success_desc": "Your new vehicle is waiting for you",
        "purchase_failed": "Purchase Failed",
        "not_enough_money": "You don't have enough money",
        "vehicle_added": "Vehicle Added",
        "vehicle_added_desc": "Vehicle has been added to your garage"
    }
}
```

***

## Adding New Language

{% stepper %}
{% step %}

### Create the file

Create a new JSON file in `data/language/` (e.g., `de.json` for German).
{% endstep %}

{% step %}

### Copy structure

Copy the structure from `en.json`.
{% endstep %}

{% step %}

### Translate

Translate all values in the new JSON file.
{% endstep %}

{% step %}

### Enable language

Update `Config.Locale` to your language code in `shared/config.lua`.
{% endstep %}
{% endstepper %}

Example (German):

```json
{
    "dui": {
        "header_title": "Entdecken Sie jetzt Ihr Traumfahrzeug",
        "category_all": "Alle",
        "category_select": "Fahrzeugkategorie auswählen",
        "stock_available": "Auf Lager",
        "stock_count": "Auf Lager: {0}",
        "stock_unavailable": "Nicht verfügbar"
    }
}
```

***

## Placeholders

Some translations use placeholders:

| Placeholder | Description          |
| ----------- | -------------------- |
| {0}         | First dynamic value  |
| {1}         | Second dynamic value |

Example: `"level": "{0} Level {1}"` becomes "Engine Level 4"
