> ## Documentation Index
> Fetch the complete documentation index at: https://items.lodemc.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Translations and dialogs

> Show text in each player's own language, and open dialog screens.

## Translations

Write the same text in several languages, and each player sees the one their game is set to.

```yaml items/lang/texts.yml theme={null}
my_texts:
  type: translations
  en_us:
    item.myserver.ruby: "Ruby"
    item.myserver.ruby.lore: "A polished gemstone."
  de_de:
    item.myserver.ruby: "Rubin"
    item.myserver.ruby.lore: "Ein polierter Edelstein."
```

Use them anywhere text goes, with `<lang:key>`:

```yaml theme={null}
ruby:
  name: "<red><lang:item.myserver.ruby>"
  lore:
    - "<gray><lang:item.myserver.ruby.lore>"
  texture: ruby.png
```

Locales are Minecraft's language codes: `en_us`, `de_de`, `fr_fr`, `pt_br` and so on. Players whose language has no text for a key see the `en_us` text. Several files can add to the same language.

## Dialogs

A dialog is a screen with text, buttons and input fields (Minecraft 1.21.6 and later). Write it in Minecraft's own dialog format under `dialog:`. Minecraft checks it when the config loads.

```yaml items/dialogs/rules.yml theme={null}
rules:
  type: dialog
  dialog:
    type: minecraft:notice
    title: "Server rules"
    body:
      - type: minecraft:plain_message
        contents: "1. Be kind.\n2. No griefing.\n3. Have fun."
    action:
      label: "I agree"
```

Open it with the `[dialog]` [action](https://items.lodemc.net/events.md):

```yaml theme={null}
rule_book:
  material: book
  events:
    right-click:
      - "[dialog] rules"
```

Dialogs reload with `/lodeitems reload`, no restart needed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.