Changing Language

You can choose a language from available ones or you can create your own


Choosing a language

Config.lua
```lua
-- Language for notifications, UI, etc.
-- "en", "pl", "es"
KOJA.Locale = 'en'
```

Creating a language

First create a json file inside locales folder with name of your language

Example json file name
pl.json

Copying and editing all words inside your json file

```json
{
  "ui": {
    "down": "DOWN",
    "up": "UP",
    "left": "LEFT",
    "right": "RIGHT",
    "in": "ZOOM IN",
    "out": "ZOOM OUT",
    "search": "Search...",
    "exit": "EXIT",
    "rating": "Rating",
    "steering": "Steering",
    "na": "Not Available",
    "acceleration": "Acceleration",
    "speed_unit": "KM/H",
    "max_speed": "Maximum Speed",
    "select_primary_color": "Select Vehicle Color",
    "payment": "Payment",
    "total_price": "Total Price",
    "purchase_button": "Purchase",
    "test_drive_button": "Test Drive"
  },
  "game": {
    "confirm": "Confirm",
    "cancel": "Cancel",
    "open_menu": "Vehicle catalog opened!",
    "noPerms": "You are not allowed to do this!",
    "purchase_modal": {
      "purchase_confirm": "Vehicle successfully purchased. Registration: %plate",
      "purchase_enough_both": "You do not have sufficient funds.",
      "purchase_enough_cash": "You do not have enough cash.",
      "purchase_enough_bank": "You do not have enough money in your bank account.",
      "purchase_enough_error": "Payment configuration error!"
    },
    "drivetest": {
      "startNotify": "You have %seconds to test drive the vehicle!",
      "endNotify": "Test drive ended!"
    },
    "notification": {
      "notify": "Notification",
      "success": "Action completed successfully",
      "error": "An error occurred",
      "duration": 5000
    }
  }
}

```

Choosing the language you created in config.lua after the json name for my example "pl"

Config.lua
```lua
-- Language for notifications, UI, etc.
-- "en", "pl", "es"
KOJA.Locale = 'pl'
```

Last updated