= Localized beans, help, help builder, info, invite

help builder localization currently will collapse for header titles. This isn't too big of a deal, but the word for 'commands' at least can be localized.
This commit is contained in:
Matthew Cech
2019-04-06 23:02:16 -07:00
parent b04e26cbc6
commit 9ea68605a4
6 changed files with 55 additions and 33 deletions
+5 -4
View File
@@ -1,6 +1,7 @@
package commands;
import core.Command;
import core.Localizer;
import dataStructures.*;
public class CommandGiveBeans extends Command
@@ -8,7 +9,7 @@ public class CommandGiveBeans extends Command
public CommandGiveBeans (KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Gives beans to the mentioned users!"; }
public String HelpText() { return Localizer.Stub("Gives beans to the mentioned users!"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
@@ -19,20 +20,20 @@ public class CommandGiveBeans extends Command
}
catch (NumberFormatException e)
{
res.Call("That's not a valid number!");
res.Call(Localizer.Stub("That's not a valid number!"));
return;
}
if(input.mentions == null)
{
res.Call("You didn't mention anyone!");
res.Call(Localizer.Stub("You didn't mention anyone!"));
return;
}
for(int i = 0; i < input.mentions.length; i++)
{
input.mentions[i].ChangeBeans(beans);
res.Call("Gave " + input.mentions[i].name + " " + beans + " beans!");
res.Call(String.format(Localizer.Stub("Gave %s %s beans!"), input.mentions[i].name, "" + beans));
}
}
}
+2 -6
View File
@@ -16,7 +16,7 @@ public class CommandHelp extends Command
public CommandHelp(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Lets you look up specific commands, or get a link to a list of all commands."; }
public String HelpText() { return Localizer.Stub("Lets you look up specific commands, or get a link to a list of all commands."); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
@@ -25,11 +25,7 @@ public class CommandHelp extends Command
if(help == null)
{
help = "You can get help with a specific command by typing `!help command`!"
+ "\nYou can also look at <https://www.rinsnowmew.com/bot/info/#commands>"
+ "\nGeneral Commands: `boop, roll, choose, help, info, vote, "
+ "results, showpoll, wolfram, cplus, java,"
+ "beans, role, bet, yeet`";
help = Localizer.Stub("You can get help with a specific command by typing `!help command`!\nYou can also look at <https://www.rinsnowmew.com/bot/info/#commands>\nGeneral Commands: `boop, roll, choose, help, info, vote, results, showpoll, wolfram, cplus, java, beans, role, bet, yeet`");
}
else
{
+3 -2
View File
@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import core.Command;
import core.Localizer;
import core.Stats;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
@@ -25,7 +26,7 @@ public class CommandHelpBuilder extends Command {
}
@Override
public String HelpText() { return "Emit help for all commands as formatted HTML"; }
public String HelpText() { return Localizer.Stub("Emit help for all commands as formatted HTML"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
@@ -95,7 +96,7 @@ public class CommandHelpBuilder extends Command {
roleStr = roleStr.substring(0, 1).toUpperCase() + roleStr.toLowerCase().substring(1);
// Section header
accumulated += headerStart + roleStr + " commands" + headerEnd;
accumulated += headerStart + roleStr + " " + Localizer.Stub("commands") + headerEnd;
accumulated += sectionStart;
// Section content
+3 -3
View File
@@ -1,6 +1,7 @@
package commands;
import core.Command;
import core.Localizer;
import dataStructures.KittyChannel;
import dataStructures.KittyGuild;
import dataStructures.KittyRating;
@@ -14,13 +15,12 @@ public class CommandInfo extends Command
public CommandInfo(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Provides author info and a link to Kitty's website"; }
public String HelpText() { return Localizer.Stub("Provides author info and a link to Kitty's website"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
String info = "I'm made by `Rin#8904` and `Reverie Wisp#3703`!\n"
+ "You can find more info about me along with a Patreon link to support us and GitHub link for filing bugs https://www.rinsnowmew.com/bot/" ;
String info = Localizer.Stub("I'm made by `Rin#8904` and `Reverie Wisp#3703`!\nYou can find more info about me along with a Patreon link to support us and GitHub link for filing bugs https://www.rinsnowmew.com/bot/");
res.Call(info);
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
package commands;
import core.Command;
import core.Localizer;
import dataStructures.*;
import offline.Ref;
@@ -9,7 +10,7 @@ public class CommandInvite extends Command
public CommandInvite(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Provies a direct invite link for KittyBot"; }
public String HelpText() { return Localizer.Stub("Provies a direct invite link for KittyBot"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)