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.)
If you want to force a specific language for all players, check this FAQ.
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.
Tip
If none of the messages you change is showing up for you, that means you're probably using the wrong language pack.
Make sure the language you're editing matches your personal /k language
preference.
If you're looking to change the main kingdom's command from /k
to for example /t
or from /kingdoms
to /factions
for example, you'd have to look in config.yml unfortunately it's not possible to make these commands multi-lingual for players. Only one set of aliases can be present.
Note
After changing the alias of /k
to something else, you'll still notice that the plugin continues using /k
for some messages.
For example, messages in /k help
will continue to show /k
, that's because these messages are hardcoded to use that command
and you'd need to change them in the language file manually yourself.
There's currently an experimental macro beginning to emerge that can make this much easier, however it's not fully functional right now.
All kingdoms commands are translatable from the language file.
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. There will be two main translatable options under each command, name
and aliases
. Most commands do not have either of these options because they have no aliases and their name will be the same as the predefined name for the command in English. Usually the name
option is shown as the main command name in places where commands must be shown.
For example, let's say you want to translate /k create
to /k erstellen
. You have to find the config entry for the command first in your language file. languages/en.yml (You should find the correct file instead of en.yml
for your language)
Note
Be careful when searching for the command's config path, because you might accidentally mistake /k create
for /k nation create
path instead,
so always look at the surrounding messages to make sure that it's the right one.
If you look at the default language file, you can see that it already has both aliases
and name
options. Now what do you do if you can't find these under a command
you want to edit? You simply add them yourself.
Important
You need to run /k reload
in order for these changes to apply. Restarting works as well.
Note
Command aliases are separated by names, so setting it like this for example:
aliases: one two three
Will make it so that you can use /k one
, /k two
and /k three
for the same command.
Commands with multiple parents (e.g. /k rp withdraw
) also follow the same rules. Let's say you want to translate /k rp withdraw
First you have to find the correct section using the previously explained rules, which is here
Tip
If you're stuck on finding a certain language entry, or it's hard to do so every time,
you can search for other related things about that command that might help you in finding it.
The most common message that all commands should have is the description, which is under the description
option of each command section.
Let's say you want to find /k rp withdraw
, simply run /k admin command /k rp withdraw
this will give you the description text
depending on your selected language (/k lang
) now all you have to do is to search the description text in the language file!
As you can see this section has no name
or alias
option, so have to add it ourselves. To change it from /k rp withdraw
to /k rp retirer
:
withdraw:
name: retirer
alias: se-retirer
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
~
ornull
) Setting a message option to~
ornull
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 useNOPREFIX|
at the beginning of a message to exclude it, or if the option is disabled, you can usePREFIX|
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: 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@
-
Commands: Execute a command or send a message in chat. Not using a
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"
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.
The plugin also has a Crowdin page if you prefer to translate the plugin from there, however currently Crowdin
lacks some features that makes translating a little hard.
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.
It's perfectly fine if you use AI to help you translate the plugin, but you have to configure some rules for it and give it some context on what this plugin is about. All bad AI translations in games is because the AI is not properly made aware of the context around what it's translating. For example, in English the word "chunk" has a pretty generic meaning, but it has a more strict meaning when it comes to Minecraft. It will give you relatively good translations if you configure the rules properly. You'd just have to check the translation to see if it makes sense, minor issues can be fixed later.
People would rather have an AI-translated plugin than no translation at all.
Note
Grok 3 seems to be more efficient than ChatGPT in this specific field. ChatGPT has issues with keeping all YAML comments and needs to have some rules repeated in order for it to understand. It doesn't really understand the concept of file lines correctly and will stall randomly. AIs in general seem to struggle with the concept of file line numbers, but it's less severe for Grok 3.
Here, we will review some rules that can help assist the AI in understanding how to translate the plugin properly. Depending on the AI you're going to use, you might just be able to copy paste the list below and it'll process the rules correctly:
- This is an English language message file for a Minecraft plugin, it should be translated into ???.
- This is a YAML file, and mapping node keys should not be translated, only scalar text values.
- The format of the YAML nodes should not be changed and the translated values must retain their node flow style if possible.
- The following words have special meanings:
chunk
,land
,kingdom
,nation
,turret
,structure
andresource points
(you'll have to tell the AI explicitly on what word to use for the translation based on your language.) - YAML comments should be translated.
- The following formats inside texts should not be translated and used as is, the rest of the text should be translated as if these formats didn't exist:
-
"&x"
where "x" can be an alphabet or a number. -
"{$x}"
where "x" can be any word and should not be translated. -
"{$$x}"
where "x" can be any word/sentence and should not be translated. -
"%x%"
where "x" can be any word and should not be translated. Usually the word here is separated by underscores but can rarely contain spaces as well (if it does contain spaces it usually has a colon character before a space character is encountered, like%kingdoms_kingdom_top_donations:at pos=1, of=player_name%
) -
"NOPREFIX|"
at the beginning of messages. -
hover:{x;y;z}
where "x" and "y" can be a text and should be translated according to the same rules, but not the word "hover" or the "z" portion. The context of the sentence where this format is placed in, should consider the text in the "x" portion. -
/k x
where x is one or more word should not be translated. (The AI might not be able to handle commands properly, so double check. Commands will not be automatically translated since the default generated language file doesn't have an entry for command names, you'd have to add them manually or tell the AI to do that.) -
"{? condition ? "text1" : "text2"}"
where "condition" is a Java-like condition expression and should not be translated but "text1" and "text2" should be translated according to the same rules. The context of the sentence where this format is placed in, can be either "text1" or "text2" so consider both possibilities when translating the sentence. - Make sure to not translate URLs/links or file names with "
.yml
" extension. - Do not translate the following YAML entries separated by dot (but translate their comment if any):
"prefix"
-
- Exceptionally, translate YAML
"true"
and"false"
YAML entries which their value is "true" and "false", but these are intended to be text, not boolean. Do not translate other values if their value is unquoted true/false.
Note
For GUIs, extra rules are needed:
- Don't translate
"material"
,"sound"
,"condition"
,"type"
,"enchants"
,"effects"
or"flags"
keys. - Don't translate any keys that their value exactly matches
"true"
or"false"
(For example"glow"
or"unbreakable"
)
Tip
Some AIs will forget certain rules and you should tell the AI to just translate 100 lines for you to check before it translates the full file, because it can take even an hour for the main language file. (Most AIs will already do this for you and pause the translation after a few lines and wait for your confirmation.) You should remind the AI of the rules they forgot and emphasize them.
If your AI is struggling to understand certain rules, make sure to start a new session with the Think/Expert option if the AI you use has such feature.