Skip to content

Commit 156234f

Browse files
[translate] Translate missing strings
1 parent f07ce54 commit 156234f

4 files changed

Lines changed: 23 additions & 19 deletions

File tree

src/main/java/de/chojo/repbot/commands/reputation/handler/Give.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import de.chojo.repbot.service.reputation.ReputationContext;
1515
import de.chojo.repbot.service.reputation.ReputationService;
1616
import de.chojo.repbot.service.reputation.SubmitResultType;
17+
import net.dv8tion.jda.api.entities.Member;
1718
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
1819
import net.dv8tion.jda.api.interactions.commands.OptionMapping;
1920

@@ -30,14 +31,17 @@ public Give(GuildRepository guilds, ReputationService reputationService) {
3031
public void onSlashCommand(SlashCommandInteractionEvent event, EventContext context) {
3132
RepGuild guild = guilds.guild(event.getGuild());
3233

34+
// The command should not be available in this case, but better check.
3335
if (!guild.settings().reputation().isCommandActive()) {
34-
event.reply("not active").setEphemeral(true).queue();
36+
event.reply("Command disabled").setEphemeral(true).queue();
3537
return;
3638
}
3739

38-
var result = reputationService.submitReputation(event.getGuild(), event.getMember(), event.getOption("user", OptionMapping::getAsMember), ReputationContext.fromInteraction(event), null, ThankType.COMMAND);
40+
Member donor = event.getMember();
41+
Member receiver = event.getOption("user", OptionMapping::getAsMember);
42+
var result = reputationService.submitReputation(event.getGuild(), donor, receiver, ReputationContext.fromInteraction(event), null, ThankType.COMMAND);
3943
if (result.type() == SubmitResultType.SUCCESS) {
40-
event.reply("success").setEphemeral(guild.settings().messages().isReactionConfirmation()).queue();
44+
event.reply(context.guildLocale("command.reputation.give.message.success", Replacement.create("DONOR", donor), Replacement.create("RECEIVER", receiver))).setEphemeral(guild.settings().messages().isReactionConfirmation()).queue();
4145
} else {
4246
event.reply(context.guildLocale(result.type().localeKey(), result.replacements().toArray(Replacement[]::new))).setEphemeral(true).queue();
4347
}

src/main/java/de/chojo/repbot/dao/access/guild/settings/sub/Messages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ON CONFLICT(guild_id)
8888
public String toLocalizedString() {
8989
var setting = List.of(
9090
getSetting("command.messages.states.message.option.reactionconfirmation.name", isReactionConfirmation()),
91-
getSetting("command.messages.states.message.option.commandreply.name", isCommandReputationEphemeral())
91+
getSetting("command.messages.states.message.option.commandreputationephemeral.name", isCommandReputationEphemeral())
9292
);
9393

9494
return String.join("\n", setting);

src/main/resources/locale.properties

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ command.abuseprotection.cooldown.direction.options.direction.description=
1414
command.abuseprotection.cooldown.get.description=
1515
command.abuseprotection.cooldown.get.message.disabled=
1616
command.abuseprotection.cooldown.get.message.get=
17+
command.abuseprotection.cooldown.once.description=
1718
command.abuseprotection.cooldown.once.message.set=
1819
command.abuseprotection.cooldown.set.description=
1920
command.abuseprotection.cooldown.set.message.set=
@@ -48,7 +49,6 @@ command.abuseprotection.message.min.options.messages.description=
4849
command.abuseprotection.message.reputation.description=
4950
command.abuseprotection.message.reputation.message.get=
5051
command.abuseprotection.message.reputation.options.amount.description=
51-
command.abuseprotection.cooldown.once.description=
5252
command.channel.add.description=
5353
command.channel.add.message.added=
5454
command.channel.add.options.channel.description=
@@ -240,19 +240,21 @@ command.repadmin.resetdate.current.description=
240240
command.repadmin.resetdate.current.message.notset=
241241
command.repadmin.resetdate.current.message.set=
242242
command.repadmin.resetdate.description=
243+
command.repadmin.resetdate.now.description=
244+
command.repadmin.resetdate.now.message.set=
243245
command.repadmin.resetdate.remove.description=
244246
command.repadmin.resetdate.remove.message.removed=
245247
command.repadmin.resetdate.set.description=
246248
command.repadmin.resetdate.set.message.set=
247249
command.repadmin.resetdate.set.options.day.description=
248250
command.repadmin.resetdate.set.options.month.description=
249251
command.repadmin.resetdate.set.options.year.description=
250-
command.repadmin.resetdate.now.description=
251-
command.repadmin.resetdate.now.message.set=
252252
command.repsettings.description=
253253
command.repsettings.info.description=
254254
command.repsettings.info.message.answer.false=
255255
command.repsettings.info.message.answer.true=
256+
command.repsettings.info.message.bycommand.false=
257+
command.repsettings.info.message.bycommand.true=
256258
command.repsettings.info.message.choose=
257259
command.repsettings.info.message.embed.false=
258260
command.repsettings.info.message.embed.true=
@@ -262,6 +264,8 @@ command.repsettings.info.message.mention.false=
262264
command.repsettings.info.message.mention.true=
263265
command.repsettings.info.message.option.byanswer.description=
264266
command.repsettings.info.message.option.byanswer.name=
267+
command.repsettings.info.message.option.bycommand.description=
268+
command.repsettings.info.message.option.bycommand.name=
265269
command.repsettings.info.message.option.byembed.description=
266270
command.repsettings.info.message.option.byembed.name=
267271
command.repsettings.info.message.option.byfuzzy.description=
@@ -292,6 +296,9 @@ command.repsettings.name.reset.message.reset=
292296
command.repsettings.name.set.description=
293297
command.repsettings.name.set.message.set=
294298
command.repsettings.name.set.options.name.description=
299+
command.reputation.description=
300+
command.reputation.give.message.success=
301+
command.reputation.options.user.description=
295302
command.roles.add.description=
296303
command.roles.add.message.added=
297304
command.roles.add.options.reputation.description=
@@ -428,6 +435,7 @@ error.notYourEmbed=
428435
error.onlyTextChannel=
429436
error.onlyTextOrCategory=
430437
error.premium=
438+
error.publicRole=
431439
error.roleAccess=
432440
error.userNotFound=
433441
listener.messages.request.descr=
@@ -488,6 +496,7 @@ submitresult.outdatedreferencemessage=
488496
submitresult.receiverlimit=
489497
submitresult.selfvote=
490498
submitresult.submitting=
499+
submitresult.success=
491500
submitresult.targetnotincontext=
492501
submitresult.thanktypedisabled=
493502
suppertererror.timeleft=
@@ -498,6 +507,7 @@ supportererror.channellimitexceeded.message=
498507
supportererror.considersupporting=
499508
supportererror.nicknamed.message=
500509
thankType.answer.name=
510+
thankType.command.name=
501511
thankType.direct.name=
502512
thankType.embed.name=
503513
thankType.fuzzy.name=
@@ -515,6 +525,7 @@ words.categories=
515525
words.channel=
516526
words.channels=
517527
words.code=
528+
words.direction=
518529
words.disabled=
519530
words.donated=
520531
words.donor=
@@ -535,15 +546,3 @@ words.reputationOffset=
535546
words.role=
536547
words.subscription=
537548
words.unknown=
538-
words.direction=
539-
error.publicRole=
540-
command.repsettings.info.message.option.bycommand.description=
541-
command.repsettings.info.message.bycommand.true=
542-
command.repsettings.info.message.bycommand.false=
543-
command.reputation.description=
544-
command.reputation.options.user.description=
545-
command.repsettings.info.message.option.bycommand.name=
546-
thankType.command.name=
547-
submitresult.success=
548-
549-

src/main/resources/locale_de.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,3 +549,4 @@ words.reputationOffset=Reputationsversatz
549549
words.role=Rolle
550550
words.subscription=Abonnement
551551
words.unknown=Unbekannt
552+
command.reputation.give.message.success=%DONOR% gave $words.reputation$ to %RECEIVER%.

0 commit comments

Comments
 (0)