Languages & Translations

Languages & Translations

Change the plugin's language, translate its messages and format them with MiniMessage.

View as Markdown ·

On this page

#Translations

Every line the plugin can print lives in one file:

PhoenixCrates/translations/translations.en.yml

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

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

Every add-on brings its own file into the same folder, named after itself, so the Rarity messages are in rarity.translations.en.yml and the Lootbox ones in lootbox.translations.en.yml. They work exactly like the main file.

circle-info

Older versions kept this in messages.yml. On the first start after upgrading, the plugin copies your text across into the translation file on its own and renames the old one to old_messages.yml. Editor text is not carried over, since the old file never had it.

#Language

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

YAML
language: UNDEFINED

Editor > Settings

UNDEFINED is the value a fresh install starts on, and it behaves as English. It is also the one value the editor will not let you pick again once you have chosen a real language.

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.

#Setting it from a command

/crates setLanguage <language> switches language without a full reload. It only accepts a language the build actually ships, and answers No translation is bundled for language ... for anything else.

While language is still UNDEFINED, anyone joining with phoenixcrates.admin is offered a suggestion in chat, picked from where the server appears to be, with the command ready to click. Setting a language yourself stops it.

#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 are not allowed to do this! (Need %permission%)"
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.

#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 Crates 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 Crates</gradient> Text fading from one colour to another
<bold><underlined>Warning Bold and underlined
<rainbow>Legendary!</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 Everything in the language file that reaches chat
Crate holograms The floating text above a crate
Reward names and lore Including the rarity group display item
Menu titles, item names, lore Anywhere the editor lets you write text

#Where it doesn't work

Titles, subtitles, the action bar and boss bars 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 hologram 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