> For the complete documentation index, see [llms.txt](https://swampys.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swampys.gitbook.io/docs/resources/gta-6-hud/translation.md).

# Translation

Add a new language to GTA 6 HUD.

{% stepper %}
{% step %}

#### Create a locale file

Open the **locales** folder, copy **en.lua**, and rename the copy with the new language code. Example:

```
locales/it.lua
```

{% endstep %}

{% step %}

#### Rename and translate the dictionary

Change the locale key and translate every string while keeping the same structure:

```lua
Locales = Locales or {}

Locales.it = {
    wheel = {
        weapons = 'ARMI',
        items = 'OGGETTI',
        clothing = 'ABBIGLIAMENTO',
    },
    -- Keep every remaining key from en.lua.
}
```

Do not rename dictionary keys used by the script.
{% endstep %}

{% step %}

#### Add the locale to fxmanifest.lua

Add the new file to **shared\_scripts**:

```lua
shared_scripts {
    'config.lua',
    'locales/en.lua',
    'locales/fr.lua',
    'locales/it.lua',
    'shared/locale.lua',
    'shared/framework.lua',
}
```

{% endstep %}

{% step %}

#### Select the language

Open **config.lua**:

```lua
Config.Locale = 'it'
```

Restart **gta6-hud** after changing or adding locale files.

{% hint style="info" %}
Missing strings automatically fall back to English.
{% endhint %}
{% endstep %}
{% endstepper %}
