AnhyLingo is a plugin for Minecraft servers designed to create a multilingual interface. It allows players to receive system messages, messages from other plugins, as well as see names and descriptions of items in their chosen language. Tested on servers with Spigot
, Paper
, Purpur
cores version 1.20.2
. The latest version of the ProtocolLib
plugin is required for operation.
A common limitation of many Minecraft plugins is their confinement to a single language, as defined in the plugin's configuration. Few plugins offer true multilingual support, often relying solely on the language of the Minecraft client.
AnhyLingo stands out in this landscape. It not only utilizes the client's language settings but also empowers players to choose multiple languages in a specified order for finding appropriate translations. Furthermore, AnhyLingo makes almost any in-game chat message multilingual by using language keys. These keys are replaced with corresponding translations during the server-to-client packet transmission, ensuring that messages are delivered in the player's chosen language.
Moreover, AnhyLingo brings multilingual capabilities to scenarios where it seemed improbable. For instance, when creating quests with a quest plugin, even if the plugin itself is multilingual, the quest messages are typically restricted to one language. AnhyLingo innovatively addresses this by allowing creators to use keys from custom language files, enabling the quests to be multilingual. This versatility greatly enhances the gaming experience, making it more inclusive and accessible to a diverse, global player base.
In conclusion, AnhyLingo transcends the typical boundaries of language in Minecraft, offering a versatile and inclusive solution that enriches the gaming experience for a diverse, global player base.
Players have the option to select languages for system messages, plugin notifications, and the display of game items that support multiple languages. If the language chosen by the player has been added by the administrators, all relevant informational messages will be displayed in that language. In cases where the player has not selected any specific language, the system will use the language settings of the Minecraft client. If the chosen language is not supported in the localization, the player will receive messages in the default language set in the plugin.
/lingo set <langs>
en
or en it es
. Plugin will search for the translation in order./lingo reset
/lingo get
The AnhyLingo plugin for Minecraft servers is equipped with administrative commands to manage multilingualism on the server. These commands are only accessible to players with extended administrative rights and allow for customization and control over the plugin's language options. The administrators can use these tools to set the available languages on the server, modify translations of game elements and the interface, and adjust language settings as per the players' needs. This approach promotes inclusivity and accessibility of the game for players from different countries and ensures a more flexible approach to cultural and linguistic diversity on Minecraft
/lingo reload
/lingo items list <lang>
/lingo item <lang> <key>
/lingo nbt set <nbt_key> <params...>
string:value, int:10
).int, double, intarray, string
./lingo nbt list
int, double, intarray, string
./lingo nbt info <nbt_key>
/lingo fl (flingo) link_to_file folder true|false
:
link_to_file
: Direct link to the file.folder
: Folder where the file is uploaded items|system
.true|false
: Parameter to determine the possibility of overwriting the file.xxx_[language_code].yml
./lingo fo (fother) link_to_file directory true|false
:
directory
within the server plugins folder.allowed_directories
).link_to_file
: Direct link to the file for download.directory
: Target directory for the file within the server plugins directories.true|false
: Parameter that determines whether overwriting existing files is allowed./lingo fd (fdel) directory file_name
:
allowed_del_directories
).directory
: File path.file_name
: File name/lingo dir [directory]
:
directory
folder located in the server plugins directory.[directory]
is set to 0, it will show the contents of the ./plugins/
folder.
For the AnhyLingo plugin to track and rename certain items, it is necessary to add a special NBT tag
ItemLingo
. This tag should contain a string value that corresponds to the key in the language file.Adding an NBT Tag to an Item
Command for Adding Tag, example:
/lingo nbt set ItemLingo string:magic_wand
- This command adds the NBT tag ItemLingo with the string value
magic_wand
to the item in the player's hand.- The value
magic_wand
corresponds to the key that must be in the language file.Using Other Plugins:
- Administrators can also use the functionality of other plugins to add this NBT tag to items.
- It is important that the NBT tag has the name
ItemLingo
and a string value that corresponds to the key from the language file.This feature provides the ability to rename certain items on the server according to the player's chosen language, making the gameplay more interactive and convenient for players who use different languages.
Loading YAML content...
items
: Files with translations of names and lore of custom items.Loading YAML content...
system
: Files with translations of system messages and messages from plugins.Loading YAML content...
xxx_[language_code].yml
", for example, "lingo_en.yml
", files that do not meet the standard are not read.The AnhyLingo API offers a robust solution for developers seeking true multilingualism in their Minecraft plugins. By using this API, system messages within plugins can be made multilingual right at the point of their creation, before being sent to the player. This method of translating keys into the respective languages is far more efficient than renaming keys in already transmitted packets. For developers aiming to achieve authentic multilingual functionality in their plugins, incorporating the AnhyLingo API is a strategic and effective choice.
Use the AnhyLingo plugin in your project as a dependency. Here are the instructions for adding the plugin using Gradle and Maven.
To use AnhyLingo in your Gradle project, add the following lines to your project's build.gradle
file:
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { mavenCentral() maven { url 'https://jitpack.io' } } }
dependencies { implementation 'com.github.AnhyDev:AnhyLingo:v0.1.2' }
To include AnhyLingo in your Maven project, insert these lines into your pom.xml
file:
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
<dependency> <groupId>com.github.AnhyDev</groupId> <artifactId>AnhyLingo</artifactId> <version>v0.1.2</version> </dependency>
package myplugin.lang; import myplugin.MyPlugin; import ink.anh.lingo.api.lang.LanguageManager; public class LangMessage extends LanguageManager { private static LangMessage instance = null; private static final Object LOCK = new Object(); private LangMessage(MyPlugin plugin) { super(plugin, "lang"); // 'lang' is the name of the folder containing language files } public static LangMessage getInstance(MyPlugin plugin) { if (instance == null) { synchronized (LOCK) { if (instance == null) { instance = new LangMessage(plugin); } } } return instance; } }
lang
is the name of the folder containing language files.
Files must have the name format: "xxx_[language_code].yml"
, for example, "name_en.yml"
, files that do not meet the standard are not read.
The contents of the files must conform to the YAML standard, and have the form key: "Value"
, where "value" is the translation for the given key in this language.
import myplugin.lang.LangMessage; import ink.anh.lingo.api.lang.LanguageManager; public class MyPlugin extends JavaPlugin { private static MyPlugin instance; private LanguageManager languageManager; @Override public void onEnable() { instance = this; languageManager = LangMessage.getInstance(this); } public static MyPlugin getInstance() { return instance; } public LanguageManager getLanguageManager() { return languageManager; } }
import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; import ink.anh.lingo.api.Translator; import ink.anh.lingo.messages.MessageType; import ink.anh.lingo.messages.Messenger; import ink.anh.lingo.utils.LangUtils; public class OtherClass { private MyPlugin plugin; private LanguageManager languageManager; public OtherClass(MyPlugin plugin) { this.plugin = plugin; this.languageManager = plugin.getLanguageManager(); } public static String[] checkPlayerPermissions(CommandSender sender, String permission) { if (sender instanceof ConsoleCommandSender) { return null; } String[] langs = new String[] {null}; if (sender instanceof Player) { Player player = (Player) sender; langs = LangUtils.getPlayerLanguage(player); if (!player.hasPermission(permission)) { sendMessage(sender, Translator.translateKeyWorld("shop_err_not_have_permission", langs, MyPlugin.getInstance().getLanguageManager()), MessageType.ERROR); return langs; } } return langs; } private static void sendMessage(CommandSender sender, String message, MessageType type) { Messenger.sendMessage(MyPlugin.getInstance(), sender, message, type); } }