Languages & Translations

Languages & Translations

How to change the language of the plugin, translate its messages and use MiniMessage formatting.

View as Markdown ·

On this page

#Translations

Every line the plugin can print lives in one file:

PhoenixDuels/translations/translations.en.yml

Messages to players, command replies, the menus and the whole in-game editor are all in there. Edit it, run /pduels reload, and the new text is live.

To stop a message from appearing at all, set it to '' (empty quotes).

circle-exclamation

/pduels reload menus does not reload translations. Use the plain /pduels reload after editing a translation file.

Every add-on brings its own file into the same folder, named after itself, so the Bed Fight messages are in bedfight.translations.en.yml and the Player Kits ones in playerkits.translations.en.yml. They work exactly like the main file.

#Language

The language the plugin loads is set in config.yml, or from Editor > Settings > Language.

YAML
language: EN_US

The picker lists every language the plugin knows about:

Code Language File
EN_US English (United States) translations.en.yml
AR_SA Arabic (Saudi Arabia) translations.ar.yml
PT_BR Portuguese (Brazil) translations.br.yml
PT_PT Portuguese (Portugal) translations.pt.yml
ES_ES Spanish (Spain) translations.es.yml
FR_FR French (France) translations.fr.yml
DE_DE German (Germany) translations.de.yml
IT_IT Italian (Italy) translations.it.yml
NL_NL Dutch (Netherlands) translations.nl.yml
SV_SE Swedish (Sweden) translations.sv.yml
PL_PL Polish (Poland) translations.pl.yml
CS_CZ Czech (Czechia) translations.cs.yml
RU_RU Russian (Russia) translations.ru.yml
TR_TR Turkish (Turkey) translations.tr.yml
EL_GR Greek (Greece) translations.el.yml
HI_IN Hindi (India) translations.hi.yml
ID_ID Indonesian (Indonesia) translations.id.yml
VI_VN Vietnamese (Vietnam) translations.vi.yml
JA_JP Japanese (Japan) translations.ja.yml
KO_KR Korean (South Korea) translations.ko.yml
ZH_CN Chinese (Simplified) translations.zh.yml

The file name uses the short form rather than the code, which is worth knowing before you go looking for it — PT_BR writes translations.br.yml, not translations.pt_br.yml.

circle-exclamation

Only the languages included in the build you are running can be picked. The rest are dark grey in the editor and clicking skips straight past them. At the moment the plugin ships with English, so the way to run it in another language is to translate the file yourself.

#Translating the plugin

Everything sits under the short language code at the top of the file, and the value is either a line or a list of lines. Translate the right-hand side and leave the keys and the placeholders alone.

YAML
en:
  unknown-argument: "&cUnknown argument!"
  no-permission: "&cYou don't have permission to do this! &8(&e%permission%&8)"
YAML
en:
  error-processing:
    - "&cAn error occurred while processing this action (Check console):"
    - "&7%message%"

Anything wrapped in % is filled in by the plugin, so %player%, %permission% and %message% have to survive the translation to keep working. Colour codes can be moved around freely.

circle-info

English is always loaded first, and the chosen language is laid over the top of it. A key you have not translated yet falls back to its English line rather than printing blank, so a file can be translated a piece at a time.

circle-info

Keep a copy of your translated file before updating the plugin. New keys are added to it automatically — the console prints Missing value for key "..." and writes the English default straight into your file — but it is the file your work lives in. See What does the "Missing translation" warning mean?

#The editor is translated too

Everything under the editor keys is the text of the in-game editor — the name and description of every option. Translating those is optional, and skipping them leaves the editor in English while your players see your language.

#Rich Text (MiniMessage)

Phoenix Duels understands MiniMessage tags, like <red>, <bold> or <gradient:#ff5555:#5555ff>, on top of the classic & colour codes. This lets you use gradients, hover text and clickable links, none of which & codes can do.

#Format

Example Result
<red>Hello Red text
<#ff8800>Hello Any hex colour
<gradient:#5e4fa2:#f79459>Phoenix Duels</gradient> Text fading from one colour to another
<bold><underlined>Warning Bold and underlined
<rainbow>Victory!</rainbow> Each letter a different colour
<hover:show_text:'Click me'>Hover</hover> Text with a tooltip
<click:open_url:'https://example.com'>Our site</click> Text that opens a link

A closing tag is optional. <red>Hello colours the rest of the line, while <red>Hello</red> there colours only the first word.

#Where it works

Place Notes
Chat messages Kill messages, command feedback, broadcasts
Match scoreboard The sidebar title and lines shown during a duel
Lobby scoreboard From the Lobby Items add-on
Menu titles, names, lore Anywhere the editor lets you write text

#Where it doesn't work

Titles, subtitles, the action bar, boss bars, nametags and the tab list still only understand & codes. Those are sent as raw legacy text, so a tag in one of them is shown to the player exactly as you typed it.

#Usage notes

  • Legacy & codes, including &#RRGGBB hex, keep working everywhere exactly as before.
  • In chat messages, use one style per line. A chat line is only sent as MiniMessage when it contains no legacy colour codes at all, so mixing &c and <red> in the same line falls back to legacy and prints the tag.
  • Everywhere else, the two can be mixed freely. A scoreboard line or an item name is read as MiniMessage as soon as it contains a tag, and any & codes in it are converted along with it.
  • A tag the server does not recognise is left in the text as written rather than being dropped, which is what keeps resource pack glyph tags working.

circle-exclamation

MiniMessage needs Paper or a fork of it. On plain Spigot the tags are printed exactly as you typed them, so stay on & codes there.

My Cart
Spider

Your cart is empty

Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping