feat(i18n): complete migration — items, entities, AI goals, GUI screens

119 new translation keys across 3 domains:
- Items/Blocks/Misc (46 keys): tooltips, action messages, trap states
- Entities/AI Goals (55 keys): NPC speech, maid/master/guard messages
- Client GUI (18 keys): widget labels, screen buttons, merchant display

Remaining 119 Component.literal() are all intentional:
- Debug/Admin/Command wands (47) — dev tools, not player-facing
- Entity display names (~25) — dynamic getNpcName() calls
- Empty string roots (~15) — .append() chain bases
- User-typed text (~10) — /me, /pm, /norp chat content
- Runtime data (~12) — StringBuilder, gag muffling, MCA compat
This commit is contained in:
NotEvil
2026-04-16 12:33:13 +02:00
parent 9b2c5dec8e
commit fd60086322
51 changed files with 325 additions and 246 deletions

View File

@@ -644,8 +644,8 @@ public class EntityDamsel
player instanceof net.minecraft.server.level.ServerPlayer sp
) {
sp.displayClientMessage(
Component.literal(
"This NPC needs a collar before you can feed them."
Component.translatable(
"entity.tiedup.damsel.needs_collar_to_feed"
).withStyle(ChatFormatting.RED),
true
);
@@ -660,8 +660,8 @@ public class EntityDamsel
net.minecraft.server.level.ServerPlayer sp
) {
sp.displayClientMessage(
Component.literal(
"You don't own this NPC's collar."
Component.translatable(
"entity.tiedup.damsel.not_collar_owner"
).withStyle(ChatFormatting.RED),
true
);
@@ -675,8 +675,8 @@ public class EntityDamsel
player instanceof net.minecraft.server.level.ServerPlayer sp
) {
sp.displayClientMessage(
Component.literal(
"This NPC can't eat that right now."
Component.translatable(
"entity.tiedup.damsel.cant_eat_now"
).withStyle(ChatFormatting.RED),
true
);

View File

@@ -341,7 +341,7 @@ public class EntityLaborGuard extends EntityDamsel {
}
prisoner.sendSystemMessage(
Component.literal("Attacking your guard is punished!").withStyle(
Component.translatable("entity.tiedup.guard.attack_punished").withStyle(
ChatFormatting.DARK_RED
)
);
@@ -529,8 +529,8 @@ public class EntityLaborGuard extends EntityDamsel {
.getPlayer(prisonerUUID);
if (prisoner != null) {
prisoner.sendSystemMessage(
Component.literal(
"Your guard has been eliminated! You are free!"
Component.translatable(
"entity.tiedup.guard.eliminated_free"
).withStyle(ChatFormatting.GREEN, ChatFormatting.BOLD)
);
}

View File

@@ -447,8 +447,8 @@ public class EntityMaid extends EntityKidnapperElite {
player.position().distanceTo(this.position()) <= 50
) {
player.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"The maid has died. Work is paused. A replacement will arrive in 5 minutes."
net.minecraft.network.chat.Component.translatable(
"entity.tiedup.maid.died_work_paused"
).withStyle(net.minecraft.ChatFormatting.GOLD)
);
}

View File

@@ -606,8 +606,8 @@ public class EntityMaster extends EntityKidnapperElite {
// Send warning message to pet
pet.sendSystemMessage(
Component.literal(
this.getNpcName() + " caught you trying to escape!"
Component.translatable(
"entity.tiedup.master.caught_escaping", this.getNpcName()
).withStyle(Style.EMPTY.withColor(MASTER_NAME_COLOR))
);
}

View File

@@ -200,8 +200,8 @@ public class EntitySlaveTrader extends EntityKidnapperElite {
Component.literal("[" + this.getNpcName() + "] ")
.withStyle(Style.EMPTY.withColor(TRADER_NAME_COLOR))
.append(
Component.literal(
"You don't have a trader token. Leave now, or I'll make you leave."
Component.translatable(
"entity.tiedup.trader.no_token_warning"
).withStyle(ChatFormatting.RED)
)
);
@@ -711,8 +711,8 @@ public class EntitySlaveTrader extends EntityKidnapperElite {
ServerLevel level,
BlockPos campCenter
) {
Component message = Component.literal(
"A slave trader camp has been destroyed!"
Component message = Component.translatable(
"entity.tiedup.trader.camp_destroyed"
).withStyle(ChatFormatting.GOLD, ChatFormatting.BOLD);
// Send to all players within 200 blocks

View File

@@ -93,15 +93,15 @@ public class MerchantTrade {
*/
public Component getPriceDisplay() {
if (ingotPrice > 0 && nuggetPrice > 0) {
return Component.literal(
ingotPrice + " gold + " + nuggetPrice + " nuggets"
return Component.translatable(
"entity.tiedup.trade.price_both", ingotPrice, nuggetPrice
);
} else if (ingotPrice > 0) {
return Component.literal(ingotPrice + " gold");
return Component.translatable("entity.tiedup.trade.price_gold", ingotPrice);
} else if (nuggetPrice > 0) {
return Component.literal(nuggetPrice + " nuggets");
return Component.translatable("entity.tiedup.trade.price_nuggets", nuggetPrice);
} else {
return Component.literal("Free");
return Component.translatable("entity.tiedup.trade.price_free");
}
}

View File

@@ -202,8 +202,8 @@ public class GuardMonitorGoal extends Goal {
);
prisoner.sendSystemMessage(
Component.literal(
"You are too far from your guard! Return within 15 seconds or escape will be triggered!"
Component.translatable(
"goal.tiedup.guard_monitor.too_far"
).withStyle(ChatFormatting.RED, ChatFormatting.BOLD)
);
@@ -227,8 +227,8 @@ public class GuardMonitorGoal extends Goal {
);
prisoner.sendSystemMessage(
Component.literal(
"You returned to your guard. Stay close!"
Component.translatable(
"goal.tiedup.guard_monitor.returned"
).withStyle(ChatFormatting.YELLOW)
);
}

View File

@@ -604,8 +604,8 @@ public class KidnapperDecideNextActionGoal extends Goal {
);
player.sendSystemMessage(
Component.literal(
"You're still tied up - struggle to break free!"
Component.translatable(
"goal.tiedup.kidnapper_decide.still_tied"
).withStyle(ChatFormatting.YELLOW)
);

View File

@@ -351,14 +351,14 @@ public class KidnapperWaitForBuyerGoal extends Goal {
);
Component announcement = Component.literal("")
.append(Component.literal("[SALE] ").withStyle(ChatFormatting.GOLD))
.append(Component.translatable("goal.tiedup.kidnapper_sale.tag").withStyle(ChatFormatting.GOLD))
.append(
Component.literal(this.kidnapper.getNpcName()).withStyle(
ChatFormatting.RED
)
)
.append(
Component.literal(" is selling ").withStyle(
Component.translatable("goal.tiedup.kidnapper_sale.is_selling").withStyle(
ChatFormatting.YELLOW
)
)
@@ -367,13 +367,13 @@ public class KidnapperWaitForBuyerGoal extends Goal {
ChatFormatting.AQUA
)
)
.append(Component.literal(" for ").withStyle(ChatFormatting.YELLOW))
.append(Component.translatable("goal.tiedup.kidnapper_sale.for").withStyle(ChatFormatting.YELLOW))
.append(
Component.literal(price.toDisplayString()).withStyle(
ChatFormatting.GREEN
)
)
.append(Component.literal(" at ").withStyle(ChatFormatting.YELLOW))
.append(Component.translatable("goal.tiedup.kidnapper_sale.at").withStyle(ChatFormatting.YELLOW))
.append(
Component.literal(location).withStyle(ChatFormatting.WHITE)
);

View File

@@ -331,9 +331,9 @@ public class MaidDeliverCaptiveGoal extends Goal {
buyerEntity.getName().getString()
);
buyerEntity.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
captiveEntity.getName().getString() +
" is now on your leash."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_deliver.on_leash",
captiveEntity.getName().getString()
).withStyle(net.minecraft.ChatFormatting.GREEN)
);
} else {
@@ -342,9 +342,9 @@ public class MaidDeliverCaptiveGoal extends Goal {
);
kidnappedState.free(true);
buyerEntity.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
captiveEntity.getName().getString() +
" has been delivered to you."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_deliver.delivered",
captiveEntity.getName().getString()
).withStyle(net.minecraft.ChatFormatting.GREEN)
);
}

View File

@@ -200,13 +200,13 @@ public class MaidAssignTaskGoal extends Goal {
// Notify prisoner
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Task assigned: " + task.getDescription()
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_assign.task_assigned", task.getDescription()
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Reward: " + task.getValue() + " emeralds toward your debt."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_assign.task_reward", task.getValue()
).withStyle(net.minecraft.ChatFormatting.GRAY)
);
@@ -289,8 +289,8 @@ public class MaidAssignTaskGoal extends Goal {
}
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Your debt is paid. You are FREE!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid.debt_paid_free"
).withStyle(
net.minecraft.ChatFormatting.GREEN,
net.minecraft.ChatFormatting.BOLD

View File

@@ -346,9 +346,9 @@ public class MaidExtractGoal extends Goal {
// 7. Notify prisoner
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"You have been extracted for labor. Complete your task: " +
task.getDescription()
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_extract.extracted",
task.getDescription()
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);

View File

@@ -146,8 +146,8 @@ public class MaidIdleGoal extends Goal {
labor.completeTask(currentTime);
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Task complete! Walk back to camp."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_idle.task_complete"
).withStyle(net.minecraft.ChatFormatting.GREEN)
);
@@ -207,17 +207,16 @@ public class MaidIdleGoal extends Goal {
// Max punishment - fail task
labor.failTask(currentTime);
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Task failed due to inactivity! You will be returned to your cell."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_idle.task_failed"
).withStyle(net.minecraft.ChatFormatting.RED)
);
} else {
// Warning
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Warning: Work or face punishment! (" +
shockLevel +
"/3)"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_idle.inactivity_warning",
shockLevel
).withStyle(net.minecraft.ChatFormatting.YELLOW)
);

View File

@@ -165,18 +165,16 @@ public class MaidInitPrisonerGoal extends Goal {
// 6. Notify prisoner
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
String.format(
"You have been imprisoned. Your debt: %d emeralds.",
totalRansom
)
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_init.imprisoned",
totalRansom
).withStyle(net.minecraft.ChatFormatting.RED)
);
if (!confiscated.isEmpty()) {
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Your valuables have been confiscated."
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid_init.confiscated"
).withStyle(net.minecraft.ChatFormatting.GRAY)
);
}

View File

@@ -671,8 +671,8 @@ public class MaidReturnGoal extends Goal {
}
prisoner.sendSystemMessage(
net.minecraft.network.chat.Component.literal(
"Your debt is paid. You are FREE!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.maid.debt_paid_free"
).withStyle(
net.minecraft.ChatFormatting.GREEN,
net.minecraft.ChatFormatting.BOLD

View File

@@ -124,11 +124,10 @@ public class MasterInventoryInspectGoal extends Goal {
ServerPlayer pet = master.getPetPlayer();
if (pet != null && !confiscatedItems.isEmpty()) {
pet.sendSystemMessage(
Component.literal(
master.getNpcName() +
" confiscated " +
confiscatedItems.size() +
" contraband item(s) from you!"
Component.translatable(
"goal.tiedup.master_inspect.confiscated",
master.getNpcName(),
confiscatedItems.size()
).withStyle(
Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR)
)
@@ -180,8 +179,8 @@ public class MasterInventoryInspectGoal extends Goal {
*/
private void performInspection(ServerPlayer pet) {
pet.sendSystemMessage(
Component.literal(
master.getNpcName() + " is inspecting your inventory..."
Component.translatable(
"goal.tiedup.master_inspect.inspecting", master.getNpcName()
).withStyle(Style.EMPTY.withColor(0xFFFF00))
);

View File

@@ -331,8 +331,8 @@ public class MasterTaskAssignGoal extends Goal {
// FIX: Use MessageDispatcher for consistency with earplug system
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"" + message + "\""
Component.translatable(
"goal.tiedup.master_assign.task_speech", master.getNpcName(), message
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
);

View File

@@ -269,8 +269,8 @@ public class MasterTaskWatchGoal extends Goal {
if (remainingSec > 0) {
MessageDispatcher.sendActionBar(
pet,
Component.literal(
task.name() + " - " + remainingSec + "s remaining"
Component.translatable(
"goal.tiedup.master_watch.time_remaining", task.name(), remainingSec
).withStyle(Style.EMPTY.withColor(0xFFAA00))
);
}
@@ -357,8 +357,8 @@ public class MasterTaskWatchGoal extends Goal {
) {
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"I'm waiting...\""
Component.translatable(
"goal.tiedup.master_watch.speak_waiting", master.getNpcName()
).withStyle(
Style.EMPTY.withColor(
EntityMaster.MASTER_NAME_COLOR
@@ -384,8 +384,8 @@ public class MasterTaskWatchGoal extends Goal {
.nextInt(demandWarnings.length)];
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"" + warning + "\""
Component.translatable(
"goal.tiedup.master_watch.demand_warning", master.getNpcName(), warning
).withStyle(
Style.EMPTY.withColor(
EntityMaster.MASTER_NAME_COLOR
@@ -431,8 +431,8 @@ public class MasterTaskWatchGoal extends Goal {
String message = messages[master.getRandom().nextInt(messages.length)];
MessageDispatcher.sendChat(
pet,
Component.literal(
master.getNpcName() + ": \"" + message + "\""
Component.translatable(
"goal.tiedup.master_watch.punishment", master.getNpcName(), message
).withStyle(Style.EMPTY.withColor(EntityMaster.MASTER_NAME_COLOR))
);

View File

@@ -450,8 +450,8 @@ public class NpcGuardCommandGoal extends Goal {
if (player.getUUID().equals(commanderUUID)) {
String slaveName = slave.getNpcName();
player.displayClientMessage(
net.minecraft.network.chat.Component.literal(
npc.getNpcName() + " is chasing " + slaveName + "!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.guard_command.chasing", npc.getNpcName(), slaveName
).withStyle(net.minecraft.ChatFormatting.RED),
true // Action bar
);
@@ -545,8 +545,8 @@ public class NpcGuardCommandGoal extends Goal {
// Send alert message (could be enhanced with dialogue system)
String threatName = threat.getName().getString();
player.displayClientMessage(
net.minecraft.network.chat.Component.literal(
npc.getNpcName() + " spotted: " + threatName + "!"
net.minecraft.network.chat.Component.translatable(
"goal.tiedup.guard_command.spotted", npc.getNpcName(), threatName
).withStyle(net.minecraft.ChatFormatting.YELLOW),
true // Action bar
);

View File

@@ -185,13 +185,13 @@ public class TraderSellGoal extends Goal {
);
potentialBuyer.sendSystemMessage(
Component.literal(
"[" + trader.getNpcName() + "] " + greeting
Component.translatable(
"goal.tiedup.trader_sell.greeting", trader.getNpcName(), greeting
).withStyle(net.minecraft.ChatFormatting.GOLD)
);
potentialBuyer.sendSystemMessage(
Component.literal("Right-click me to browse my stock.").withStyle(
Component.translatable("goal.tiedup.trader_sell.browse_hint").withStyle(
net.minecraft.ChatFormatting.GRAY
)
);

View File

@@ -165,8 +165,8 @@ public class MaidPrisonInteraction {
sayToPlayer(player, "Very well. Here are your tools.");
player.sendSystemMessage(
Component.literal(
"The maid manually assigns you to: " + task.getDescription()
Component.translatable(
"entity.tiedup.maid.manual_assign", task.getDescription()
).withStyle(ChatFormatting.YELLOW)
);
@@ -206,8 +206,8 @@ public class MaidPrisonInteraction {
sayToPlayer(worker, "Good. You've completed your task.");
worker.sendSystemMessage(
Component.literal(
"A Maid will come to collect you shortly."
Component.translatable(
"entity.tiedup.maid.collect_shortly"
).withStyle(ChatFormatting.YELLOW)
);
@@ -229,13 +229,13 @@ public class MaidPrisonInteraction {
@Nullable LaborRecord laborRecord
) {
player.sendSystemMessage(
Component.literal("=== Labor Status ===").withStyle(
Component.translatable("entity.tiedup.maid.labor_status_header").withStyle(
ChatFormatting.GOLD
)
);
player.sendSystemMessage(
Component.literal("State: " + record.getState().name()).withStyle(
Component.translatable("entity.tiedup.maid.labor_status_state", record.getState().name()).withStyle(
ChatFormatting.GRAY
)
);
@@ -243,13 +243,13 @@ public class MaidPrisonInteraction {
if (laborRecord != null && laborRecord.getTask() != null) {
LaborTask task = laborRecord.getTask();
player.sendSystemMessage(
Component.literal("Task: " + task.getDescription()).withStyle(
Component.translatable("entity.tiedup.maid.labor_status_task", task.getDescription()).withStyle(
ChatFormatting.GRAY
)
);
player.sendSystemMessage(
Component.literal(
"Progress: " + task.getProgress() + "/" + task.getQuota()
Component.translatable(
"entity.tiedup.maid.labor_status_progress", task.getProgress(), task.getQuota()
).withStyle(ChatFormatting.GRAY)
);
}
@@ -262,8 +262,8 @@ public class MaidPrisonInteraction {
RansomRecord ransom = manager.getRansomRecord(player.getUUID());
int remaining = ransom != null ? ransom.getRemainingDebt() : 0;
player.sendSystemMessage(
Component.literal(
"Remaining debt: " + remaining + " emeralds"
Component.translatable(
"entity.tiedup.maid.labor_status_debt", remaining
).withStyle(ChatFormatting.GRAY)
);
@@ -273,8 +273,8 @@ public class MaidPrisonInteraction {
laborRecord.getPhase() == LaborRecord.WorkPhase.PENDING_EXTRACTION
) {
player.sendSystemMessage(
Component.literal(
"Shift+Right-Click to manually start task"
Component.translatable(
"entity.tiedup.maid.labor_hint_start_task"
).withStyle(ChatFormatting.YELLOW)
);
} else if (
@@ -283,8 +283,8 @@ public class MaidPrisonInteraction {
laborRecord.getTask().isComplete()
) {
player.sendSystemMessage(
Component.literal(
"Shift+Right-Click to manually turn in task"
Component.translatable(
"entity.tiedup.maid.labor_hint_turn_in"
).withStyle(ChatFormatting.GREEN)
);
}

View File

@@ -199,8 +199,8 @@ public class MasterPetManager {
// Send message to player
player.sendSystemMessage(
Component.literal(
"You are free! Your master " + master.getNpcName() + " is gone."
Component.translatable(
"entity.tiedup.master.pet_freed", master.getNpcName()
).withStyle(Style.EMPTY.withColor(0x00FF00))
);
}