Skip to content

Commit

Permalink
chore(i18n): add phrases for /deleteActivityRole
Browse files Browse the repository at this point in the history
  • Loading branch information
tippfehlr committed Apr 24, 2024
1 parent ae18ab7 commit c88ab4b
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 24 deletions.
5 changes: 5 additions & 0 deletions locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-vérifie tous les utilisateurs/rôles",
"success": "vérifié {{{usersChecked}}} utilisateurs, ajouté {{{added}}} et retiré {{{removed}}} rôles",
"in-progress": "EN COURS : a déjà vérifié {{{usersChecked}}}/{{{totalUsersToCheck}}} utilisateurs, a ajouté {{{added}}} et a supprimé {{{removed}}} rôles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
5 changes: 5 additions & 0 deletions locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,10 @@
"description": "re-check all users/roles",
"success": "checked {{{usersChecked}}} users, added {{{added}}} and removed {{{removed}}} roles",
"in-progress": "IN PROGRESS: already checked {{{usersChecked}}}/{{{totalUsersToCheck}}} users, added {{{added}}} and removed {{{removed}}} roles."
},
"Cancelled": "Cancelled",
"deleteActivityRole": {
"noRoleDeleted": "No activity roles were deleted.",
"deletedRoles": "Deleted Activity Roles:"
}
}
59 changes: 35 additions & 24 deletions src/modules/commands/deleteActivityRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ export default {
db.deleteFrom('activityRoles').where('guildID', '=', interaction.guildId).execute();
break;
case 'deleteactivityrole:cancel':
int.update({ content: __({ phrase: 'Cancelled', locale }), components: [] });
int.update({
content: __({ phrase: 'Cancelled', locale }),
components: [],
});
break;
}
});
Expand Down Expand Up @@ -183,8 +186,23 @@ function process(
deleted: Selectable<ActivityRoles>[],
locale: string,
) {
const reply = (content: string, embeds?: EmbedBuilder[]) => {
if (interaction instanceof CommandInteraction)
interaction.reply({
content,
embeds,
ephemeral: true,
});
else
interaction.update({
content,
embeds,
components: [],
});
};

if (deleted.length > 0) {
const embeds = [
const embeds: EmbedBuilder[] = [
// new EmbedBuilder().setTitle('Deleted Activity Roles:').setColor(config.COLOR)
];
embeds.push(
Expand Down Expand Up @@ -219,33 +237,26 @@ function process(
.setColor(config.COLOR);
}),
);
if (interaction instanceof CommandInteraction)
interaction.reply({
content: __({ phrase: 'Deleted Activity Roles:', locale }),
embeds: embeds,
ephemeral: true,
});
else
interaction.update({
content: __({ phrase: 'Deleted Activity Roles:', locale }),
embeds: embeds,
components: [],
});

reply(
__({
phrase: 'deleteActivityRole->deletedRoles:Deleted Activity Roles:',
locale,
}),
embeds,
);

deleted.forEach(activityRole => {
log.info(
`Activity role removed: in guild ${interaction.guild?.name} (${interaction.guildId}) role: ${activityRole.roleID} activityName: ${activityRole.activityName}, exactActivityName: ${activityRole.exactActivityName}, permanent: ${activityRole.permanent}`,
);
});
} else {
if (interaction instanceof CommandInteraction)
interaction.reply({
content: __({ phrase: 'No activity roles were deleted.', locale }),
ephemeral: true,
});
else
interaction.update({
content: __({ phrase: 'No activity roles were deleted.', locale }),
components: [],
});
reply(
__({
phrase: 'deleteActivityRole->noRoleDeleted:No activity roles were deleted.',
locale,
}),
);
}
}

0 comments on commit c88ab4b

Please sign in to comment.