# Languages

### Supported Languages

| Language | Code | File          |
| -------- | ---- | ------------- |
| English  | `en` | `lang/en.yml` |
| German   | `de` | `lang/de.yml` |
| Spanish  | `es` | `lang/es.yml` |
| French   | `fr` | `lang/fr.yml` |
| Polish   | `pl` | `lang/pl.yml` |

### Setting the Language

In your `config.yml`:

```yaml
# Available languages: en, de, es, fr, pl
language: en
```

You can also change the language in-game using `/spawnelytra settings`.

### Language Files

Language files are automatically created in:

```
plugins/SpawnElytra/lang/
```

#### File Structure

Each language file contains these messages:

```yaml
# Example: English (en.yml)
press_to_boost: "<#91f251>Press <bold><#74ea31><key:key.swapOffhand></bold> <#91f251>to boost yourself"
boost_activated: "<#74ea31>Boost activated!"
failed_update_check: "<#fd5e5e>Failed to check for updates: <error_message>"
no_permission: "<#fd5e5e>You don't have permission to use this command."
command_player_only: "<#fd5e5e>This command can only be used by players."
reload_success: "<#91f251>SpawnElytra configuration reloaded..."
# ... other messages
```

### Customizing Messages

#### Editing Language Files

1. Navigate to `plugins/SpawnElytra/lang/`
2. Open the language file you want to modify
3. Edit the messages
4. Save the file
5. Use `/spawnelytra reload` to apply changes

### Color Formatting

Messages use [MiniMessage format](https://docs.papermc.io/adventure/minimessage/format/):

```yaml
# Hex colors
press_to_boost: "<#91f251>Press <bold><#74ea31>F</bold> to boost"

# Named colors
boost_activated: "<green>Boost activated!"

# Formatting tags
reload_success: "<bold>Configuration</bold> reloaded."
```

Common formatting:

* `<bold>` - Bold text
* `<italic>` - Italic text
* `<underlined>` - Underlined text
* `<#RRGGBB>` - Hex color codes
* `<green>`, `<red>`, etc. - Named colors

### Message Style

The plugin supports two message styles:

1. **Classic** - Normal text display
2. **Small Caps** - Stylized ꜱᴍᴀʟʟ ᴄᴀᴘꜱ display

Change the style in `config.yml`:

```yaml
messages:
  style: classic  # or small_caps
```

### Show/Hide Messages

Control which messages appear:

```yaml
messages:
  show_press_to_boost: true
  show_boost_activated: true
  show_creative_disabled: false
```

### Creating Custom Translations

#### Adding a New Language

1. Create a new file in `plugins/SpawnElytra/lang/` (e.g., `lang/it.yml` for Italian)
2. Copy structure from `en.yml`
3. Translate all messages
4. Update `config.yml` to use the new language code
5. You can submit your translation via [GitHub](https://github.com/blax-k/SpawnElytra/issues/new) using the "enhancement" label

### Troubleshooting

#### Messages Not Changing

1. Verify the language code in config.yml
2. Ensure the language file exists in the `lang/` directory
3. Use `/spawnelytra reload` after changes
4. Check console for any error messages

#### Encoding Issues

* Save files as UTF-8
* Don't use text editors that change encoding
* Test special characters in-game

#### Missing Translations

If a message is missing from a language file:

1. The plugin falls back to English
2. Check console for warnings
3. Add missing keys to the language file

### Contributing Translations

#### Easy Way

Go to the [GitHub issues page](https://github.com/blax-k/SpawnElytra/issues/new), create an issue, paste in your language file, and choose the label "enhancement".

#### Pull Request

1. Fork the project on GitHub
2. Create language file in `src/main/resources/lang/` directory
3. Translate all messages
4. Test in-game
5. Submit pull request

### See Also

* [Configuration](https://blaxk.gitbook.io/spawnelytra/configuration) - Message configuration options
* [Commands](https://blaxk.gitbook.io/spawnelytra/commands) - Reload command usage
