> ## Documentation Index
> Fetch the complete documentation index at: https://zyra-store.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Localization and languages in Zyra Store scripts for FiveM

> Configure the language of Zyra Store scripts and learn how to customize or create your own translations in the localization file.

Zyra Store scripts are ready to work in multiple languages out of the box. All player-visible text — notifications, menus, error messages, and warnings — is loaded from an independent localization file, allowing you to change the script language with a single setting or create your own translations without touching the source code.

## Available languages

The following languages are officially included with each script:

* 🇪🇸 **Español** (`es`)
* 🇬🇧 **English** (`en`)
* 🇫🇷 **Français** (`fr`)
* 🇩🇪 **Deutsch** (`de`)
* 🇧🇷 **Português** (`pt`)

## Change the language

To change the script language, open `shared/config.lua` and update the `Config.Locale` value with the code of the language you want:

```lua shared/config.lua theme={null}
Config.Locale = 'en'  -- change 'es' to the desired language code
```

After saving the file, restart the resource from the server console (`restart resource_name`) for the change to take effect. The script will automatically load the corresponding file in the `locales/` folder.

## Localization file structure

Each language has its own file inside the `locales/` folder. Its structure is simple: a `Locales` table where each key is an internal identifier and its value is the text the player will see.

```lua locales/es.lua theme={null}
Locales = {}

Locales['notify_success']    = 'Acción realizada con éxito.'
Locales['notify_error']      = 'Ha ocurrido un error. Inténtalo de nuevo.'
Locales['notify_no_perms']   = 'No tienes permisos para realizar esta acción.'
Locales['notify_cooldown']   = 'Debes esperar %s segundos antes de volver a usar esto.'
Locales['menu_title']        = 'Menú Principal'
Locales['menu_close']        = 'Cerrar'
```

### Placeholders `%s`

Some texts contain the `%s` placeholder, which the script replaces at runtime with a dynamic value. For example, in `notify_cooldown` the `%s` will be replaced by the remaining cooldown seconds. You can move the placeholder within the sentence to adapt it to your language grammar, but **do not remove it** if it appears in the original, as the script needs it to insert that data.

## Create a custom translation

If you want to use a language that is not included or customize existing texts, follow these steps:

**1. Duplicate an existing localization file**

Copy a file from a language that will serve as a base, for example `locales/es.lua`, and rename it with the code of your new language:

```text theme={null}
locales/es.lua  →  locales/my_language.lua
```

**2. Edit the values keeping the keys intact**

Open `locales/my_language.lua` and translate only the right-hand part of each line (the text in quotes). **Do not modify the key names** (the left-hand part, such as `notify_success`), as the script uses them to look up texts internally.

```lua locales/my_language.lua theme={null}
Locales['notify_success'] = 'Your translated text here.'
Locales['notify_error']   = 'Another translated text.'
-- ...
```

**3. Update Config.Locale in config.lua**

Tell the script to load your new localization file:

```lua shared/config.lua theme={null}
Config.Locale = 'my_language'
```

**4. Restart the resource**

Apply the changes by restarting the resource from the server console:

```text theme={null}
restart resource_name
```

Verify that the in-game texts appear in the new language. If any text still shows in the previous language, check that the file name matches exactly the value of `Config.Locale`.

> [!WARNING]
>
> **Do not modify the localization key names**, only the values. If you change or delete a key (such as `notify_success`), the script will not be able to find that text and will display an error in the console or a blank message to the player.

> [!TIP]
>
> If you have created a translation into a language that is not yet officially available, consider sharing it with the Zyra Store community. You can send it to us through our Discord server so other servers can benefit from your work and we can incorporate it as an official language in future versions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.