Skip to content

Commit f077a5c

Browse files
committed
chore(translation): improve structure of translation keys
1 parent 8177286 commit f077a5c

3 files changed

Lines changed: 13 additions & 19 deletions

File tree

commands/library.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module.exports = {
2727
.setDescription(`${languages["en"].COMMAND_LIBRARY_ADD_OPTION_TYPE}`)
2828
.setDescriptionLocalizations({ "fr": `${languages["fr"].COMMAND_LIBRARY_ADD_OPTION_TYPE}` })
2929
.setChoices(
30-
{ name: `${languages["en"].COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_SONG}`, name_localizations: { "fr": `${languages["fr"].COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_SONG}` }, value: "video" },
31-
{ name: `${languages["en"].COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_PLAYLIST}`, name_localizations: { "fr": `${languages["fr"].COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_PLAYLIST}` }, value: "playlist" }
30+
{ name: `${languages["en"].ITEM_SONG} (${languages["en"].OPTION_DEFAULT})`, name_localizations: { "fr": `${languages["fr"].ITEM_SONG} (${languages["fr"].OPTION_DEFAULT})` }, value: "video" },
31+
{ name: `${languages["en"].ITEM_PLAYLIST}`, name_localizations: { "fr": `${languages["fr"].ITEM_PLAYLIST}` }, value: "playlist" }
3232
)
3333
.setRequired(false)
3434
)
@@ -142,7 +142,7 @@ module.exports = {
142142
updateResponse: async (interaction, lang, items, selectedItem) => {
143143
// Update library embed, menu and buttons
144144
const options = items.map((item, i) => { return { label: `${i + 1}. ${item.name.length > config.ITEM_NAME_MAX_LENGTH_DISPLAY ? item.name.substr(0, config.ITEM_NAME_MAX_LENGTH_DISPLAY).concat("...") : item.name}`, description: `${item.author || "-"}`, emoji: item.isPlaylist ? elements.EMOJI_PLAYLIST : elements.EMOJI_SONG, value: `${i}`, default: item === selectedItem } });
145-
const libraryEmbed = new EmbedBuilder().setAuthor({ name: `${lang.MESSAGE_LIBRARY_TITLE} (${items.length}/${config.LIBRARY_MAX_LENGTH})`, iconURL: interaction.user.displayAvatarURL({ forceStatic: true }) }).addFields({ name: `**${lang.MESSAGE_ITEM_TITLE}**`, value: `[${selectedItem.name}](${selectedItem.url})` }, { name: `**${lang.MESSAGE_ITEM_AUTHOR}**`, value: `${selectedItem.author || "-"}`, inline: true }, { name: `**${lang.MESSAGE_ITEM_TYPE}**`, value: `${selectedItem.isPlaylist ? lang.MESSAGE_ITEM_TYPE_PLAYLIST : lang.MESSAGE_ITEM_TYPE_SONG}`, inline: true }).setThumbnail(selectedItem.thumbnail).setColor(elements.COLOR_FLOPY);
145+
const libraryEmbed = new EmbedBuilder().setAuthor({ name: `${lang.MESSAGE_LIBRARY_TITLE} (${items.length}/${config.LIBRARY_MAX_LENGTH})`, iconURL: interaction.user.displayAvatarURL({ forceStatic: true }) }).addFields({ name: `**${lang.MESSAGE_ITEM_TITLE}**`, value: `[${selectedItem.name}](${selectedItem.url})` }, { name: `**${lang.MESSAGE_ITEM_AUTHOR}**`, value: `${selectedItem.author || "-"}`, inline: true }, { name: `**${lang.MESSAGE_ITEM_TYPE}**`, value: `${selectedItem.isPlaylist ? lang.ITEM_PLAYLIST : lang.ITEM_SONG}`, inline: true }).setThumbnail(selectedItem.thumbnail).setColor(elements.COLOR_FLOPY);
146146
const libraryMenu = new ActionRowBuilder().addComponents(new StringSelectMenuBuilder().setCustomId("select").setOptions(options));
147147
const libraryButtons = new ActionRowBuilder().addComponents(new ButtonBuilder().setCustomId("play").setStyle(ButtonStyle.Primary).setLabel(`${lang.BUTTON_PLAY}`), new ButtonBuilder().setCustomId("remove").setStyle(ButtonStyle.Danger).setLabel(`${lang.BUTTON_LIBRARY_REMOVE}`));
148148
await interaction.editReply({ embeds: [libraryEmbed], components: [libraryMenu, libraryButtons] });

commands/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ module.exports = {
2323
.setDescription(`${languages["en"].COMMAND_SEARCH_OPTION_TYPE}`)
2424
.setDescriptionLocalizations({ "fr": `${languages["fr"].COMMAND_SEARCH_OPTION_TYPE}` })
2525
.setChoices(
26-
{ name: `${languages["en"].COMMAND_SEARCH_OPTION_TYPE_CHOICE_SONG}`, name_localizations: { "fr": `${languages["fr"].COMMAND_SEARCH_OPTION_TYPE_CHOICE_SONG}` }, value: "video" },
27-
{ name: `${languages["en"].COMMAND_SEARCH_OPTION_TYPE_CHOICE_PLAYLIST}`, name_localizations: { "fr": `${languages["fr"].COMMAND_SEARCH_OPTION_TYPE_CHOICE_PLAYLIST}` }, value: "playlist" }
26+
{ name: `${languages["en"].ITEM_SONG} (${languages["en"].OPTION_DEFAULT})`, name_localizations: { "fr": `${languages["fr"].ITEM_SONG} (${languages["fr"].OPTION_DEFAULT})` }, value: "video" },
27+
{ name: `${languages["en"].ITEM_PLAYLIST}`, name_localizations: { "fr": `${languages["fr"].ITEM_PLAYLIST}` }, value: "playlist" }
2828
)
2929
.setRequired(false)
3030
),

utils/languages.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ module.exports = {
2424
COMMAND_LIBRARY_VIEW_DESCRIPTION: "Display your library and interact with items.",
2525
COMMAND_LIBRARY_ADD_DESCRIPTION: "Add the currently playing item to your library.",
2626
COMMAND_LIBRARY_ADD_OPTION_TYPE: "The item type to be added to your library.",
27-
COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_SONG: "Song (default)",
28-
COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_PLAYLIST: "Playlist",
2927
COMMAND_REMOVE_DESCRIPTION: "Manage the queue.",
3028
COMMAND_REMOVE_SONG_DESCRIPTION: "Remove a specific song from the queue.",
3129
COMMAND_REMOVE_SONG_OPTION_POSITION: "The song's position in the queue.",
@@ -34,8 +32,6 @@ module.exports = {
3432
COMMAND_SEARCH_DESCRIPTION: "Search and interact with results.",
3533
COMMAND_SEARCH_OPTION_QUERY: "The song, the artist, the lyrics, and more.",
3634
COMMAND_SEARCH_OPTION_TYPE: "The search result type.",
37-
COMMAND_SEARCH_OPTION_TYPE_CHOICE_SONG: "Song (default)",
38-
COMMAND_SEARCH_OPTION_TYPE_CHOICE_PLAYLIST: "Playlist",
3935
COMMAND_SEEK_DESCRIPTION: "Seek a specific time in the current song.",
4036
COMMAND_SEEK_OPTION_TIME: "The time in the song (hours, minutes, seconds).",
4137
COMMAND_SETUP_DESCRIPTION: "Setup the dashboard in this channel.",
@@ -60,8 +56,6 @@ module.exports = {
6056
MESSAGE_ITEM_LENGTH: "Length",
6157
MESSAGE_ITEM_LENGTH_SONGS: "song(s)",
6258
MESSAGE_ITEM_TYPE: "Type",
63-
MESSAGE_ITEM_TYPE_SONG: "Song",
64-
MESSAGE_ITEM_TYPE_PLAYLIST: "Playlist",
6559
MESSAGE_AUTOPLAY_ENABLED: "Autoplay enabled",
6660
MESSAGE_AUTOPLAY_DISABLED: "Autoplay disabled",
6761
MESSAGE_FILTERS_ACTIVE: "Active filters:",
@@ -109,7 +103,10 @@ module.exports = {
109103
HELP_SETUP_DASHBOARD: "Use $command command in a channel to setup the dashboard.",
110104
BUTTON_PLAY: "Play",
111105
BUTTON_LIBRARY_ADD: "Add to your library",
112-
BUTTON_LIBRARY_REMOVE: "Remove from your library"
106+
BUTTON_LIBRARY_REMOVE: "Remove from your library",
107+
ITEM_SONG: "Song",
108+
ITEM_PLAYLIST: "Playlist",
109+
OPTION_DEFAULT: "Default"
113110
},
114111
"fr": {
115112
DASHBOARD_SONG_NO_PLAYING: "Aucune musique en cours de lecture",
@@ -136,8 +133,6 @@ module.exports = {
136133
COMMAND_LIBRARY_VIEW_DESCRIPTION: "Afficher votre bibliothèque et intéragir avec les éléments.",
137134
COMMAND_LIBRARY_ADD_DESCRIPTION: "Ajouter l'élément en cours de lecture à votre bibliothèque.",
138135
COMMAND_LIBRARY_ADD_OPTION_TYPE: "Le type d'élément à ajouter votre bibliothèque.",
139-
COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_SONG: "Musique (par défaut)",
140-
COMMAND_LIBRARY_ADD_OPTION_TYPE_CHOICE_PLAYLIST: "Playlist",
141136
COMMAND_REMOVE_DESCRIPTION: "Gérer la file d'attente.",
142137
COMMAND_REMOVE_SONG_DESCRIPTION: "Retirer une musique spécifique de la file d'attente.",
143138
COMMAND_REMOVE_SONG_OPTION_POSITION: "La position de la musique dans la file d'attente.",
@@ -146,8 +141,6 @@ module.exports = {
146141
COMMAND_SEARCH_DESCRIPTION: "Rechercher et intéragir avec les résultats.",
147142
COMMAND_SEARCH_OPTION_QUERY: "La musique, l'artiste, les paroles, etc.",
148143
COMMAND_SEARCH_OPTION_TYPE: "Le type de résultat de recherche.",
149-
COMMAND_SEARCH_OPTION_TYPE_CHOICE_SONG: "Musique (par défaut)",
150-
COMMAND_SEARCH_OPTION_TYPE_CHOICE_PLAYLIST: "Playlist",
151144
COMMAND_SEEK_DESCRIPTION: "Aller à un moment spécifique dans la musique en cours de lecture.",
152145
COMMAND_SEEK_OPTION_TIME: "Le moment dans la musique (heures, minutes, secondes).",
153146
COMMAND_SETUP_DESCRIPTION: "Installer le tableau de bord dans ce salon.",
@@ -172,8 +165,6 @@ module.exports = {
172165
MESSAGE_ITEM_LENGTH: "Longueur",
173166
MESSAGE_ITEM_LENGTH_SONGS: "musique(s)",
174167
MESSAGE_ITEM_TYPE: "Type",
175-
MESSAGE_ITEM_TYPE_SONG: "Musique",
176-
MESSAGE_ITEM_TYPE_PLAYLIST: "Playlist",
177168
MESSAGE_AUTOPLAY_ENABLED: "Lecture automatique activée",
178169
MESSAGE_AUTOPLAY_DISABLED: "Lecture automatique désactivée",
179170
MESSAGE_FILTERS_ACTIVE: "Filtres actifs :",
@@ -221,6 +212,9 @@ module.exports = {
221212
HELP_SETUP_DASHBOARD: "Utilisez la commande $command dans un salon pour installer le tableau de bord.",
222213
BUTTON_PLAY: "Jouer",
223214
BUTTON_LIBRARY_ADD: "Ajouter à votre bibliothèque",
224-
BUTTON_LIBRARY_REMOVE: "Supprimer de votre bibliothèque"
215+
BUTTON_LIBRARY_REMOVE: "Supprimer de votre bibliothèque",
216+
ITEM_SONG: "Musique",
217+
ITEM_PLAYLIST: "Playlist",
218+
OPTION_DEFAULT: "Par défaut"
225219
}
226220
}

0 commit comments

Comments
 (0)