Configuring

Languages

Spanish ships with the plugin. messages/es/ is written out on the first start.

# config.yml
language:
  default: es

/chorus reload, and the whole server speaks Spanish.

How it works#

A language is a folder inside messages/, named after its code. The code is whatever you want to call it, and it is the same code you put in the config.

plugins/ChorusCore/messages/
├── core.yml        English, and the fallback for everything
├── homes.yml
├── ...
├── es/             Spanish, shipped
│   ├── core.yml
│   └── homes.yml
├── fr/             French, if you write one
└── pt/             Portuguese, if you write one

A language folder holds the same file names as the folder above it, and the same keys. It may hold as many or as few of those files as it likes — a folder with nothing but homes.yml in it is a perfectly good translation.

A translation only writes down what it translates#

This is the part worth understanding, because it is what makes translations survive updates.

# messages/fr/homes.yml — a perfectly valid translation
home:
  created: '%prefix%<c:muted>Maison <white>%home%</white> enregistrée.'
  deleted: '%prefix%<c:muted>Maison <white>%home%</white> supprimée.'

Every line it leaves out comes from English. A folder with forty lines in it is a server that speaks forty lines of French and English for the rest — never a server with forty holes in it.

That is also what lets a translation survive an update that adds twenty new messages: the new ones are English until somebody gets round to them, and nothing breaks in the meantime.

A language may set a prefix of its own in any of its files, and borrows the English one where it does not. A line it writes as '' is silenced in that language only.

Per-player languages#

language:
  default: es
  per-player: true

Each player is sent the language their own Minecraft client is set to, falling back to default when there is no folder for it. A player with their client in French gets messages/fr/ if it exists; everybody else gets Spanish. default itself falls back to English.

The console always reads default.

A broadcast is rendered once per language rather than once per player, so a server with a hundred players and three languages costs three parses, not a hundred.

Writing one#

  1. Make a folder: messages/<code>/.
  2. Copy in only the files you mean to translate.
  3. Translate the lines you care about and delete the rest. A line you did not translate is better absent than left in English inside the translation, because absent means it follows the English file when that file changes.
  4. /chorus reload.

The startup banner says which languages were found.

What not to bother translating#

Lines that are pure decoration — separators, a header that is nothing but a %placeholder%, a line of ▪ characters. There is nothing in them to translate, and leaving them out keeps the folder to the part that matters. The shipped Spanish does exactly that.

Rules for the values#

  • Keep every %placeholder%. A renamed one leaves a gap where the number should be.
  • Keep the colour tags, or change them deliberately. They are not part of the translation but they are part of the line. A <c:name> from Colours works here too, and is the better choice: it keeps every language the same colour.
  • MiniMessage, &-codes and palette names all work, the same as in English.

What the build checks#

A translation that ships inside the jar is checked when the plugin is built: every key it uses has to be a real one, every line has to be valid MiniMessage, and every %placeholder% in it has to exist in the English line it replaces.

Your own files are not checked that way — they are read at runtime. A key that is not real is ignored, and a line with a broken tag is sent as written.

Spanish#

messages/es/ is complete for everything a player sees — 901 lines against the 957 in English, the missing ones being the decoration described above. It was written as a translation rather than a machine pass: /sethome says casa and not hogar, and the tone matches the English.

Money is written the same way in every language. The symbol, which side it goes on and how many decimals are in the currency block of config.yml; the separators themselves are always 1,000.00 and are not configurable. A translation cannot change that, and should not try to by writing the amount into the message itself.

If you want it different, edit it. The folder is yours once it is written out — the plugin never overwrites it.