A spigot plugin to translate plugin messages into different languages. You can translate all plugin messages of plugins which allow editing the messages individually in as many languages as you want.
- This plugin isn't using a translation API or something so you have to write each translation in every language manual!
- This plugin is still under development so it's possible that bugs may occur! Please report them in the issues section.
- This plugin edits the chat packets a player is receiving using ProtocolLib so it must be installed on the server!
- You have to restart your server one time after you loaded the plugin the first time so less bugs can occur!
- After that you will see that a few files were created:
players.yml
,lsconfig.yml
,de.yml
,en.yml
. In thelsconfig.yml
file you have to set your chat format if your server software is spigot or less for example:
- Next you want to set your default language again in
lsconfig.yml
- As the last step you have to reload all things you changed. The easiest way to do so is using the
/lsreload <config/players/languages>
command and execute it with each argument one time.
In a subdirectory called languages/
are two files by default. These contain the messages the plugin will need in two languages (de.yml
-> german, en.yml
-> english).
In the message config of the plugin you want to translate (most times it's called messages.yml
) you have to go to the message and edit the message to a placeholder:
Now you have to go back in the languages/
subdirectory in the plugin's datafolder and go through every file in there and add a new point with the translation in the file's specific language:
Many messages have variables such as:
Again you have to use a placeholder but also define the variables:
You can also use more than one variable: ban-notification,vars={operator=%OPERATOR%,name=%NAME%}
is an excerpt from a modified AdvancedBans config
Each language has one .yml
file with the code of the ISO-3166-1-codelist of the country/language. If it doesn't exist in the list just thing of one yourself. For example the file for english is called en.yml
.
To register the language you have to add one element to the Languages
list in the lsconfig.yml
:
Languages:
- ==: LSLanguage
name: English
code: en
enabled: true
- ==: LSLanguage
name: Deutsch
code: de
enabled: true
It's important that the code
is equal to the file name.
Command | Description |
---|---|
/lslist | Lists all languages |
/lsreload <config/players/languages> | Reloads the specific file(s) |
/lang <auto/lang-code> | Sets your language (auto sets it to your game language) |