Browse Source

Ping Me: Fix grammar for singular times.

Since "Ping Me" reports the time in each of the components separately,
it's possible for a singular value to be reported.  The correct grammar
for this is to use the singular form. (e.g: 1 Hour, 1 Second, etc.).

BUG=Uncled1023/Combot#4

Signed-off-by: Aseda Aboagye <aseda.aboagye@gmail.com>
pingme-grammar
Aseda Aboagye 3 years ago
parent
commit
5ac01a2880
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      Modules/Ping Me/Ping_Me.cs

+ 10
- 5
Modules/Ping Me/Ping_Me.cs View File

@@ -58,23 +58,28 @@ namespace Combot.Modules.Plugins
string timeString = string.Empty;
if (difTime.Days > 0)
{
timeString += difTime.Days.ToString() + " Days, ";
timeString += difTime.Days.ToString();
timeString += (difTime.Days == 1) ? " Day, " : " Days, ";
}
if (difTime.Hours > 0)
{
timeString += difTime.Hours.ToString() + " Hours, ";
timeString += difTime.Hours.ToString();
timeString += (difTime.Hours == 1) ? " Hour, " : " Hours, ";
}
if (difTime.Minutes > 0)
{
timeString += difTime.Minutes.ToString() + " Minutes, ";
timeString += difTime.Minutes.ToString();
timeString += (difTime.Minutes == 1) ? " Minute, " : " Minutes, ";
}
if (difTime.Seconds > 0)
{
timeString += difTime.Seconds.ToString() + " Seconds, ";
timeString += difTime.Seconds.ToString();
timeString += (difTime.Seconds == 1) ? " Second, " : " Seconds, ";
}
if (difTime.Milliseconds > 0)
{
timeString += difTime.Milliseconds.ToString() + " Milliseconds";
timeString += difTime.Milliseconds.ToString();
timeString += (difTime.Milliseconds == 1) ? " Millisecond" : " Milliseconds";
}
switch (pingItem.MessageType)
{

Loading…
Cancel
Save