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.
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.
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 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@
-
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.
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 ChatGPT or any other 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 a 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. -
"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" 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 translation after a few lines and wait for you 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 it again with the Think option if the AI you use has such feature.