> For the complete documentation index, see [llms.txt](https://tgiann.gitbook.io/tgiann/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tgiann.gitbook.io/tgiann/main/how-to-change-the-language-file.md).

# How to Change the Language File

TGIANN scripts support a **multi-language system**. Players can change their language:

* Using the `/language` command
* Or via the `/hud` menu inside **tgiann-lumi-hud**

When adding a new language file or changing the default language, follow the steps below carefully.

***

### 1) Change the Default Language in tgiann-core

Open the `tgiann-core` config file and modify the language key:

```
config.lang = "en"
```

Replace `"en"` with your desired language key.\
Example:

```
config.lang = "de"
```

***

### 2) Create Your Language File (For All Scripts)

Each TGIANN script has its own `languages` folder.\
This process must be applied to **every TGIANN script**, not only `tgiann-core`.

#### Steps:

1. Go to the script’s `languages` folder.
2. Copy the existing `en.lua` file.
3. Rename the copied file to your new language key.\
   Example: `de.lua`
4. Open the new file and update the **first line**.

Example:

* Old:

  ```
  config.langs.en = {
  ```
* New:

  ```
  config.langs.de = {
  ```

If you are adding a different language, replace `en` with your own language key.

Repeat this process for all TGIANN scripts.

***

### 3) Clear the Database Table for Existing Players

For players who have already joined the server, their language preference is saved in the database.

If you set a new default language using:

```
config.lang = "new_key"
```

You must clear the `tgiann_core_lang` database table.

Otherwise, players will continue to see the last language they used instead of the new default language.

***

### Important Notes

* When a player joins the server, the language is set based on `config.lang`.
* Each time the player connects, this saved language preference is loaded.
* Do **not** delete existing language files.
* Instead, add new language files and update the main `tgiann-core` config:

```
config.lang = "new_key"
```

***

### Final Step

After completing all changes, restart the scripts and make sure the language files are working properly.
