# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sourcedev.pro/advanced-billing-system/translations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
