mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
Changed last few usages of old string based gettext. All strings now use new system. Needs testing
This commit is contained in:
@@ -74,7 +74,7 @@ namespace NadekoBot.Modules.Help.Services
|
||||
var reqs = GetCommandRequirements(com, overrides);
|
||||
if(reqs.Any())
|
||||
{
|
||||
em.AddField(GetText("requires", guild), string.Join("\n", reqs));
|
||||
em.AddField(GetText(strs.requires, guild), string.Join("\n", reqs));
|
||||
}
|
||||
|
||||
em
|
||||
@@ -82,7 +82,7 @@ namespace NadekoBot.Modules.Help.Services
|
||||
string.Join("\n", Array.ConvertAll(com.RealRemarksArr(_strings, guild?.Id, prefix),
|
||||
arg => Format.Code(arg))),
|
||||
false)
|
||||
.WithFooter(GetText("module", guild, com.Module.GetTopLevelModule().Name))
|
||||
.WithFooter(GetText(strs.module(com.Module.GetTopLevelModule().Name), guild))
|
||||
.WithOkColor();
|
||||
|
||||
var opt = ((NadekoOptionsAttribute)com.Attributes.FirstOrDefault(x => x is NadekoOptionsAttribute))?.OptionType;
|
||||
@@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Help.Services
|
||||
{
|
||||
var hs = GetCommandOptionHelp(opt);
|
||||
if(!string.IsNullOrWhiteSpace(hs))
|
||||
em.AddField(GetText("options", guild), hs, false);
|
||||
em.AddField(GetText(strs.options, guild), hs, false);
|
||||
}
|
||||
|
||||
return em;
|
||||
@@ -172,7 +172,7 @@ namespace NadekoBot.Modules.Help.Services
|
||||
.Replace("Guild", "Server", StringComparison.InvariantCulture);
|
||||
}
|
||||
|
||||
private string GetText(string text, IGuild guild, params object[] replacements) =>
|
||||
_strings.GetText(text, guild?.Id, replacements);
|
||||
private string GetText(LocStr str, IGuild guild, params object[] replacements) =>
|
||||
_strings.GetText(str, guild?.Id);
|
||||
}
|
||||
}
|
||||
|
@@ -305,9 +305,6 @@ namespace NadekoBot.Modules.Music.Services
|
||||
|
||||
return Array.Empty<(string, string)>();
|
||||
}
|
||||
|
||||
private string GetText(ulong guildId, string key, params object[] args)
|
||||
=> _strings.GetText(key, guildId, args);
|
||||
|
||||
private string GetText(ulong guildId, LocStr str)
|
||||
=> _strings.GetText(str, guildId);
|
||||
|
@@ -447,8 +447,8 @@ namespace NadekoBot.Modules.Searches.Services
|
||||
.WithTitle(status.Name)
|
||||
.WithUrl(status.StreamUrl)
|
||||
.WithDescription(status.StreamUrl)
|
||||
.AddField(GetText(guildId, "status"), status.IsLive ? "🟢 Online" : "🔴 Offline", true)
|
||||
.AddField(GetText(guildId, "viewers"), status.IsLive ? status.Viewers.ToString() : "-", true);
|
||||
.AddField(GetText(guildId, strs.status), status.IsLive ? "🟢 Online" : "🔴 Offline", true)
|
||||
.AddField(GetText(guildId, strs.viewers), status.IsLive ? status.Viewers.ToString() : "-", true);
|
||||
|
||||
if (status.IsLive)
|
||||
embed = embed.WithOkColor();
|
||||
@@ -459,7 +459,7 @@ namespace NadekoBot.Modules.Searches.Services
|
||||
embed.WithAuthor(status.Title);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(status.Game))
|
||||
embed.AddField(GetText(guildId, "streaming"), status.Game, true);
|
||||
embed.AddField(GetText(guildId, strs.streaming), status.Game, true);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(status.AvatarUrl))
|
||||
embed.WithThumbnailUrl(status.AvatarUrl);
|
||||
@@ -470,8 +470,8 @@ namespace NadekoBot.Modules.Searches.Services
|
||||
return embed;
|
||||
}
|
||||
|
||||
private string GetText(ulong guildId, string key, params object[] replacements)
|
||||
=> _strings.GetText(key, guildId, replacements);
|
||||
private string GetText(ulong guildId, LocStr str)
|
||||
=> _strings.GetText(str, guildId);
|
||||
|
||||
public bool ToggleStreamOffline(ulong guildId)
|
||||
{
|
||||
|
@@ -258,7 +258,10 @@ namespace NadekoBot.Modules.Utility
|
||||
.AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true)
|
||||
.AddField(GetText(strs.presence),
|
||||
GetText(strs.presence_txt(
|
||||
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels)), true))
|
||||
_coord.GetGuildCount(),
|
||||
_stats.TextChannels,
|
||||
_stats.VoiceChannels)),
|
||||
true))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user