mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Localization use placeholder instead
This commit is contained in:
+6
-7
@@ -16,11 +16,10 @@ const EMBEDS = {
|
||||
|
||||
let _e = makeInfoEmbed({
|
||||
icon: '💌',
|
||||
title: locale.__('help.title', bot.username),
|
||||
title: locale.__('help.title', { BOT_NAME: bot.username }),
|
||||
description: `\u200b\n🏷️ **${locale.__('help.prefix_title')}**\n${locale.__(
|
||||
'help.prefix_description',
|
||||
prefix.replaceAll('`', '`'),
|
||||
`<@${bot.id}>`
|
||||
{PREFIX: prefix.replaceAll('`', '`'), PREFIX_MENTION: `<@${bot.id}>`}
|
||||
)}\n\n💻 **${locale.__('help.available_commands')}**`,
|
||||
fields: [
|
||||
{
|
||||
@@ -29,13 +28,13 @@ const EMBEDS = {
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `🎵 ${locale.__('help.music')}`,
|
||||
value: `play (p), search, skip, pause, resume, queue (q), nowplaying (np), loop, join, leave (disconnect, dc)`,
|
||||
name: `🎮 ${locale.__('help.games')}`,
|
||||
value: `osu`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `🎮 ${locale.__('help.games')}`,
|
||||
value: `osu`,
|
||||
name: `🎵 ${locale.__('help.music')}`,
|
||||
value: `play (p), search, skip, pause, resume, queue (q), nowplaying (np), loop, join, leave (disconnect, dc)`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -14,11 +14,11 @@ const EMBEDS = {
|
||||
const user = data.getUser();
|
||||
let message;
|
||||
if (!Environment.get().PRIVATE_BOT || user != null && Users.isDeveloper(user.id))
|
||||
message = locale.__('invite.info', DiscordProvider.client.user!.username, `https://discord.com/api/oauth2/authorize?client_id=${DiscordProvider.client.user?.id}&permissions=0&scope=bot%20applications.commands`);
|
||||
message = locale.__('invite.info', { BOT_NAME: DiscordProvider.client.user!.username, LINK: `https://discord.com/api/oauth2/authorize?client_id=${DiscordProvider.client.user?.id}&permissions=0&scope=bot%20applications.commands`});
|
||||
|
||||
return makeInfoEmbed({
|
||||
title: `Invite`,
|
||||
description: message || locale.__('invite.private', DiscordProvider.client.user!.username),
|
||||
description: message || locale.__('invite.private', { BOT_NAME: DiscordProvider.client.user!.username}),
|
||||
user
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ const EMBEDS = {
|
||||
},
|
||||
LOOP_STATUS: (data: HybridInteractionMessage, locale: I18n, loopMode: DiscordMusicPlayerLoopMode) => {
|
||||
let embed = makeInfoEmbed({
|
||||
title: locale.__('musicplayer_loop.info', loopMode),
|
||||
title: locale.__('musicplayer_loop.info', {
|
||||
MODE: loopMode
|
||||
}),
|
||||
description: locale.__('musicplayer_loop.valid_args'),
|
||||
user: data.getUser()
|
||||
});
|
||||
@@ -23,7 +25,9 @@ const EMBEDS = {
|
||||
},
|
||||
LOOP_SET: (data: HybridInteractionMessage, locale: I18n, loopMode: DiscordMusicPlayerLoopMode) => {
|
||||
let embed = makeSuccessEmbed({
|
||||
title: locale.__('musicplayer_loop.loop_set', loopMode),
|
||||
title: locale.__('musicplayer_loop.loop_set', {
|
||||
MODE: loopMode
|
||||
}),
|
||||
user: data.getUser()
|
||||
});
|
||||
return embed;
|
||||
|
||||
@@ -56,7 +56,9 @@ const EMBEDS = {
|
||||
ADDED_SONGS_QUEUE: (data: HybridInteractionMessage, locale: I18n, track: ValidTracks[]) => {
|
||||
let embed = makeSuccessEmbed({
|
||||
title: locale.__('musicplayer_play.queue_added_songs'),
|
||||
description: locale.__('musicplayer_play.queue_added_songs_description', track.length.toString()),
|
||||
description: locale.__('musicplayer_play.queue_added_songs_description', {
|
||||
COUNT: track.length.toString()
|
||||
}),
|
||||
user: data.getUser()
|
||||
});
|
||||
return embed;
|
||||
|
||||
@@ -45,7 +45,7 @@ const EMBEDS = {
|
||||
title: locale.__('musicplayer_queue.title'),
|
||||
description: `${locale.__('musicplayer_queue.now_playing')}${nowPlayingText}
|
||||
${locale.__('musicplayer_queue.upcoming_song')} ${upcomingText}\n
|
||||
${locale.__('musicplayer_queue.song_x_in_queue', queue.track.length.toString())}
|
||||
${locale.__('musicplayer_queue.song_x_in_queue', { COUNT: queue.track.length.toString()})}
|
||||
${queueString}\n${queue.track.length > 10 ? `...${queue.track.length - 10} more songs` : ''}`,
|
||||
user: data.getUser()
|
||||
});
|
||||
@@ -58,7 +58,7 @@ const EMBEDS = {
|
||||
title: locale.__('musicplayer_queue.title'),
|
||||
description: `${locale.__('musicplayer_queue.now_playing')}${nowPlayingText}
|
||||
${locale.__('musicplayer_queue.upcoming_song')} ${upcomingText}\n
|
||||
${locale.__('musicplayer_queue.song_x_in_queue', queue.track.length.toString())}
|
||||
${locale.__('musicplayer_queue.song_x_in_queue', { COUNT: queue.track.length.toString()})}
|
||||
${queueString}`,
|
||||
user: data.getUser()
|
||||
});
|
||||
|
||||
@@ -26,7 +26,9 @@ const EMBEDS = {
|
||||
SEARCH_RESULT: (data: HybridInteractionMessage, locale: I18n, result: ValidTracks[]) => {
|
||||
return makeInfoEmbed({
|
||||
title: locale.__('musicplayer_search.title_result'),
|
||||
description: `${locale.__('musicplayer_search.x_results_found', result.length.toString())}\n\n${result.map(track => `- [${track.title}](${track.url})`).join('\n')}`,
|
||||
description: `${locale.__('musicplayer_search.x_results_found', {
|
||||
COUNT: result.length.toString()
|
||||
})}\n\n${result.map(track => `- [${track.title}](${track.url})`).join('\n')}`,
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
|
||||
+3
-2
@@ -28,8 +28,9 @@ const EMBEDS = {
|
||||
return makeErrorEmbed({
|
||||
title: locale.__('common.no_permissions'),
|
||||
description: locale.__(
|
||||
'common.no_permissions_description',
|
||||
'VIEW_CHANNEL, SEND_MESSAGES and MANAGE_CHANNELS'
|
||||
'common.no_permissions_description', {
|
||||
PERMISSIONS: 'VIEW_CHANNEL, SEND_MESSAGES, MANAGE_CHANNELS'
|
||||
}
|
||||
),
|
||||
user: data.getUser()
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ import { COMMON_EMBEDS } from '.';
|
||||
const EMBEDS = {
|
||||
PREFIX_INFO: (data: HybridInteractionMessage, locale: I18n, currentPrefix: string) => {
|
||||
return makeInfoEmbed({
|
||||
title: locale.__('settings_prefix.info', currentPrefix),
|
||||
title: locale.__('settings_prefix.info', { PREFIX: currentPrefix}),
|
||||
description: locale.__('settings_prefix.info_description'),
|
||||
user: data.getUser()
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ export const COMMON_EMBEDS = {
|
||||
NO_PERMISSION: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
return makeErrorEmbed({
|
||||
title: locale.__('common.no_permissions'),
|
||||
description: locale.__('common.no_permissions_description','ADMINISTRATOR'),
|
||||
description: locale.__('common.no_permissions_description', { PERMISSIONS: 'ADMINISTRATOR'}),
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
@@ -47,7 +47,10 @@ const EMBEDS = {
|
||||
SETTINGS_INFO: (data: HybridInteractionMessage, locale: I18n, guild: Guild) => {
|
||||
return makeInfoEmbed({
|
||||
title: locale.__('settings.title'),
|
||||
description: locale.__('settings.description', DiscordProvider.client.user!.username, guild.name),
|
||||
description: locale.__('settings.description', {
|
||||
BOT_NAME: DiscordProvider.client.user!.username,
|
||||
GUILD_NAME: guild.name
|
||||
}),
|
||||
fields: [
|
||||
{
|
||||
name: locale.__('common.available_args'),
|
||||
|
||||
@@ -22,17 +22,15 @@ const EMBEDS = {
|
||||
fields: [
|
||||
{
|
||||
name: `🌐 ${locale.__('stats.users')}`,
|
||||
value: `${locale.__('stats.x_servers', totalServers.toString())}\n${locale.__(
|
||||
'stats.x_users',
|
||||
totalUsers.toString()
|
||||
value: `${locale.__('stats.x_servers', { COUNT: totalServers.toString() })}\n${locale.__(
|
||||
'stats.x_users', { COUNT: totalUsers.toString()}
|
||||
)}`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `🟢 ${locale.__('stats.uptime_since')}`,
|
||||
value: `${locale.__('stats.server_uptime_x', `<t:${systemUptime.toString()}:R>`)}\n${locale.__(
|
||||
'stats.process_uptime_x',
|
||||
`<t:${processUptime.toString()}:R>`
|
||||
value: `${locale.__('stats.server_uptime_x', {TIME: `<t:${systemUptime.toString()}:R>`})}\n${locale.__(
|
||||
'stats.process_uptime_x', { TIME: `<t:${processUptime.toString()}:R>`}
|
||||
)}`,
|
||||
inline: true
|
||||
}
|
||||
|
||||
@@ -94,19 +94,19 @@ const EMBEDS = {
|
||||
let title = '';
|
||||
switch (activity.type) {
|
||||
case 'PLAYING':
|
||||
title = `'🕹 ${locale.__('userinfo.playing_x', activity.name)}`;
|
||||
title = `'🕹 ${locale.__('userinfo.playing_x', {NAME: activity.name})}`;
|
||||
break;
|
||||
case 'STREAMING':
|
||||
title = `'🔴 ${locale.__('userinfo.streaming_x', activity.name)}`;
|
||||
title = `'🔴 ${locale.__('userinfo.streaming_x', {NAME: activity.name})}`;
|
||||
break;
|
||||
case 'LISTENING':
|
||||
title = `🎵 ${locale.__('userinfo.listening_x', activity.name)}`;
|
||||
title = `🎵 ${locale.__('userinfo.listening_x', {NAME: activity.name})}`;
|
||||
break;
|
||||
case 'WATCHING':
|
||||
title = `📺 ${locale.__('userinfo.watching_x', activity.name)}`;
|
||||
title = `📺 ${locale.__('userinfo.watching_x', {NAME: activity.name})}`;
|
||||
break;
|
||||
case 'COMPETING':
|
||||
title = `'🌠 ${locale.__('userinfo.competing_x', activity.name)}`;
|
||||
title = `'🌠 ${locale.__('userinfo.competing_x', {NAME: activity.name})}`;
|
||||
break;
|
||||
}
|
||||
embed.addField(
|
||||
@@ -126,7 +126,7 @@ const EMBEDS = {
|
||||
`${
|
||||
user.joinedAt === null
|
||||
? locale.__('userinfo.join_date_unknown')
|
||||
: locale.__('userinfo.join_date', `<t:${Math.round(user.joinedAt.getTime() / 1000)}:R>`)
|
||||
: locale.__('userinfo.join_date', {TIME: `<t:${Math.round(user.joinedAt.getTime() / 1000).toString()}:R>`})
|
||||
}
|
||||
${user.isGuildOwner ? `${locale.__('userinfo.guild_owner')}` : ''}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user