Add translations for !corona
This commit is contained in:
parent
644d877e29
commit
eddd005d34
5 changed files with 207 additions and 11 deletions
|
@ -84,6 +84,10 @@
|
|||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Stats.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Localization\Corona.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Corona.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Localization\Ship.Designer.cs">
|
||||
|
@ -144,5 +148,10 @@
|
|||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Stats.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Localization\Corona.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Corona.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -9,17 +9,16 @@ using Geekbot.Core;
|
|||
using Geekbot.Core.Converters;
|
||||
using Geekbot.Core.ErrorHandling;
|
||||
using Geekbot.Core.Extensions;
|
||||
using Geekbot.Core.GuildSettingsManager;
|
||||
|
||||
namespace Geekbot.Bot.Commands.Utils.Corona
|
||||
{
|
||||
public class CoronaStats : ModuleBase
|
||||
public class CoronaStats : GeekbotCommandBase
|
||||
{
|
||||
private readonly IErrorHandler _errorHandler;
|
||||
private readonly IEmojiConverter _emojiConverter;
|
||||
|
||||
public CoronaStats(IErrorHandler errorHandler, IEmojiConverter emojiConverter)
|
||||
public CoronaStats(IErrorHandler errorHandler, IGuildSettingsManager guildSettingsManager, IEmojiConverter emojiConverter) : base(errorHandler, guildSettingsManager)
|
||||
{
|
||||
_errorHandler = errorHandler;
|
||||
_emojiConverter = emojiConverter;
|
||||
}
|
||||
|
||||
|
@ -50,7 +49,7 @@ namespace Geekbot.Bot.Commands.Utils.Corona
|
|||
var deathsFormatted = summary.Deaths.ToString(numberFormat);
|
||||
|
||||
var embedTitleBuilder = new StringBuilder();
|
||||
embedTitleBuilder.Append("Confirmed Corona Cases");
|
||||
embedTitleBuilder.Append(Localization.Corona.ConfirmedCases);
|
||||
if (!string.IsNullOrEmpty(summary.Country))
|
||||
{
|
||||
embedTitleBuilder.Append(" - ");
|
||||
|
@ -66,20 +65,20 @@ namespace Geekbot.Bot.Commands.Utils.Corona
|
|||
},
|
||||
Footer = new EmbedFooterBuilder
|
||||
{
|
||||
Text = "Source: covid19-api.org",
|
||||
Text = $"{Localization.Corona.Source}: covid19-api.org",
|
||||
},
|
||||
Color = Color.Red
|
||||
};
|
||||
eb.AddField("Total", totalFormatted);
|
||||
eb.AddInlineField("Active", $"{activeFormatted} ({activePercent})");
|
||||
eb.AddInlineField("Recovered", $"{recoveredFormatted} ({recoveredPercentage})");
|
||||
eb.AddInlineField("Deaths", $"{deathsFormatted} ({deathsPercentage})");
|
||||
eb.AddField(Localization.Corona.Total, totalFormatted);
|
||||
eb.AddInlineField(Localization.Corona.Active, $"{activeFormatted} ({activePercent})");
|
||||
eb.AddInlineField(Localization.Corona.Recovered, $"{recoveredFormatted} ({recoveredPercentage})");
|
||||
eb.AddInlineField(Localization.Corona.Deaths, $"{deathsFormatted} ({deathsPercentage})");
|
||||
|
||||
await Context.Channel.SendMessageAsync(String.Empty, false, eb.Build());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await _errorHandler.HandleCommandException(e, Context);
|
||||
await ErrorHandler.HandleCommandException(e, Context);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
117
src/Bot/Localization/Corona.Designer.cs
generated
Normal file
117
src/Bot/Localization/Corona.Designer.cs
generated
Normal file
|
@ -0,0 +1,117 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Geekbot.Bot.Localization {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Corona {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Corona() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geekbot.Bot.Localization.Corona", typeof(Corona).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Active.
|
||||
/// </summary>
|
||||
internal static string Active {
|
||||
get {
|
||||
return ResourceManager.GetString("Active", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Confirmed Corona Cases.
|
||||
/// </summary>
|
||||
internal static string ConfirmedCases {
|
||||
get {
|
||||
return ResourceManager.GetString("ConfirmedCases", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Deaths.
|
||||
/// </summary>
|
||||
internal static string Deaths {
|
||||
get {
|
||||
return ResourceManager.GetString("Deaths", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Recovered.
|
||||
/// </summary>
|
||||
internal static string Recovered {
|
||||
get {
|
||||
return ResourceManager.GetString("Recovered", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Source.
|
||||
/// </summary>
|
||||
internal static string Source {
|
||||
get {
|
||||
return ResourceManager.GetString("Source", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Total.
|
||||
/// </summary>
|
||||
internal static string Total {
|
||||
get {
|
||||
return ResourceManager.GetString("Total", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
32
src/Bot/Localization/Corona.de-ch.resx
Normal file
32
src/Bot/Localization/Corona.de-ch.resx
Normal file
|
@ -0,0 +1,32 @@
|
|||
<root>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ConfirmedCases" xml:space="preserve">
|
||||
<value>Bstätigti Corona Fallzahle</value>
|
||||
</data>
|
||||
<data name="Total" xml:space="preserve">
|
||||
<value>Total</value>
|
||||
</data>
|
||||
<data name="Active" xml:space="preserve">
|
||||
<value>Aktiv</value>
|
||||
</data>
|
||||
<data name="Recovered" xml:space="preserve">
|
||||
<value>Erholt</value>
|
||||
</data>
|
||||
<data name="Deaths" xml:space="preserve">
|
||||
<value>Gstorbe</value>
|
||||
</data>
|
||||
<data name="Source" xml:space="preserve">
|
||||
<value>Quelle</value>
|
||||
</data>
|
||||
</root>
|
39
src/Bot/Localization/Corona.resx
Normal file
39
src/Bot/Localization/Corona.resx
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ConfirmedCases" xml:space="preserve">
|
||||
<value>Confirmed Corona Cases</value>
|
||||
</data>
|
||||
<data name="Total" xml:space="preserve">
|
||||
<value>Total</value>
|
||||
</data>
|
||||
<data name="Active" xml:space="preserve">
|
||||
<value>Active</value>
|
||||
</data>
|
||||
<data name="Recovered" xml:space="preserve">
|
||||
<value>Recovered</value>
|
||||
</data>
|
||||
<data name="Deaths" xml:space="preserve">
|
||||
<value>Deaths</value>
|
||||
</data>
|
||||
<data name="Source" xml:space="preserve">
|
||||
<value>Source</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in a new issue