Languages - CryptoMorin/KingdomsX GitHub Wiki

Kingdoms is an international plugin. The default language file is en.yml which is not saved in the plugin, it's generated automatically.

All supported language files can be viewed here however the plugin doesn't come with any of these languages pre-installed (except English of course.) You'd have to use /k admin languagepacks command in order to download them.

The plugin can display information based on each individual player's preferred supported language using /k language command. The plugin will attempt to detect the client's locale and automatically assign a language for them, but if they're using a modded client or their client's language isn't supported by the plugin, the lang option in config.yml will be used instead (please read the comment above the option carefully when changing it.)

Language files automatically add new entries to their list, however they don't remove any old ones. If a translated language file is missing an entry, it'll copy one from the original (English) version into the file instead. Language entries don't have any explanation, they're mostly easy to understand. If you couldn't find the usage for an entry, you can always ask or use the /k admin track command.

The language entry format for all the commands are commands -> [groups...] -> <name> where [groups...] are the main command names of that command and <name> is the main command name of that command. The grouping names are explained in the permissions section in more detail.


Messages

All the language entries support:

  • Chat Colors and 1.16 Hex Colors
  • Line Breaks \n (It also keeps the color for the next line.)
  • Complex Messages (Read below for more info)
  • Internal & External Placeholders
  • Complete Removal (by setting the message to ~ or null) Setting a message option to ~ or null will not send that message, however if you set it to "" it'll still send an empty line.
  • If prefix option is enabled in config, you can use NOPREFIX| at the beginning of a message to exclude it, or if the option is disabled, you can use PREFIX| to use the prefix for that specific message.
Fun Fact About ~

The tilde character ~ was originally written over an omitted letter in medieval scribes. That's why it was chosen to be an alternative for null in YAML.

Note that in YAML, in general, quoted "~", '~', 'null', "null" are interpreted as literal text, not null values. So be careful not to use quotes.

Plugin supports Complex Messages, Hover Messages, or Raw JSON Text messages are messages that use modern Minecraft messaging features which allows you to do different things when hovering on a text in a message. In addition to hover features, complex messages have a few more useful functions that we will talk about in a moment.
This feature doesn't work on Bukkit servers. It only works on Spigot and forks of Spigot such as Paper.\

You can now use hover:{} anywhere in the message. The default format for hover is hover:{Chat Message;Hover Message (Lore);Action} they all support color codes and placeholders inside them. Note that every space (or any other character) before and after the separators ; are also displayed in the message (except for the Action, read below for more details)!

  • Chat Message: The message shown in the chat like the normal messages.
  • Hover Message: The message shown when you hover on Chat Message in the chat using your cursor.
  • Action: The action performed when you click on Chat Message in the chat.
    • Commands: Execute a command or send a message in chat. Not using a / slash will send a chat message instead as if the player sent this message normally themselves. (Note: As of Minecraft 1.19.1, due to the new chat reporting system the client now ignores chat message actions. Meaning it won't work for sending raw messages.)
    • Suggestions: Put the text in player's chat box. Instead of / you have to use |
    • URL: Open a link in the player's browser (with their consent after they've been prompted by a message on their screen). Instead of / you have to use @

Example: &2Hey hello hover:{&cthis;&2Jeff;Hello Jeff!} &2is my name.\nCome hover:{&emeet;&2Click To Meet\nmaybe not.;/tp Jeff} &2me here. hover:{&lphone number;&2Click to copy;|911} &2my hover:{&9website;&cClick To Open;url:https://www.nasa.gov/}

There's another form of complex messages supported in the language file. If one of the language entries is a section instead of just text, you'll be able to benefit from several features:

# before
message-entry: "Hello I'm a normal complex message"

# after
message-entry:
  # Sound played to the player when the message is sent.
  sound: BLOCK_NOTE_BLOCK_BASS, 1, 1

  # Actionbar shown to the player for a short period of time ~3 seconds
  actionbar: "I support colors and placeholders too."

  # Refer to titles section below to learn how these work.
  titles:
    title: "I support colors and placeholders as well"
    subtitle: "Me too"
    fade-in: 30
    stay: 15
    fade-out: 30

  message: "I'm a complex message, but notice how I don't need the @ anymore to be counted as one"

Translations

All community translations are welcomed. You can also improve existing translations. You can translate the language file and all the GUIs located in the guis folder, but plugin configs are not translatable.
Here are some rules when translating the plugin. These rules apply to GUI translations as well.

  • Obviously don't just drop them in Google Translate and paste them back to the file. Translate them manually.
  • You shouldn't change how the sentences are phrased and add or remove a part of the description unless it makes it easier to understand in that particular language.
  • You can change the colors, but do not use 1.16 hex color codes.
  • You shouldn't change the plugin prefix. Anywhere that the name Kingdoms is used that is referring to the plugin and not the name itself, shouldn't be translated.
  • Make sure to validate your files.
  • You can change the GUI design as long as it has all the functional options used.
  • You can give credits, but only at the beginning of the file. No IPs are allowed unless you have a domain that redirects to an appropriate website with SSL certificate (HTTPS).
  • You can add explanations anywhere in the file if you want.

After translating your language file, place your translated file in the plugin's folder. The file's name should be the same as the option below without the .yml file extension. Some of these language files are outdated. Standard way of naming this is to follow IETF language tags from IETF use ISO-639-1 codes. If you can't find it, or don't feel like it, don't bother.
If you translated the plugin, you can contact me and I'll add it to the plugin.

All the language files are translated by the community. They're not guaranteed to be 100% accurate or complete. Outdated translations might even cause errors during validation. Developers and translators are not responsible to update the language files.

⚠️ **GitHub.com Fallback** ⚠️