Skip to content

Commit 102e4e0

Browse files
authored
Un-hardcode toolbelt localization (#2727)
1 parent 11c1647 commit 102e4e0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/main/java/gregtech/api/items/toolitem/ItemGTToolbelt.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,14 @@ public void setSelectedTool(int slot, ItemStack stack) {
451451
@Override
452452
public @NotNull String getItemStackDisplayName(@NotNull ItemStack stack) {
453453
ItemStack tool = getHandler(stack).getSelectedStack();
454-
String selectedToolDisplay = "";
454+
getHandler(stack).disablePassthrough();
455+
String name;
455456
if (!tool.isEmpty()) {
456-
selectedToolDisplay = " (" + tool.getDisplayName() + ")";
457+
name = LocalizationUtils.format(getTranslationKey() + ".select", getToolMaterial(stack).getLocalizedName(),
458+
tool.getDisplayName());
459+
} else {
460+
name = LocalizationUtils.format(getTranslationKey(), getToolMaterial(stack).getLocalizedName());
457461
}
458-
getHandler(stack).disablePassthrough();
459-
String name = LocalizationUtils.format(getTranslationKey(), getToolMaterial(stack).getLocalizedName(),
460-
selectedToolDisplay);
461462
getHandler(stack).enablePassthrough();
462463
return name;
463464
}

src/main/resources/assets/gregtech/lang/en_us.lang

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,8 @@ item.gt.tool.plunger.tooltip=§8Removes Fluids from Machines
10431043
item.gt.tool.wire_cutter_lv.name=%s Wire Cutter (LV)
10441044
item.gt.tool.wire_cutter_hv.name=%s Wire Cutter (HV)
10451045
item.gt.tool.wire_cutter_iv.name=%s Wire Cutter (IV)
1046-
item.gt.tool.toolbelt.name=%s Toolbelt%s
1046+
item.gt.tool.toolbelt.name=%s Toolbelt
1047+
item.gt.tool.toolbelt.name.select=%s Toolbelt (%s)
10471048
item.gt.tool.toolbelt.size=§a%s Tool Slots
10481049
item.gt.tool.toolbelt.tooltip=Holds GT or vanilla-esque tools that can be manually selected for in-world use, automatically selected for crafting, or stored for maintenance repair.
10491050
item.gt.tool.toolbelt.paint=Also supports Spray Cans.

0 commit comments

Comments
 (0)