-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Mod's version
1.20.1
Issue
A ton of strings in the mod are hardcoded. Please, replace untranslatable components (Component.literal
) with translatable (Component.translatable
).
Classes/Interfaces in question
SolarForgeBlockItem.java
Line 39 in 9c635c3
list.add(Component.literal("ALL ENERGY IS LOST WHEN BROKEN!").withStyle(ChatFormatting.RED)); |
InfusingTableBlock.java
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/blocks/InfusingTableBlock.java
Line 52 in 9c635c3
player.sendSystemMessage(Component.literal("You are not the owner!").withStyle(ChatFormatting.RED)); |
StructureScreen.java
Line 96 in 9c635c3
graphics.renderTooltip(font,Component.literal("3D View"),mx,my); |
RunicTablePacket.java
Line 98 in 9c635c3
player.sendSystemMessage(Component.literal("Couldn't find any unlockable fragment. Tell that to dev if you haven't done anything suspicious.").withStyle(ChatFormatting.RED)); |
ElementWeaverContainerScreen.java
You could shorten this code with loop and any offset structure, but whatever works, I guessClientPacketHandles.java
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/packet_handler/ClientPacketHandles.java
Line 168 in 9c635c3
ClientHelpers.getClientPlayer().sendSystemMessage(Component.literal("You don't have structure fragment(s) for this structure!")); |
RadiantPortalCreatorTile.java
Line 57 in 9c635c3
entity.sendSystemMessage(Component.literal("Use wormhole on 1,Y(~120),1 coordinates to return back")); |
InfuserBlock.java
Line 93 in 9c635c3
user.sendSystemMessage(Component.literal("You are not the owner!").withStyle(ChatFormatting.RED)); |
DimensionCoreTile.java
Line 117 in 9c635c3
entity.sendSystemMessage(Component.literal("Use wormhole on 1,Y(~120),1 coordinates to return back")); |
RunicEnergyCoreTile.java
Line 155 in 9c635c3
user.sendSystemMessage(Component.literal("Draining Energy: " + !isDrainingEnergy())); |
SolarNetworkBinderWandAction.java
Line 46 in 9c635c3
player.displayClientMessage(Component.literal("Position cleared"),true); |
MemoryPuzzleBlockEntity.java
Line 106 in 9c635c3
player.sendSystemMessage(Component.literal("No Solar Key was found in inventory.")); |
EnchanterBlock.java
Line 54 in 9c635c3
player.sendSystemMessage(Component.literal("You are not the owner!").withStyle(ChatFormatting.RED)); |
SolarCraftCommands.java
I was thinking to add this class or not, but other modders tend to add translatable strings even for debugging stuff. There are 30+ matches, I'm not listing all of them.
Line 120 in 9c635c3
stack.sendSuccess(()->Component.literal("Successfully unlocked ability."),true); |
SolarOrbitalMissileLauncherScreen.java
Line 49 in 9c635c3
IntegerEditBox radbox = new IntegerEditBox(font,relX + 8,relY + 26 + 18*2 + 40,209,18, Component.literal("Rad")); |
Line 50 in 9c635c3
IntegerEditBox depthbox = new IntegerEditBox(font,relX + 8,relY + 26 + 18*3 + 60,209,18, Component.literal("Depth")); |
TeleportationStone.java
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/items/TeleportationStone.java
Line 147 in 9c635c3
player.sendSystemMessage(Component.literal("Teleportation stone cannot be used here.").withStyle(ChatFormatting.RED)); |
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/items/TeleportationStone.java
Line 157 in 9c635c3
player.sendSystemMessage(Component.literal("Could not find level " + this.dimension.location() + ", try again.").withStyle(ChatFormatting.RED)); |
SolarLexicon.java
Line 215 in 9c635c3
.addComponent(new FDTextComponent(ContentAlignment.NO_ALIGNMENT,size,0).setText(Component.literal("Parent progressions:"),0xffffff).setInnerBorder(3)) |
Line 245 in 9c635c3
builder.addComponent(new FDTextComponent(ContentAlignment.NO_ALIGNMENT,size,0).setText(Component.literal("SPOIILER: ") |
InfusingRecipeEnergyScreen.java
Line 60 in 9c635c3
graphics.renderTooltip(font,Component.literal("Next recipe"),mousex,mousey); |
Line 72 in 9c635c3
graphics.renderTooltip(font,Component.literal("Previous recipe"),mousex,mousey); |
SolarForgeScreen.java
Line 51 in 9c635c3
graphics.renderTooltip(font, List.of(Component.literal("Consume energy. Abilities were moved to separate screen"), |
Line 52 in 9c635c3
Component.literal("look into hotkey settings.") |
CraftingRecipeScreen.java
Line 64 in 9c635c3
graphics.renderTooltip(font,Component.literal("Next recipe"),mousex,mousey); |
Line 75 in 9c635c3
graphics.renderTooltip(font,Component.literal("Previous recipe"),mousex,mousey); |
InfusingCraftingRecipeScreen.java
Line 57 in 9c635c3
graphics.renderTooltip(font,Component.literal("Next recipe"),mousex,mousey); |
Line 68 in 9c635c3
graphics.renderTooltip(font,Component.literal("Previous recipe"),mousex,mousey); |
SolarNetworkBinder.java
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/items/SolarNetworkBinder.java
Line 41 in 9c635c3
ctx.getPlayer().displayClientMessage(Component.literal("Positions cleared"),true); |
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/items/SolarNetworkBinder.java
Line 51 in 9c635c3
cmps.add(Component.literal("Pos 1: " + getPos1(item)).withStyle(ChatFormatting.GOLD)); |
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/items/SolarNetworkBinder.java
Line 52 in 9c635c3
cmps.add(Component.literal("Pos 2: " + getPos2(item)).withStyle(ChatFormatting.GOLD)); |
DungeonRayControllerStick.java
Line 49 in 9c635c3
player.sendSystemMessage(Component.literal("Controller set")); |
Line 51 in 9c635c3
player.sendSystemMessage(Component.literal("Controller not found")); |
Line 72 in 9c635c3
player.sendSystemMessage(Component.literal("Created handler")); |
Line 146 in 9c635c3
player.sendSystemMessage(Component.literal("Added offset:" + clicked.subtract(epos))); |
InfusingCraftingTableTile.java
Line 179 in 9c635c3
pl.sendSystemMessage(Component.literal("Cant start craft, you don't have " + recipe.get().value().getFragment().getId().toUpperCase(Locale.ROOT) + |
Line 183 in 9c635c3
pl.sendSystemMessage(Component.literal("INCORRECT FRAGMENT IN RECIPE "+ recipe.get().value().getOutput().getDisplayName()+" TELL MOD AUTHOR TO FIX IT").withStyle(ChatFormatting.RED)); |
Line 186 in 9c635c3
pl.sendSystemMessage(Component.literal("Recipe invalid.").withStyle(ChatFormatting.RED)); |
Line 191 in 9c635c3
pl.sendSystemMessage(Component.literal("You are not the owner!").withStyle(ChatFormatting.RED)); |
StructureSelectionScreen.java
Line 83 in 9c635c3
Minecraft.getInstance().player.sendSystemMessage(Component.literal("Structure is correct") |
Line 90 in 9c635c3
minecraft.player.sendSystemMessage(Component.literal("And more...").withStyle(ChatFormatting.RED)); |
Line 98 in 9c635c3
String message1 = "Structure incorrect at: " + ChatFormatting.GOLD + incState.atPos(); |
Line 99 in 9c635c3
String message2 = "BlockState should be: " + ChatFormatting.GOLD +incState.correct(); |
Line 100 in 9c635c3
String message3 = "Now: " + ChatFormatting.GOLD + incState.incorrect(); |
InfuserTileEntity.java
Line 468 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("Can't access inventory").withStyle(ChatFormatting.RED)); |
Line 476 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("Clear the output slot").withStyle(ChatFormatting.RED)); |
Line 483 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("Unable to start ").withStyle(ChatFormatting.RED) |
Line 484 in 9c635c3
.append(Component.literal("melting").withStyle(ChatFormatting.GOLD)).append(" the item: Sun Shard") |
Line 506 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("Catalysts don't match the recipe.").withStyle(ChatFormatting.RED)); |
Line 509 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("Structure invalid.").withStyle(ChatFormatting.RED)); |
Line 521 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("Recipe invalid").withStyle(ChatFormatting.RED)); |
Line 526 in 9c635c3
playerEntity.sendSystemMessage(Component.literal("INCORRECT FRAGMENT IN RECIPE "+ opt.get().value().output.getDisplayName().getString()+" TELL MOD AUTHOR TO FIX IT").withStyle(ChatFormatting.RED)); |
In next classes/interfaces, Component.literal(type.id.toUpperCase(Locale.ROOT)
Can be changed with Component.translatable("solarcraft.rune_energy_type." + type.id).append(...)
InfusingRecipeCategory.java
Line 129 in 9c635c3
components.add(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": ").withStyle(ChatFormatting.GOLD) |
AbilityHelper.java
SolarCraftRepository/src/main/java/com/finderfeed/solarcraft/content/abilities/AbilityHelper.java
Line 27 in 9c635c3
.append(Component.literal(" " + type.id.toUpperCase(Locale.ROOT) + ", ")) |
ItemRunicEnergy.java
Line 85 in 9c635c3
components.add(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": %.2f".formatted(getRunicEnergyFromItem(stack,type)) + "/" + item.getMaxRunicEnergyCapacity()).withStyle(ChatFormatting.GOLD)); |
InfusingRecipeScreen.java
Line 227 in 9c635c3
graphics.renderTooltip(font,Component.literal(type.id.toUpperCase(Locale.ROOT)).withStyle(ChatFormatting.GOLD),mousex,mousey); |
RETypeSelectionScreen.java
Line 54 in 9c635c3
graphics.renderTooltip(font, Component.literal(type.id.toUpperCase(Locale.ROOT)),(int)x,(int)y); |
UnlockedEnergyTypeToast.java
Line 32 in 9c635c3
graphics.drawCenteredString(cmp.getMinecraft().font,type.id.toUpperCase(Locale.ROOT),81,7,0xffffff); |
RuneEnergyPylonBlockItem.java
Line 48 in 9c635c3
.append(Component.literal(": " + type.id.toUpperCase(Locale.ROOT)))); |
EnchanterContainerScreen.java
Line 188 in 9c635c3
components.add(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": ").withStyle(ChatFormatting.GOLD) |
RunicEnergyChargerScreen.java
Line 84 in 9c635c3
components.add(Component.literal(type.id.toUpperCase(Locale.ROOT)).append(Component.literal(": "+ re + "/" + menu.tile.getRunicEnergyLimit()).withStyle(ChatFormatting.GOLD))); |
InfusingRecipeScreen.java
Line 92 in 9c635c3
graphics.renderTooltip(font,Component.literal("Next recipe"),mousex,mousey); |
Line 103 in 9c635c3
graphics.renderTooltip(font ,Component.literal("Previous recipe"),mousex,mousey); |
IRunicEnergySaver.java
Line 32 in 9c635c3
components.add(Component.literal(type.id.toUpperCase(Locale.ROOT)).withStyle(ChatFormatting.GOLD) |
Line 42 in 9c635c3
components.add(Component.literal(type.id.toUpperCase(Locale.ROOT)).withStyle(ChatFormatting.GOLD) |
RENetworkConnectivityWandAction.java
Line 55 in 9c635c3
player.sendSystemMessage(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": CONNECTED") |
Line 58 in 9c635c3
player.sendSystemMessage(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": NOT CONNECTED") |
Line 66 in 9c635c3
player.sendSystemMessage(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": CONNECTED") |
Line 69 in 9c635c3
player.sendSystemMessage(Component.literal(type.id.toUpperCase(Locale.ROOT) + ": NOT CONNECTED") |
Strings not associated with Component.literal, but which should be able to be translated
Line 94 in 9c635c3
graphics.drawCenteredString(font,"Runic Energy Charger",relX + 89 + xOffset,relY + 13 + yOffset, SolarLexiconScreen.TEXT_COLOR); |
Line 250 in 9c635c3
graphics.drawCenteredString(mc.font,"Recipe Progress",width/2,height / 2 + 20,0xffffff); |