Skip to content
Permalink
Browse files

- Fix typos, make strings translatable.

  • Loading branch information...
LlmDl committed Nov 5, 2019
1 parent f4ea434 commit f98396b45b378c194ee88e2e04726b59dc44b313
@@ -79,7 +79,7 @@ For building, open your terminal / command prompt and navigate to the Towny Dire
- **Maven**

- Run `mvn clean package` to generate the plugin in the `target` directory, within the Towny folder.
- Developers may use the following after setting up their github token [as shown here.](https://help.github.com/en/articles/configuring-apache-maven-for-use-with-github-package-registry#authenticating-to-github-package-registry).
- Developers may use the following after setting up their github token [as shown here.](https://help.github.com/en/articles/configuring-apache-maven-for-use-with-github-package-registry#authenticating-to-github-package-registry)

```
<repositories>
@@ -61,7 +61,7 @@ public Nation(String name) {
public void setTag(String text) throws TownyException {

if (text.length() > 4) {
throw new TownyException("Tag too long");
throw new TownyException(TownySettings.getLangString("msg_err_tag_too_long"));
}
this.tag = text.toUpperCase().trim();
Bukkit.getPluginManager().callEvent(new NationTagChangeEvent(this.tag));
@@ -227,7 +227,7 @@ public Town getCapital() {

public Location getNationSpawn() throws TownyException {
if(nationSpawn == null){
throw new TownyException("Nation has not set a spawn location.");
throw new TownyException(TownySettings.getLangString("msg_err_nation_has_not_set_a_spawn_location"));
}

return nationSpawn;
@@ -281,7 +281,7 @@ public Town getTown() throws NotRegisteredException {
if (hasTown())
return town;
else
throw new NotRegisteredException("Resident doesn't belong to any town");
throw new NotRegisteredException(TownySettings.getLangString("msg_err_resident_doesnt_belong_to_any_town"));
}

public void setTown(Town town) throws AlreadyRegisteredException {
@@ -495,7 +495,7 @@ public void toggleMode(String newModes[], boolean notify) {
}

if (notify)
TownyMessaging.sendMsg(this, ("Modes set: " + StringMgmt.join(getModes(), ",")));
TownyMessaging.sendMsg(this, (TownySettings.getLangString("msg_modes_set") + StringMgmt.join(getModes(), ",")));
}

@Override
@@ -505,7 +505,7 @@ public void setModes(String[] modes, boolean notify) {
this.toggleMode(modes, false);

if (notify)
TownyMessaging.sendMsg(this, ("Modes set: " + StringMgmt.join(getModes(), ",")));
TownyMessaging.sendMsg(this, (TownySettings.getLangString("msg_modes_set") + StringMgmt.join(getModes(), ",")));


}
@@ -516,7 +516,7 @@ public void clearModes() {
this.modes.clear();

if (BukkitTools.scheduleSyncDelayedTask(new SetDefaultModes(this.getName(), true), 1) == -1)
TownyMessaging.sendErrorMsg("Could not set default modes for " + getName() + ".");
TownyMessaging.sendErrorMsg(TownySettings.getLangString("msg_err_could_not_set_default_modes_for") + getName() + ".");

}

@@ -91,7 +91,7 @@ public void addTownBlock(TownBlock townBlock) throws AlreadyRegisteredException
public void setTag(String text) throws TownyException {

if (text.length() > 4)
throw new TownyException("Tag too long");
throw new TownyException(TownySettings.getLangString("msg_err_tag_too_long"));
this.tag = text.toUpperCase();
if (this.tag.matches(" "))
this.tag = "";
@@ -135,7 +135,7 @@ public double getTaxes() {
public void setMayor(Resident mayor) throws TownyException {

if (!hasResident(mayor))
throw new TownyException("Mayor doesn't belong to town.");
throw new TownyException(TownySettings.getLangString("msg_err_mayor_doesnt_belong_to_town"));
this.mayor = mayor;

TownyPerms.assignPermissions(mayor, null);
@@ -146,7 +146,7 @@ public Nation getNation() throws NotRegisteredException {
if (hasNation())
return nation;
else
throw new NotRegisteredException("Town doesn't belong to any nation.");
throw new NotRegisteredException(TownySettings.getLangString("msg_err_town_doesnt_belong_to_any_nation"));
}

public void setNation(Nation nation) throws AlreadyRegisteredException {
@@ -450,7 +450,7 @@ public boolean setHomeBlock(TownBlock homeBlock) throws TownyException {
return false;
}
if (!hasTownBlock(homeBlock))
throw new TownyException("Town has no claim over this town block.");
throw new TownyException(TownySettings.getLangString("msg_err_town_has_no_claim_over_this_town_block"));
this.homeBlock = homeBlock;

// Set the world as it may have changed
@@ -694,7 +694,7 @@ public Location getSpawn() throws TownyException {

else {
this.spawn = null;
throw new TownyException("Town has not set a spawn location.");
throw new TownyException(TownySettings.getLangString("msg_err_town_has_not_set_a_spawn_location"));
}
}

@@ -776,13 +776,13 @@ public void addOutpostSpawn(Location spawn) throws TownyException {
TownBlock outpost = TownyUniverse.getInstance().getDataSource().getWorld(spawn.getWorld().getName()).getTownBlock(spawnBlock);
if (outpost.getX() == spawnBlock.getX() && outpost.getZ() == spawnBlock.getZ()) {
if (!outpost.isOutpost())
throw new TownyException("Location is not within an outpost plot.");
throw new TownyException(TownySettings.getLangString("msg_err_location_is_not_within_an_outpost_plot"));

outpostSpawns.add(spawn);
}

} catch (NotRegisteredException e) {
throw new TownyException("Location is not within a Town.");
throw new TownyException(TownySettings.getLangString("msg_err_location_is_not_within_a_town"));
}

}
@@ -809,7 +809,7 @@ public void forceAddOutpostSpawn(Location spawn) {
public Location getOutpostSpawn(Integer index) throws TownyException {

if (getMaxOutpostSpawn() == 0 && TownySettings.isOutpostsLimitedByLevels())
throw new TownyException("Town has no outpost spawns set.");
throw new TownyException(TownySettings.getLangString("msg_err_town_has_no_outpost_spawns_set"));

return outpostSpawns.get(Math.min(getMaxOutpostSpawn() - 1, Math.max(0, index - 1)));
}
@@ -994,10 +994,10 @@ public void withdrawFromBank(Resident resident, int amount) throws EconomyExcept
// throw new TownyException("You don't have access to the town's bank.");

if (TownySettings.isUsingEconomy()) {
if (!payTo(amount, resident, "Town Widthdraw"))
throw new TownyException("There is not enough money in the bank.");
if (!payTo(amount, resident, "Town Withdraw"))
throw new TownyException(TownySettings.getLangString("msg_err_no_money"));
} else
throw new TownyException("Economy has not been turned on.");
throw new TownyException(TownySettings.getLangString("msg_err_no_economy"));

}

@@ -1064,14 +1064,14 @@ public void addJailSpawn(Location spawn) throws TownyException {
TownBlock jail = townyUniverse.getDataSource().getWorld(spawn.getWorld().getName()).getTownBlock(spawnBlock);
if (jail.getX() == spawnBlock.getX() && jail.getZ() == spawnBlock.getZ()) {
if (!jail.isJail())
throw new TownyException("Location is not within a Jail plot.");
throw new TownyException(TownySettings.getLangString("msg_err_location_is_not_within_a_jail_plot"));

jailSpawns.add(spawn);
townyUniverse.getDataSource().saveTown(this);
}

} catch (NotRegisteredException e) {
throw new TownyException("Location is not within a Town.");
throw new TownyException(TownySettings.getLangString("msg_err_location_is_not_within_a_town"));
}

}
@@ -1107,7 +1107,7 @@ public void forceAddJailSpawn(Location spawn) {
public Location getJailSpawn(Integer index) throws TownyException {

if (getMaxJailSpawn() == 0)
throw new TownyException("Town has no jail spawns set.");
throw new TownyException(TownySettings.getLangString("msg_err_town_has_no_jail_spawns_set"));

return jailSpawns.get(Math.min(getMaxJailSpawn() - 1, Math.max(0, index - 1)));
}

0 comments on commit f98396b

Please sign in to comment.
You can’t perform that action at this time.