Skip to content

Commit 65973f3

Browse files
committed
changed hard coded untranslatable lang for auto generated blocks to translatable
1 parent 109f2b2 commit 65973f3

2 files changed

Lines changed: 26 additions & 20 deletions

File tree

‎src/main/java/net/f3rr3/reshaped/mixin/client/RuntimeNameMixin.java‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.minecraft.block.Blocks;
66
import net.minecraft.client.resource.language.TranslationStorage;
77
import net.minecraft.registry.Registries;
8+
import net.minecraft.text.Text;
89
import net.minecraft.util.Identifier;
910
import org.spongepowered.asm.mixin.Mixin;
1011
import org.spongepowered.asm.mixin.Unique;
@@ -48,13 +49,16 @@ private void onGet(String key, String fallback, CallbackInfoReturnable<String> c
4849
.replace(" Block", "")
4950
.replace(" Bricks", " Brick");
5051

51-
if (path.endsWith("_vertical_slab")) return cleanedBase + " Vertical Slab";
52-
if (path.endsWith("_vertical_stairs")) return cleanedBase + " Vertical Stairs";
53-
if (path.endsWith("_vertical_step")) return cleanedBase + " Vertical Step";
54-
if (path.endsWith("_corner")) return cleanedBase + " Corner";
55-
if (path.endsWith("_slab")) return cleanedBase + " Slab";
56-
if (path.endsWith("_stairs")) return cleanedBase + " Stairs";
57-
if (path.endsWith("_step")) return cleanedBase + " Step";
52+
if (path.endsWith("_vertical_slab"))
53+
return cleanedBase + " " + Text.translatable("block.reshaped.vertical_slab").getString();
54+
if (path.endsWith("_vertical_stairs"))
55+
return cleanedBase + " " + Text.translatable("block.reshaped.vertical_stairs").getString();
56+
if (path.endsWith("_vertical_step"))
57+
return cleanedBase + " " + Text.translatable("block.reshaped.vertical_step").getString();
58+
if (path.endsWith("_corner")) return cleanedBase + " " + Text.translatable("block.reshaped.corner").getString();
59+
if (path.endsWith("_slab")) return cleanedBase + " " + Text.translatable("block.reshaped.slab").getString();
60+
if (path.endsWith("_stairs")) return cleanedBase + " " + Text.translatable("block.reshaped.stairs").getString();
61+
if (path.endsWith("_step")) return cleanedBase + " " + Text.translatable("block.reshaped.step").getString();
5862

5963
return null;
6064
}
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
{
2-
"block.reshaped.vertical_stairs": "Vertical Stairs",
3-
"block.reshaped.vertical_slab": "Vertical Slab",
4-
"block.reshaped.mixed_vertical_slab": "Mixed Vertical Slab",
52
"block.reshaped.corner": "Corner",
63
"block.reshaped.mixed_corner": "Mixed Corner",
7-
"block.reshaped.vertical_step": "Vertical Step",
4+
"block.reshaped.mixed_slab": "Mixed Slab",
5+
"block.reshaped.mixed_step": "Mixed Step",
6+
"block.reshaped.mixed_vertical_slab": "Mixed Vertical Slab",
87
"block.reshaped.mixed_vertical_step": "Mixed Vertical Step",
8+
"block.reshaped.slab": "Slab",
9+
"block.reshaped.stairs": "Stairs",
910
"block.reshaped.step": "Step",
10-
"block.reshaped.mixed_step": "Mixed Step",
11-
"block.reshaped.mixed_slab": "Mixed Slab",
11+
"block.reshaped.vertical_slab": "Vertical Slab",
12+
"block.reshaped.vertical_stairs": "Vertical Stairs",
13+
"block.reshaped.vertical_step": "Vertical Step",
1214
"category.reshaped": "Reshaped",
1315
"key.reshaped.open_radial_menu": "Open Radial Menu",
14-
"text.autoconfig.reshaped.title": "ReShaped config",
15-
"text.autoconfig.reshaped.option.radial": "Radial menu",
16-
"text.autoconfig.reshaped.option.radial.ImageResolution": "Radial menu resolution",
17-
"text.autoconfig.reshaped.option.radial.ColorSelectedSlice": "Radial menu selected slice color",
18-
"text.autoconfig.reshaped.option.radial.ColorUnselectedSlice": "Radial menu unselected slice color",
1916
"text.autoconfig.reshaped.option.ItemBadges": "Item badges",
2017
"text.autoconfig.reshaped.option.ItemBadges.enableRadial": "Enable + item badges",
2118
"text.autoconfig.reshaped.option.ItemBadges.enableWaxed": "Enable waxed item badges",
19+
"text.autoconfig.reshaped.option.enableDevMode": "Enable developer renders",
2220
"text.autoconfig.reshaped.option.enableTooltip": "Enable tooltips for reshapable blocks",
2321
"text.autoconfig.reshaped.option.hideAlternateBlocks": "Hide alternate matrix blocks in creative inventory",
24-
"text.autoconfig.reshaped.option.enableDevMode": "Enable developer renders"
25-
}
22+
"text.autoconfig.reshaped.option.radial": "Radial menu",
23+
"text.autoconfig.reshaped.option.radial.ColorSelectedSlice": "Radial menu selected slice color",
24+
"text.autoconfig.reshaped.option.radial.ColorUnselectedSlice": "Radial menu unselected slice color",
25+
"text.autoconfig.reshaped.option.radial.ImageResolution": "Radial menu resolution",
26+
"text.autoconfig.reshaped.title": "ReShaped config"
27+
}

0 commit comments

Comments
 (0)