Improve localization for tools (#151)

Co-authored-by: Maya <[email protected]>
This commit is contained in:
Pierre ZhangandMaya authored and GitHub committed 2025-02-15 06:33:02 +00:00
1 parent c1395c1ffe
commit 65ae295b8f
4 files changed
+18 -2

No files matched your search

@@ -355,7 +355,10 @@ public class ToolBuilder {
return StatCollector.translateToLocal("tool." + toolName + "." + matName);
}
return String.format("%s %s", headMat.prefixName(), tool.getLocalizedToolName());
return String.format(
StatCollector.translateToLocal("tool.nameformat"),
headMat.prefixName(),
tool.getLocalizedToolName());
}
// Passthrough for now
@@ -138,7 +138,10 @@ public class KingBlueSlime extends SlimeBase implements IBossDisplayData {
// materials
String name;
if (StatCollector.canTranslate(loc)) name = StatCollector.translateToLocal(loc);
else name = StatCollector.translateToLocal("tool.kingslimeprefix") + " " + tool.getLocalizedToolName();
else name = String.format(
StatCollector.translateToLocal("tool.nameformat"),
StatCollector.translateToLocal("tool.kingslimeprefix"),
tool.getLocalizedToolName());
ItemStack toolStack = ToolBuilder.instance
.buildTool(headStack, handleStack, accessoryStack, extraStack, name);