feat(C-01): i18n main commands — 148 translatable keys
Phase 3: Migrate Component.literal() in all remaining command files. - NPCCommand (34), CellCommand (33), SocialCommand (16), CollarCommand (25), KeyCommand (18), BountyCommand (6), KidnapSetCommand (2), CaptivityDebugCommand (7), InventorySubCommand (3), TestAnimSubCommand (2), MasterTestSubCommand (7), DebtSubCommand (8) - Strip all section sign color codes, use .withStyle(ChatFormatting) - 148 new keys in en_us.json (command.tiedup.*) - Debug/dynamic strings intentionally kept as literal
This commit is contained in:
@@ -7,6 +7,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.tiedup.remake.commands.CommandHelper;
|
||||
import com.tiedup.remake.prison.PrisonerManager;
|
||||
import com.tiedup.remake.prison.RansomRecord;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.commands.arguments.EntityArgument;
|
||||
@@ -77,9 +78,8 @@ public class DebtSubCommand {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
target.getName().getString() +
|
||||
" has no debt record."
|
||||
Component.translatable(
|
||||
"command.tiedup.debt.no_record", target.getName().getString()
|
||||
),
|
||||
false
|
||||
);
|
||||
@@ -94,16 +94,11 @@ public class DebtSubCommand {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
target.getName().getString() +
|
||||
" \u2014 Debt: " +
|
||||
total +
|
||||
" | Paid: " +
|
||||
paid +
|
||||
" | Remaining: " +
|
||||
remaining +
|
||||
" emeralds"
|
||||
),
|
||||
Component.translatable(
|
||||
"command.tiedup.debt.show",
|
||||
target.getName().getString(),
|
||||
total, paid, remaining
|
||||
).withStyle(ChatFormatting.YELLOW),
|
||||
false
|
||||
);
|
||||
return 1;
|
||||
@@ -121,9 +116,7 @@ public class DebtSubCommand {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(
|
||||
Component.literal(
|
||||
target.getName().getString() + " has no debt record."
|
||||
)
|
||||
Component.translatable("command.tiedup.debt.no_record", target.getName().getString())
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
@@ -133,13 +126,10 @@ public class DebtSubCommand {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
"Set " +
|
||||
target.getName().getString() +
|
||||
"'s total debt to " +
|
||||
amount +
|
||||
" emeralds."
|
||||
),
|
||||
Component.translatable(
|
||||
"command.tiedup.debt.set",
|
||||
target.getName().getString(), amount
|
||||
).withStyle(ChatFormatting.GREEN),
|
||||
true
|
||||
);
|
||||
return 1;
|
||||
@@ -157,9 +147,7 @@ public class DebtSubCommand {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(
|
||||
Component.literal(
|
||||
target.getName().getString() + " has no debt record."
|
||||
)
|
||||
Component.translatable("command.tiedup.debt.no_record", target.getName().getString())
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
@@ -169,14 +157,10 @@ public class DebtSubCommand {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
"Added " +
|
||||
amount +
|
||||
" emeralds to " +
|
||||
target.getName().getString() +
|
||||
"'s debt. Remaining: " +
|
||||
ransom.getRemainingDebt()
|
||||
),
|
||||
Component.translatable(
|
||||
"command.tiedup.debt.added",
|
||||
amount, target.getName().getString(), ransom.getRemainingDebt()
|
||||
).withStyle(ChatFormatting.GREEN),
|
||||
true
|
||||
);
|
||||
return 1;
|
||||
@@ -194,9 +178,7 @@ public class DebtSubCommand {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(
|
||||
Component.literal(
|
||||
target.getName().getString() + " has no debt record."
|
||||
)
|
||||
Component.translatable("command.tiedup.debt.no_record", target.getName().getString())
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
@@ -207,15 +189,10 @@ public class DebtSubCommand {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
"Removed " +
|
||||
amount +
|
||||
" emeralds from " +
|
||||
target.getName().getString() +
|
||||
"'s debt. Remaining: " +
|
||||
ransom.getRemainingDebt() +
|
||||
(paid ? " (PAID OFF!)" : "")
|
||||
),
|
||||
Component.translatable(
|
||||
paid ? "command.tiedup.debt.removed_paid" : "command.tiedup.debt.removed",
|
||||
amount, target.getName().getString(), ransom.getRemainingDebt()
|
||||
).withStyle(ChatFormatting.GREEN),
|
||||
true
|
||||
);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user