Plugins

Languages

Built-in multiple language support (GUI), this allows your players to choose their preferred language, you also can add your own language very easy.

We have built-in support for multiple languages per player. Yes, we allow players to select their preferred language. By default, the plugin uses English (which can be changed in settings.yml) as the default language for all.

We welcome you to contribute new translations or improve existing ones. Please let us know.

  • English (US) Translation en-us
  • Vietnamese Translation vn-vi
  • Taiwanese Translation zh-tw
  • Russian Translation ru-ru
  • Chinese Translation zh-cn
  • Spanish Translation es-es

Every language above is written to McmmoGuiV2/lang/ on each startup. An existing file is never overwritten, so your edits are safe and a locale added in a newer version still shows up after an update.

Letting players choose

Language selection is off by default. Turn it on in settings.yml:

settings.yml
Settings:
  MultipleLanguages:
    # Set to true to allow players to select their preferred language via the language GUI.
    # If false, all players will see the language defined in 'Default'.
    Enable: true
    # Used when multiple languages are disabled, or before a player has picked one.
    Default: en-us

With Enable: true, a player who has never picked a language gets the selector the first time they run /mgui, instead of the skill overview. Their choice is stored per UUID in McmmoGuiV2/data.yml, and can be changed later with /mgui language or forced by an admin with /mgui setlanguage <player> <locale>.

This only changes the language of the McmmoGui interface. mcMMO's own chat, bossbar and level-up messages come from mcMMO's locale folder.

How to add your own language to the plugin.

In the example step below, I will add support language for Turkish

Create a copy of your language.

Copy the the en-us.yml file in plugin folder McmmoGuiV2/lang/en-us.yml then rename the Turkish (tr-tr.yml) locale code, you also can find your locale code [Here]. The file name is the locale code the plugin uses everywhere else.

Change the display name of Turkish translation in the file.

Name is what players read on the language button and in the confirmation message.

tr-tr.yml
ConfigVersion: 1
Name: "Turkish" # This line
Messages:
# ...

Add your new language button to the language selector GUI.

Open McmmoGuiV2/gui/LanguageSelector.yml. The Locale value has to match the file name, it is what tells the plugin which language the button applies.

LanguageSelector.yml
Language_Turkish: # Button name.
  Slots: [16]
  Locale: tr-tr # Your locale code here, same as the file name
  Material: head-eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTg1MmI5YWJhMzQ4MjM0ODUxNGMxMDM0ZDBhZmZlNzM1NDVjOWRlNjc5YWU0NjQ3Zjk5NTYyYjVlNWY0N2QwOSJ9fX0=
  Flags: ["*"]

A language button with no section of its own in the language file borrows its name and lore from LanguageDefaultFormat, where %name% becomes the language's Name. So you do not have to write any text for it, unless you want that one button worded differently.

Add the locale name to every language file.

Placeholders.Locales is what /mgui setlanguage uses to name the language it just applied. Add your code to every language file in the folder, otherwise that message renders empty for players using the file you missed.

lang/en-us.yml
Placeholders:
  Locales:
    default: English (Default)
    en-us: English (US)
    # ...
    tr-tr: Turkish # This line, in every language file

Set the Default language to tr-tr in settings.yml

Optional, only if you want Turkish to be what every player gets before choosing.

Restart your server, everything done, now you can translate your Turkish language file now.

Language files are indexed at startup, so a brand new file needs a restart, not /mgui reload. After that, /mgui reload picks up any edit you make inside it.

If a Locale in LanguageSelector.yml points at a file that does not exist in the lang folder, the language selector fails to open. Check that the file name and the Locale value match exactly.

What a language file contains

SectionDescription
NameDisplay name of the language.
MessagesChat messages. Each entry is either a plain string, or a section with Text, Type and Sound.
PlaceholdersShared fragments: ability status formats, party formats, XP bar, locale names, treasure rarity names.
SkillName, type, description and ability texts of every mcMMO skill. Set Hide: true on an ability to drop it from the GUI.
GuiTitle, button names and lore of each menu, grouped by layout. See Customization.

Last updated on

On this page