+ Added localization to 4 files. Revised format to use files as sections.

This commit is contained in:
Matthew Cech
2019-03-30 16:03:03 -07:00
parent 8a64a70528
commit d40fbb776c
7 changed files with 85 additions and 32 deletions
+3 -3
View File
@@ -1,6 +1,7 @@
package commands;
import core.Command;
import core.Localizer;
import dataStructures.*;
public class CommandBeansShow extends Command
@@ -8,12 +9,11 @@ public class CommandBeansShow extends Command
public CommandBeansShow(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Displays how many beans you have"; };
public String HelpText() { return Localizer.Stub("Displays how many beans you have"); };
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String beans = "You have " + user.GetBeans() + " beans!";
res.Call(beans);
res.Call(String.format(Localizer.Stub("You have %s beans!"), user.GetBeans()));
}
}
+7 -7
View File
@@ -1,6 +1,7 @@
package commands;
import core.Command;
import core.Localizer;
import dataStructures.*;
public class CommandBetBeans extends Command
@@ -8,8 +9,7 @@ public class CommandBetBeans extends Command
public CommandBetBeans(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Allows you to bet your beans, set your amount after the command! Warning: House always wins!"
+ "\nSets of 3 will get 5x, 4 will get 10x, and 5 will get 1000x"; }
public String HelpText() { return Localizer.Stub("Allows you to bet your beans, set your amount after the command! Warning! House always wins!\nSets of 3 will get 5x, 4 will get 10x, and 5 will get 1000x"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
@@ -22,19 +22,19 @@ public class CommandBetBeans extends Command
bet = Integer.parseInt(input.args);
if(bet < 50)
{
res.Call("Please bet with at least 50 beans!");
res.Call(Localizer.Stub("Please bet with at least 50 beans!"));
return;
}
}
catch (NumberFormatException e)
{
res.Call("That's not a valid bet!");
res.Call(Localizer.Stub("That's not a valid bet!"));
return;
}
if(user.GetBeans() < bet)
{
res.Call("You don't have enough beans!");
res.Call(Localizer.Stub("You don't have enough beans!"));
return;
}
@@ -49,12 +49,12 @@ public class CommandBetBeans extends Command
if(win == 0)
{
res.Call("Sorry, you didn't win, try again!");
res.Call(Localizer.Stub("Sorry, you didn't win, try again!"));
return;
}
user.ChangeBeans(bet*win);
res.Call("You won " + (bet*win) + " beans!");
res.Call(String.format(Localizer.Stub("You won %s beans!"), "" + (bet*win)));
}
private int getWinning(int [] slots)
+2 -1
View File
@@ -8,6 +8,7 @@ import java.io.IOException;
import javax.imageio.ImageIO;
import core.Command;
import core.Localizer;
import dataStructures.*;
import utils.ImageUtils;
@@ -16,7 +17,7 @@ public class CommandBlurry extends Command
public CommandBlurry(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Blurs your icon or the icon of a friend you mentioned"; };
public String HelpText() { return Localizer.Stub("Blurs your icon or the icon of a friend you mentioned"); };
private static Long num = 0l;
+6 -4
View File
@@ -60,7 +60,7 @@ public class CommandBoop extends Command
}
@Override
public String HelpText() { return "Kitty will react with a counter"; }
public String HelpText() { return Localizer.Stub("Kitty will react with a counter"); }
// Called when the command is run!
@Override
@@ -69,16 +69,17 @@ public class CommandBoop extends Command
if(input.mentions == null)
{
boopTracker.ApplyBoop();
res.Call("Woah! " + user.name + " booped me! That's " + boopTracker.HowMany() + " total!");
res.Call(String.format(Localizer.Stub("Woah! %s booped me! That's %s total!"), user.name, boopTracker.HowMany()));
}
else
{
if(input.mentions.length == 1)
{
boopTracker.ApplyBoop();
res.Call(user.name + " booped " + input.mentions[0].name + "!");
res.Call(String.format(Localizer.Stub("%s booped %s!"), user.name, input.mentions[0].name));
return;
}
String booped = "";
for(int i = 0; i < input.mentions.length; i++)
{
@@ -88,7 +89,8 @@ public class CommandBoop extends Command
else
booped += "and " + input.mentions[i].name;
}
res.Call(user.name + " booped " + booped + "!");
res.Call(String.format(Localizer.Stub("%s booped several others - %s!"), user.name, booped));
}
}
}