Generalized Localizer File

This commit is contained in:
Alex Stewart
2019-04-14 00:25:52 -07:00
parent fbd047849c
commit e0c761dfc0
36 changed files with 268 additions and 213 deletions
+6 -6
View File
@@ -8,7 +8,7 @@ public class CommandPollVote extends Command
public CommandPollVote(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return Localizer.Stub("Vote in a poll with the choice number, won't work if no poll is running, you can't change your vote once you have cast it! Be careful!"); }
public String HelpText() { return Localizer.Stub("PollVoteInfo"); }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
@@ -17,7 +17,7 @@ public class CommandPollVote extends Command
{
if(guild.hasVoted.contains(user.uniqueID))
{
res.Call(Localizer.Stub("You already voted!"));
res.Call(Localizer.Stub("PollVoteAlreadyVoted"));
return;
}
try
@@ -25,23 +25,23 @@ public class CommandPollVote extends Command
int voteNum = Integer.parseInt(input.args)-1;
if(voteNum >= guild.choices.size() || voteNum < 0)
{
res.Call(String.format(Localizer.Stub("%s That's not a vaild vote!"), voteNum));
res.Call(String.format(Localizer.Stub("PollVoteNotValidVote"), voteNum));
return;
}
KittyPoll polled = guild.choices.get(voteNum);
polled.votes++;
guild.hasVoted.add(user.uniqueID);
res.Call(Localizer.Stub("You successfully voted for") + " `" + polled.choice + "`!");
res.Call(Localizer.Stub("PollVoteSuccess") + " `" + polled.choice + "`!");
return;
}
catch (NumberFormatException e)
{
res.Call(Localizer.Stub("That's not a vaild number!"));
res.Call(Localizer.Stub("PollVoteNotValidNumber"));
return;
}
}
res.Call(Localizer.Stub("There is no poll running!"));
res.Call(Localizer.Stub("PollVoteNoPoll"));
}
}