Class TinkerLang
java.lang.Object
io.github.sefiraat.slimetinker.i18n.TinkerLang
Translates the fragments that make up SlimeTinker's runtime-composed tool and armour names -
material names, tool types and armour types - per language. Loaded from the addon's own
languages/<lang>/tinker.yml resources, keyed by category ("materials", "tool-types",
"armour-types") then by the id stored in the item's PDC.
A missing translation falls back to ThemeUtils.toTitleCase(String) - exactly the English
form SlimeTinker itself produces - so an unmapped id or an English viewer sees the original name.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidload(org.bukkit.plugin.java.JavaPlugin addon) Loads the bundledtinker.ymlfor every Slimefun language.static StringThe translated fragment for an id in the given language, ornullwhen there is none.static StringThe translated fragment for an id in the given language, or its title-cased English form when there is no translation (or no language).
-
Method Details
-
load
public static void load(@Nonnull org.bukkit.plugin.java.JavaPlugin addon) Loads the bundledtinker.ymlfor every Slimefun language. Call once after enable. -
lookup
@Nullable public static String lookup(@Nonnull String category, @Nullable String id, @Nullable String language) The translated fragment for an id in the given language, ornullwhen there is none. Use where the caller has its own English baseline (e.g. part names that are not title-cased ids). -
translate
@Nonnull public static String translate(@Nonnull String category, @Nullable String id, @Nullable String language) The translated fragment for an id in the given language, or its title-cased English form when there is no translation (or no language).
-