Skip to content

Commit 1334f3a

Browse files
committed
i18n | Missing Locales
1 parent 1ea39a6 commit 1334f3a

7 files changed

Lines changed: 113 additions & 92 deletions

File tree

src/commands/serverconfig/autochchannels.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ export const configureSubcommand = (
1919
subcommand
2020
.setName("autochchannels")
2121
.setDescription(
22-
localizer("en-US", "commands.config.autochchannels.description"),
22+
localizer("en-US", "commands.serverconfig.autochchannels.description"),
2323
)
2424
.addChannelOption((option) =>
2525
option
2626
.setName("channel")
2727
.setDescription(
2828
localizer(
2929
"en-US",
30-
"commands.config.autochchannels.channel_description",
30+
"commands.serverconfig.autochchannels.channel_description",
3131
),
3232
)
3333
.addChannelTypes(ChannelType.GuildText)
@@ -39,17 +39,17 @@ export const configureSubcommand = (
3939
.setDescription(
4040
localizer(
4141
"en-US",
42-
"commands.config.autochchannels.action_description",
42+
"commands.serverconfig.autochchannels.action_description",
4343
),
4444
)
4545
.setRequired(true)
4646
.addChoices(
4747
{
48-
name: localizer("en-US", "commands.config.options.add"),
48+
name: localizer("en-US", "commands.choices.add"),
4949
value: "add",
5050
},
5151
{
52-
name: localizer("en-US", "commands.config.options.remove"),
52+
name: localizer("en-US", "commands.choices.remove"),
5353
value: "remove",
5454
},
5555
),
@@ -86,9 +86,9 @@ export async function execute(
8686
// Validate channel type (should be a text channel) - let helper functions manage interaction state
8787
if (channel.type !== ChannelType.GuildText) {
8888
await replyInfoEmbed(interaction, locale, {
89-
titleKey: "commands.config.autochchannels.invalid_channel_title",
89+
titleKey: "commands.serverconfig.autochchannels.invalid_channel_title",
9090
descriptionKey:
91-
"commands.config.autochchannels.invalid_channel_description",
91+
"commands.serverconfig.autochchannels.invalid_channel_description",
9292
color: ColorCode.ERROR,
9393
});
9494
return;
@@ -111,9 +111,9 @@ export async function execute(
111111
// Check if the channel is already in the list (when adding)
112112
if (action === "add" && currentChannels.includes(channel.id)) {
113113
await replyInfoEmbed(interaction, locale, {
114-
titleKey: "commands.config.autochchannels.already_added_title",
114+
titleKey: "commands.serverconfig.autochchannels.already_added_title",
115115
descriptionKey:
116-
"commands.config.autochchannels.already_added_description",
116+
"commands.serverconfig.autochchannels.already_added_description",
117117
descriptionVars: {
118118
channel_name: channel.name ?? "UNDEFINED_CH",
119119
},
@@ -125,9 +125,9 @@ export async function execute(
125125
// Check if the channel is not in the list (when removing)
126126
if (action === "remove" && !currentChannels.includes(channel.id)) {
127127
await replyInfoEmbed(interaction, locale, {
128-
titleKey: "commands.config.autochchannels.not_in_list_title",
128+
titleKey: "commands.serverconfig.autochchannels.not_in_list_title",
129129
descriptionKey:
130-
"commands.config.autochchannels.not_in_list_description",
130+
"commands.serverconfig.autochchannels.not_in_list_description",
131131
descriptionVars: {
132132
channel_name: channel.name ?? "UNDEFINED_CH",
133133
},
@@ -209,12 +209,12 @@ export async function execute(
209209
await replyInfoEmbed(interaction, locale, {
210210
titleKey:
211211
action === "add"
212-
? "commands.config.autochchannels.added_title"
213-
: "commands.config.autochchannels.removed_title",
212+
? "commands.serverconfig.autochchannels.added_title"
213+
: "commands.serverconfig.autochchannels.removed_title",
214214
descriptionKey:
215215
action === "add"
216-
? "commands.config.autochchannels.added_description"
217-
: "commands.config.autochchannels.removed_description",
216+
? "commands.serverconfig.autochchannels.added_description"
217+
: "commands.serverconfig.autochchannels.removed_description",
218218
descriptionVars: {
219219
channel_name: channel.name ?? "UNDEFINED_CH",
220220
},

src/commands/serverconfig/autochthreshold.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ export const configureSubcommand = (
2323
subcommand
2424
.setName("autochthreshold")
2525
.setDescription(
26-
localizer("en-US", "commands.config.autochthreshold.description"),
26+
localizer("en-US", "commands.serverconfig.autochthreshold.description"),
2727
)
2828
.addIntegerOption((option) =>
2929
option
3030
.setName("threshold")
3131
.setDescription(
3232
localizer(
3333
"en-US",
34-
"commands.config.autochthreshold.threshold_description_v2",
34+
"commands.serverconfig.autochthreshold.threshold_description_v2",
3535
),
3636
)
3737
.setMinValue(MIN_THRESHOLD)
@@ -73,9 +73,9 @@ Setting to '0' will disable auto-chat
7373

7474
if (!isValidThreshold) {
7575
await replyInfoEmbed(interaction, locale, {
76-
titleKey: "commands.config.autochthreshold.invalid_range_title",
76+
titleKey: "commands.serverconfig.autochthreshold.invalid_range_title",
7777
descriptionKey:
78-
"commands.config.autochthreshold.invalid_range_specific_description",
78+
"commands.serverconfig.autochthreshold.invalid_range_specific_description",
7979
descriptionVars: {
8080
min: MIN_THRESHOLD.toString(),
8181
range_start: RANGE_START_THRESHOLD.toString(),
@@ -161,11 +161,11 @@ Setting to '0' will disable auto-chat
161161
const isAutoChatEnabled = threshold > 0;
162162
await replyInfoEmbed(interaction, locale, {
163163
titleKey: isAutoChatEnabled
164-
? "commands.config.autochthreshold.success_title"
165-
: "commands.config.autochthreshold.success_disabled_title",
164+
? "commands.serverconfig.autochthreshold.success_title"
165+
: "commands.serverconfig.autochthreshold.success_disabled_title",
166166
descriptionKey: isAutoChatEnabled
167-
? "commands.config.autochthreshold.success_description"
168-
: "commands.config.autochthreshold.success_disabled_description",
167+
? "commands.serverconfig.autochthreshold.success_description"
168+
: "commands.serverconfig.autochthreshold.success_disabled_description",
169169
descriptionVars: {
170170
threshold: threshold.toString(),
171171
},

src/commands/serverconfig/avatar.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ export const configureSubcommand = (
2020
) =>
2121
subcommand
2222
.setName("avatar")
23-
.setDescription(localizer("en-US", "commands.config.avatar.description"))
23+
.setDescription(
24+
localizer("en-US", "commands.serverconfig.avatar.description"),
25+
)
2426
.addAttachmentOption((option) =>
2527
option
2628
.setName("image")
2729
.setDescription(
28-
localizer("en-US", "commands.config.avatar.image_description"),
30+
localizer("en-US", "commands.serverconfig.avatar.image_description"),
2931
)
3032
.setRequired(false),
3133
);
@@ -183,14 +185,14 @@ export async function execute(
183185

184186
if (success) {
185187
await replyInfoEmbed(interaction, locale, {
186-
titleKey: "commands.config.avatar.removed_title",
187-
descriptionKey: "commands.config.avatar.removed_description",
188+
titleKey: "commands.serverconfig.avatar.removed_title",
189+
descriptionKey: "commands.serverconfig.avatar.removed_description",
188190
color: ColorCode.SUCCESS,
189191
});
190192
} else {
191193
await replyInfoEmbed(interaction, locale, {
192-
titleKey: "commands.config.avatar.api_error_title",
193-
descriptionKey: "commands.config.avatar.api_error_description",
194+
titleKey: "commands.serverconfig.avatar.api_error_title",
195+
descriptionKey: "commands.serverconfig.avatar.api_error_description",
194196
color: ColorCode.ERROR,
195197
});
196198
}
@@ -212,8 +214,8 @@ export async function execute(
212214
}
213215

214216
await replyInfoEmbed(interaction, locale, {
215-
titleKey: "commands.config.avatar.invalid_image_title",
216-
descriptionKey: `commands.config.avatar.${errorKey}`,
217+
titleKey: "commands.serverconfig.avatar.invalid_image_title",
218+
descriptionKey: `commands.serverconfig.avatar.${errorKey}`,
217219
color: ColorCode.ERROR,
218220
});
219221
return;
@@ -236,8 +238,9 @@ export async function execute(
236238
await log.error("Failed to convert image to base64", error, context);
237239

238240
await replyInfoEmbed(interaction, locale, {
239-
titleKey: "commands.config.avatar.conversion_error_title",
240-
descriptionKey: "commands.config.avatar.conversion_error_description",
241+
titleKey: "commands.serverconfig.avatar.conversion_error_title",
242+
descriptionKey:
243+
"commands.serverconfig.avatar.conversion_error_description",
241244
color: ColorCode.ERROR,
242245
});
243246
return;
@@ -251,14 +254,14 @@ export async function execute(
251254

252255
if (success) {
253256
await replyInfoEmbed(interaction, locale, {
254-
titleKey: "commands.config.avatar.success_title",
255-
descriptionKey: "commands.config.avatar.success_description",
257+
titleKey: "commands.serverconfig.avatar.success_title",
258+
descriptionKey: "commands.serverconfig.avatar.success_description",
256259
color: ColorCode.SUCCESS,
257260
});
258261
} else {
259262
await replyInfoEmbed(interaction, locale, {
260-
titleKey: "commands.config.avatar.api_error_title",
261-
descriptionKey: "commands.config.avatar.api_error_description",
263+
titleKey: "commands.serverconfig.avatar.api_error_title",
264+
descriptionKey: "commands.serverconfig.avatar.api_error_description",
262265
color: ColorCode.ERROR,
263266
});
264267
}

src/commands/serverconfig/blacklist.ts

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,37 @@ export const configureSubcommand = (
1818
) =>
1919
subcommand
2020
.setName("blacklist")
21-
.setDescription(localizer("en-US", "commands.config.blacklist.description"))
21+
.setDescription(
22+
localizer("en-US", "commands.serverconfig.blacklist.description"),
23+
)
2224
.addUserOption((option) =>
2325
option
2426
.setName("member")
2527
.setDescription(
26-
localizer("en-US", "commands.config.blacklist.member_description"),
28+
localizer(
29+
"en-US",
30+
"commands.serverconfig.blacklist.member_description",
31+
),
2732
)
2833
.setRequired(true),
2934
)
3035
.addStringOption((option) =>
3136
option
3237
.setName("action")
3338
.setDescription(
34-
localizer("en-US", "commands.config.blacklist.action_description"),
39+
localizer(
40+
"en-US",
41+
"commands.serverconfig.blacklist.action_description",
42+
),
3543
)
3644
.setRequired(true)
3745
.addChoices(
3846
{
39-
name: localizer("en-US", "commands.config.options.add"),
47+
name: localizer("en-US", "commands.choices.add"),
4048
value: "add",
4149
},
4250
{
43-
name: localizer("en-US", "commands.config.options.remove"),
51+
name: localizer("en-US", "commands.choices.remove"),
4452
value: "remove",
4553
},
4654
),
@@ -81,9 +89,9 @@ export async function execute(
8189
// 2a. Prevent blacklisting bots (including TomoriBot herself)
8290
if (targetDiscordUser.bot) {
8391
await replyInfoEmbed(interaction, locale, {
84-
titleKey: "commands.config.blacklist.cannot_blacklist_bot_title",
92+
titleKey: "commands.serverconfig.blacklist.cannot_blacklist_bot_title",
8593
descriptionKey:
86-
"commands.config.blacklist.cannot_blacklist_bot_description",
94+
"commands.serverconfig.blacklist.cannot_blacklist_bot_description",
8795
descriptionVars: {
8896
user_name: targetDiscordUser.username,
8997
},
@@ -106,9 +114,10 @@ export async function execute(
106114
// 5. Check if personalization is enabled at all
107115
if (!tomoriState.config.personal_memories_enabled) {
108116
await replyInfoEmbed(interaction, locale, {
109-
titleKey: "commands.config.blacklist.personalization_disabled_title",
117+
titleKey:
118+
"commands.serverconfig.blacklist.personalization_disabled_title",
110119
descriptionKey:
111-
"commands.config.blacklist.personalization_disabled_description",
120+
"commands.serverconfig.blacklist.personalization_disabled_description",
112121
color: ColorCode.WARN,
113122
});
114123
return;
@@ -135,9 +144,10 @@ export async function execute(
135144
`Failed to register target user ${targetDiscordUser.id} during blacklist command.`,
136145
);
137146
await replyInfoEmbed(interaction, locale, {
138-
titleKey: "commands.config.blacklist.user_registration_failed_title",
147+
titleKey:
148+
"commands.serverconfig.blacklist.user_registration_failed_title",
139149
descriptionKey:
140-
"commands.config.blacklist.user_registration_failed_description",
150+
"commands.serverconfig.blacklist.user_registration_failed_description",
141151
descriptionVars: {
142152
user_name: targetDiscordUser.username,
143153
},
@@ -167,9 +177,9 @@ export async function execute(
167177
// 7a. Prevent adding if already blacklisted
168178
if (action === "add" && isAlreadyBlacklisted) {
169179
await replyInfoEmbed(interaction, locale, {
170-
titleKey: "commands.config.blacklist.already_blacklisted_title",
180+
titleKey: "commands.serverconfig.blacklist.already_blacklisted_title",
171181
descriptionKey:
172-
"commands.config.blacklist.already_blacklisted_description",
182+
"commands.serverconfig.blacklist.already_blacklisted_description",
173183
descriptionVars: {
174184
user_name: targetDiscordUser.username,
175185
},
@@ -181,8 +191,9 @@ export async function execute(
181191
// 7b. Prevent removing if not blacklisted
182192
if (action === "remove" && !isAlreadyBlacklisted) {
183193
await replyInfoEmbed(interaction, locale, {
184-
titleKey: "commands.config.blacklist.not_blacklisted_title",
185-
descriptionKey: "commands.config.blacklist.not_blacklisted_description",
194+
titleKey: "commands.serverconfig.blacklist.not_blacklisted_title",
195+
descriptionKey:
196+
"commands.serverconfig.blacklist.not_blacklisted_description",
186197
descriptionVars: {
187198
user_name: targetDiscordUser.username,
188199
},
@@ -214,17 +225,17 @@ export async function execute(
214225
// 9. Send success confirmation message (Rule #12, #19)
215226
if (action === "add") {
216227
await replyInfoEmbed(interaction, locale, {
217-
titleKey: "commands.config.blacklist.added_title",
218-
descriptionKey: "commands.config.blacklist.added_description",
228+
titleKey: "commands.serverconfig.blacklist.added_title",
229+
descriptionKey: "commands.serverconfig.blacklist.added_description",
219230
descriptionVars: {
220231
user_name: targetDiscordUser.username,
221232
},
222233
color: ColorCode.SUCCESS,
223234
});
224235
} else {
225236
await replyInfoEmbed(interaction, locale, {
226-
titleKey: "commands.config.blacklist.removed_title",
227-
descriptionKey: "commands.config.blacklist.removed_description",
237+
titleKey: "commands.serverconfig.blacklist.removed_title",
238+
descriptionKey: "commands.serverconfig.blacklist.removed_description",
228239
descriptionVars: {
229240
user_name: targetDiscordUser.username,
230241
},

0 commit comments

Comments
 (0)