Get started

Thank you for purchasing my LanguageAPI.

ColorCodes are always defined with a & character. A list of possible ColorColdes can be found here. Please use the CHAT CODE column from the displayed table and replace the § character with the & character.

If you have downloaded the LanguageAPI and started the server, a folder named LanguageAPI should now have been created in your plugins folder. Now open this folder and edit the config.yml.

Enter license

Add your private license in the config.yml. If you don't have one yet, open a support ticket on my discord server.

Why do I need a private license? The answer is here

Database

Set the database type in config.yml.

MySQL

Set database: "mysql" to store your data in a MySQL database. You can access the data across servers. To connect to MySQL database open the file mysql.yml and enter your MySQL data.

mysql.yml
mysql:
  HOST: localhost
  PORT: '3306'
  DATABASE: database
  USER: root
  PASSWORD: password

Config

Set database: "config" to store your data locally on the server. This data can then only be accessed by this one server. For this purpose the plugin creates a folder named database in the plugins folder. In this folder the database file database.db will be created.

BungeeCord?

If you have the LanguageAPI for BungeeCord as well, set the bungeemode: true

File system

There are 2 different file systems. These are explained below.

single

The single file system simply means that all messages of all languages are contained in one file. Here is the example from the LanguageAPI:

messages.yml
english:
  command:
    noConsolCommand: "[LanguageAPI] Please go on the Server and try again!"
    usage: "%prefix% &cPlease use: &e/changelanguage <language>"
    unknowLanguage: "%prefix% &cThe language: &e%language% &cdoes not exists!"
    correctlyUsage: "%prefix% &7Your language was change to &e%language%&7."
    isLanguageAlready: "%prefix% &cYour language is already: &e%language%&c."

deutsch:
  command:
    noConsolCommand: "[LanguageAPI] Bitte gehe auf den Server und versuche es erneut!"
    usage: "%prefix% &cBitte nutze: &e/changelanguage <sprache>"
    unknowLanguage: "%prefix% &cDie Sprache: &e%language% &cexistiert nicht!"
    correctlyUsage: "%prefix% &7Deine Sprache wurde zu &e%language% &7geändert."
    isLanguageAlready: "%prefix% &cDeine Sprache ist bereits: &e%language%&c."

multi

In the System multi file, each individual language gets its own file. The individual files are in the plugin folder in the language folder. This is easy to build: <language>.yml

Here is an example:

deutsch.yml
command:
  noConsolCommand: "[LanguageAPI] Bitte gehe auf den Server und versuche es erneut!"
  usage: "%prefix% &cBitte nutze: &e/changelanguage <sprache>"
  unknowLanguage: "%prefix% &cDie Sprache: &e%language% &cexistiert nicht!"
  correctlyUsage: "%prefix% &7Deine Sprache wurde zu &e%language% &7geändert."
  isLanguageAlready: "%prefix% &cDeine Sprache ist bereits: &e%language%&c."
  
english.yml
command:
  noConsolCommand: "[LanguageAPI] Please go on the Server and try again!"
  usage: "%prefix% &cPlease use: &e/changelanguage <language>"
  unknowLanguage: "%prefix% &cThe language: &e%language% &cdoes not exists!"
  correctlyUsage: "%prefix% &7Your language was change to &e%language%&7."
  isLanguageAlready: "%prefix% &cYour language is already: &e%language%&c."

It is important that the language is also entered in the config.yml under the point supportedLanguages. Pay attention to the upper and lower case!

Prefix

The prefix is always set before each message from the LanguageAPI. You can change the prefix by changing the line prefix: "&7[&6LanguageAPI&7]&r".

Change language

As the server owner, you have the option to allow or deny players to change their language. You do this by editing the line changeLanguage: true. If you set the setting to false, the players will no longer be able to change their language.

It would be best if you have the same setting on all servers, i.e. all set to true or all set to false.

Alias

You can edit the command to change the language. To do this, simply add more entries to the aliases setting or remove them. If you only want the default command, simply replace the list with aliases: [].

Standardkonfiguration:

aliases:
  - "language"

The standard command for changing the language is: changelanguage

Default language

The default language is the language that every player automatically receives when they join the server for the first time. To change the default language, simply edit the line defaultLanguage: "english".

The default language must be listed among the supported languages. You can find the supported languages here

Supported languages

Under Supported languages, you add the languages that your server network should support. You can also remove the supported languages.

supportedLanguages:
  - deutsch
  - english

Now you know everything about the settings of the LanguageAPI and you can use it. To implement it in your own plugins, you can go to the API page and see what you can do with it. You can find the page here.

Default configuration

config.yml
# The standard license is only valid for 7 days. Please request your private license on my Discord (link: https://discord.herrtechniker.eu).
# You have to present your bill to prove that you bought the LanguageAPI.
license: ""

# Insert "mysql" to use mysql (cross-server access) or insert "config" to use local database (only local servers have access)
database: "mysql"

# If you use the LanguageAPI for Bungeecord, please set 'bungeemode = true'
# ATTENTION Pleasemake sure your database type is mysql! If not, an error will occur and the plugin will not start!
bungeemode: false

# If this option set 'single' the different languages are in one file
# and will be listed like the following example:
# english:
#   path1:
#     path1.1: x
#     path1.2: xy
#   path2: 4
# deutsch:
#   path1:
#     path1.1: x
#     path1.2: xy
#   path2: 4
# etc...
#
# If this option set 'multi' then every language has an own file
# like for english: "english.yml"
# or for deutsch "deutsch.yml" (german)
#
# !!!!ATTENTION!!!!
# - the language path for the structure single has been the same name and spelling like in the list supportedLanguages
# - the language file name for structure multi has been the same name and spelling like in the list supportedLanguages
# - After changing the language structure, the file(s) will be deleted. Before that, make a backup to transfer the messages to the other structure.
languageStructure: "single"

prefix: "&7[&6LanguageAPI&7]&r"

# enable the command to change your language
changeLanguage: true

# aliases for the language command
aliases:
  - "language"

# has also been listed in supportedLanguages
defaultLanguage: "english"

# List of all supported Languages
supportedLanguages:
  - deutsch
  - english

Command

Syntax

/changelanguage <Sprache>

Last updated