> For the complete documentation index, see [llms.txt](https://realisticnode.gitbook.io/rnsetups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realisticnode.gitbook.io/rnsetups/rnkoth/configuration/languages.md).

# Languages and texts

English and Spanish, a language for each player, adding a language and changing any text.

Every text players see is in `plugins/rnKoth/languages/`: chat messages, titles, boss bars, action bars, the hologram, the sidebar, menus, the editor and the Discord posts.

| File               | Language          |
| ------------------ | ----------------- |
| `languages/en.yml` | English           |
| `languages/es.yml` | Spanish (Español) |

Choose the language of the server in `config.yml`:

```yaml
language: en
```

## A language for each player

```yaml
per-player-language: true
```

Each player then sees messages, menus and boss bars in the language of their Minecraft client, when there is a file for it. A player with the game in `es_mx` or `es_es` gets `es.yml`; a player whose language has no file gets the server `language`.

Texts that everyone shares, like the hologram, the console and Discord posts, always use the server `language`.

## Changing a text

Open the language file, change the text and save. It is applied a few seconds later (with `auto-reload` on) or with `/koth reload`.

```yaml
capture:
  started: '{prefix}<yellow>{holder} <gray>is capturing {koth_name}<gray>!'
```

* **Colors**: MiniMessage (`<gold>`, `<#ff8800>`, `<gradient:#ffb000:#ffe066>`, `<bold>`) and `&` codes (`&6`, `&l`, `&#ff8800`), mixed as you like.
* **Several lines**: a message can be one line or a list of lines.
* **Turn a message off**: set it to `''` or `[]`.
* **Center a chat line**: start it with `<center>`.
* **Clicks and hovers**: `<click:run_command:/koth info {koth}>`, `<hover:show_text:"...">`.
* **`{prefix}`** is the `prefix` at the top of the file.
* The placeholders each message can use are listed next to it in the file. See [Placeholders](/rnsetups/rnkoth/reference/placeholders.md#placeholders-inside-messages).
* With PlaceholderAPI, `%...%` placeholders of the player work in messages sent to a player.

{% hint style="warning" %}
YAML needs spaces, never tabs. When a text has a `'`, write it twice: `'You can''t fly here'`. If you make a mistake, the console shows the exact line and the file uses the default texts until you fix it.
{% endhint %}

## Your changes are never overwritten

* Updates **add** the new texts to your files, with a backup in `backups/` first. Texts you changed stay as they are.
* Deleting `en.yml` or `es.yml` creates it again with the default texts on the next start or reload.

## Language words

`{@path}` in a text is replaced by the text at that path of the language file, **in the language of the player who reads it**. For example:

```yaml
# languages/en.yml
rewards:
  victory-title: '<gold><bold>VICTORY'
```

```yaml
# koths/spawn.yml
rewards:
  winner:
    - '[title] {@rewards.victory-title};{@rewards.victory-subtitle}'
```

An English player sees `VICTORY` and a Spanish player sees the Spanish text. Use this in reward texts (`[message]`, `[broadcast]`, `[title]`, `[actionbar]`, item names) so one KOTH file works for every language. You can add your own paths to the language files and use them the same way. (This `[title]` line is only an example: the default rewards have none, because winners already get the built-in `VICTORY!` title.)

In commands (`[console]` and `[player]` reward lines, `commands.on-start` and `on-end`) there is no reader, so `{@path}` uses the **server** language (`language` in `config.yml`).

The `words` section holds the small words the plugin uses everywhere: `Nobody`, the mode names (`Capture`, `Points`), the states (`Free`, `Capturing`, `Contested`), the units of time (`d`, `h`, `m`, `s`), the stat names and the schedule words (`every`, `daily`, `mon`...).

## Adding a language

1. Copy `languages/en.yml` to a new file named after the language, for example `languages/de.yml` or `languages/pt.yml`.
2. Translate the texts and save.
3. Set `language: de` in `config.yml`, or use `per-player-language: true`.

Use the language part of the Minecraft locale as the file name (`de` for `de_de`, `pt` for `pt_br`). You can also make a file for one locale only, like `pt_br.yml`.

Texts missing from your file are added in English when the file is loaded, so the plugin never shows an empty message. The new language also appears in `/koth editor` → General settings → **Language**.

{% hint style="success" %}
Made a translation? Share it on our [Discord](https://discord.gg/GzxW2FANPB) so other server owners can use it too.
{% endhint %}
