> For the complete documentation index, see [llms.txt](https://docs.sourcedev.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sourcedev.pro/advanced-billing-system/translations.md).

# Translations

The Billing System supports multiple languages. By default, it includes English (EN) and Turkish (TR) translations.

## Changing the Language

To change the system language, edit `Config.Language` in `config.lua`:

```lua
Config.Language = 'en' -- Options: 'en', 'tr'
```

***

## Adding a New Language

Adding a new language involves two steps: translating the Lua strings (Server/Client) and the React UI strings.

### Step 1: Lua Translations

1. Navigate to the `languages/` folder.
2. Copy `en.lua` and rename it to your language code (e.g., `fr.lua`).
3. Open the file and translate all the values in the table.
4. Open `fxmanifest.lua` and add your new file to the `files` section:

   ```lua
   files {
       'languages/*.lua', -- This already covers all .lua files in the folder
       -- ...
   }
   ```

### Step 2: UI Translations

The UI translations are managed in the `web/src/locales/translations.ts` file (if you are building from source) or automatically loaded from the Lua files if the bridge supports it.

In this version, the UI automatically fetches translations from the Lua files using the `src-billing:client:openTablet` message.

**To ensure your new language works in the UI:**

1. Ensure your `languages/XX.lua` file is correctly formatted as a Lua table.
2. The `client/main.lua` function `getAllLocales()` should ideally be updated to include your new language if it's not dynamically scanning:

```lua
-- In client/main.lua
local function getAllLocales()
    return {
        en = loadLocaleTable('en'),
        tr = loadLocaleTable('tr'),
        fr = loadLocaleTable('fr'), -- Add your language here
    }
end
```

***

## Translation Contribution

If you translate the system into a new language, please consider sharing it with the community or submitting a Pull Request!

### Current Supported Languages:

* 🇬🇧 **English (en)** - Default
* 🇹🇷 **Turkish (tr)** - Full support

***

{% hint style="success" %}
**Tip:** You can use HTML tags in some descriptions and reason fields if they are supported by the framework's notification system.
{% endhint %}
