- Native Minecraft Version:
- 1.13
- Tested Minecraft Versions:
- 1.7
- 1.8
- 1.9
- 1.10
- 1.11
- 1.12
- 1.13
- 1.14
- Source Code:
- https://github.com/PikaMug/LocaleLib
- Contributors:
- https://github.com/PikaMug/LocaleLib/graphs/contributors
- Languages Supported:
- All of them!
- Donation Link:
- https://bit.ly/2yYsPp3
Getting Started
From the author of Quests: A new library for developers! When imported, you will be able to send messages to players in which Minecraft will translate Material, EntityType, and Enchantment names into the target client's language. From Afrikaans and Albanian, to Welsh and Yoruba - tearing down the language barrier has never been easier!
Compatible with Bukkit 1.7.2 and up!
To use the library, first add the LocaleLib jar to your Java build path or add it as a Maven dependency via Jitpack:
Code (Text):<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>Then, add LocaleLib as a dependency (or soft-dependency, if you can live without it) to your plugin.yml file:Code (Text):<dependency>
<groupId>com.github.PikaMug</groupId>
<artifactId>LocaleLib</artifactId>
<version>1.1</version>
</dependency>
Next, you'll need a reference to LocaleManager. Just add the following in your onEnable() method:Code (YAML):depend: [LocaleLib]
Lastly, you'll want to decide which message command to use (but first, get your player - here's one way to do it):Code (Java):private LocaleManager localeManager;
@Override
public void onEnable() {
LocaleLib localeLib = (LocaleLib) getServer().getPluginManager().getPlugin("LocaleLib");
localeManager = LocaleLib.getLocaleManager();
}
Translate ItemsCode (Java):org.bukkit.entity.Player p = Bukkit.getPlayer("PikaMug");
To send the message "I make Dirt look good", do the following:
In English (US), this will appear as...Code (Java):localeManager.sendMessage(p, "I make "
+ ChatColor.GREEN + "<item>" + ChatColor.RESET
+ " look good", Material.DIRT, (short) 0, null);
...but if the player is using Español (México), it will appear as...
Let's say you want Podzod instead of Dirt. On Minecraft 1.13 or above, do this:
Note the durability value of '1' for older versions of Minecraft, rather than '0' for newer ones.Code (Java):if (localeManager.isBelow113()) {
localeManager.sendMessage(p, "I make <item> look good", Material.DIRT, (short) 1, null);
} else {
localeManager.sendMessage(p, "I make <item> look good", Material.PODZOL, (short) 0, null);
}
For an item with enchantments, like "A Diamond Sword with Impaling V", try this:
Note that levels do not automatically appear in the message at this time, but this may be added in a future release.Code (Java):Map<Enchantment, Integer> ench = new LinkedHashMap<Enchantment, Integer>();
ench.put(Enchantment.IMPALING, 5);
localeManager.sendMessage(p, "A <item> with <enchantment> V", Material.DIAMOND_SWORD, (short) 0, ench);
Translate Enchantments
To send the message "Enchant Silk Touch I and Luck III"
Note that levels do not automatically appear in the message at this time, but this may be added in a future release.Code (Java):Map<Enchantment, Integer> enchs = new LinkedHashMap<Enchantment, Integer>();
enchs.put(Enchantment.SILK_TOUCH, 1);
enchs.put(Enchantment.LUCK, 3);
localeManager.sendMessage(p, "Enchant <enchantment> I and <enchantment> III", enchs);
Translate Mobs
To send the message "Pig is best mob?"
Or, to send the message "The Killer Bunny strikes again!"Code (Java):localeManager.sendMessage(p, "<mob> is best mob?", EntityType.PIG, null);
Code (Java):localeManager.sendMessage(p, "<mob> strikes again!", EntityType.RABBIT, Rabbit.Type.THE_KILLER_BUNNY);

LocaleLib 1.5
Show translated names of items, entities & more in client's language
Recent Updates
- Support Potions on MC 1.13+ Oct 8, 2019
- Correct translation of Zombie Pigman Aug 17, 2019
- Correct translation of normal Rabbit mob type Jun 28, 2019