feat(C-01): i18n subcommands — 33 translatable keys
Phase 2: Migrate all Component.literal() in 5 subcommand files. - BindCommands, GagCommands, BlindfoldCommands, CollarCommands, AccessoryCommands - Strip \u00a7a section signs, use .withStyle(ChatFormatting.GREEN) - Add 33 keys to en_us.json (command.tiedup.*) - Shared error key: command.tiedup.error.no_state
This commit is contained in:
@@ -6,6 +6,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.tiedup.remake.commands.CommandHelper;
|
||||
import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
@@ -51,7 +52,7 @@ public class BindCommands {
|
||||
if (state == null) {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(Component.literal("Failed to get player state"));
|
||||
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -59,9 +60,9 @@ public class BindCommands {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(
|
||||
Component.literal(
|
||||
targetPlayer.getName().getString() +
|
||||
" is already tied up"
|
||||
Component.translatable(
|
||||
"command.tiedup.bind.already_tied",
|
||||
targetPlayer.getName().getString()
|
||||
)
|
||||
);
|
||||
return 0;
|
||||
@@ -76,11 +77,10 @@ public class BindCommands {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
"\u00a7a" +
|
||||
targetPlayer.getName().getString() +
|
||||
" has been tied up"
|
||||
),
|
||||
Component.translatable(
|
||||
"command.tiedup.bind.tied",
|
||||
targetPlayer.getName().getString()
|
||||
).withStyle(ChatFormatting.GREEN),
|
||||
true
|
||||
);
|
||||
SystemMessageManager.sendTiedUp(
|
||||
@@ -99,7 +99,7 @@ public class BindCommands {
|
||||
if (state == null) {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(Component.literal("Failed to get player state"));
|
||||
.sendFailure(Component.translatable("command.tiedup.error.no_state"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -112,9 +112,9 @@ public class BindCommands {
|
||||
context
|
||||
.getSource()
|
||||
.sendFailure(
|
||||
Component.literal(
|
||||
targetPlayer.getName().getString() +
|
||||
" is not restrained"
|
||||
Component.translatable(
|
||||
"command.tiedup.bind.not_restrained",
|
||||
targetPlayer.getName().getString()
|
||||
)
|
||||
);
|
||||
return 0;
|
||||
@@ -149,11 +149,10 @@ public class BindCommands {
|
||||
.getSource()
|
||||
.sendSuccess(
|
||||
() ->
|
||||
Component.literal(
|
||||
"\u00a7a" +
|
||||
targetPlayer.getName().getString() +
|
||||
" has been freed from all restraints"
|
||||
),
|
||||
Component.translatable(
|
||||
"command.tiedup.bind.freed",
|
||||
targetPlayer.getName().getString()
|
||||
).withStyle(ChatFormatting.GREEN),
|
||||
true
|
||||
);
|
||||
SystemMessageManager.sendFreed(targetPlayer);
|
||||
|
||||
Reference in New Issue
Block a user