From 0e6037584fd71bc0bf846922fee6e631995f3b68 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 27 Oct 2019 15:29:40 +1000 Subject: [PATCH] Remove support for pluralisation to match Minecraft and alleviate issues with over-complexity --- .../worldedit/command/BiomeCommands.java | 4 +- .../worldedit/command/ExpandCommands.java | 4 +- .../worldedit/command/GenerationCommands.java | 14 +- .../worldedit/command/NavigationCommands.java | 4 +- .../worldedit/command/RegionCommands.java | 30 ++-- .../worldedit/command/UtilityCommands.java | 31 ++-- .../function/operation/ForwardExtentCopy.java | 6 +- .../function/visitor/BreadthFirstSearch.java | 2 +- .../function/visitor/EntityVisitor.java | 2 +- .../function/visitor/FlatRegionVisitor.java | 2 +- .../function/visitor/RegionVisitor.java | 2 +- .../util/translation/LocalisationHelpers.java | 42 ----- .../src/main/resources/lang/strings.json | 147 ++++++------------ 13 files changed, 99 insertions(+), 191 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/LocalisationHelpers.java diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index 9b40db6a8..447c8275c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -167,7 +167,7 @@ public class BiomeCommands { return TextComponent.of(biome.getId()); } }).collect(Collectors.toList()); - player.printInfo(TranslatableComponent.of(pluraliseI18n(messageKey, biomes.size()), TextUtils.join(components, TextComponent.of(", ")))); + player.printInfo(TranslatableComponent.of(messageKey, TextUtils.join(components, TextComponent.of(", ")))); } @Command( @@ -201,7 +201,7 @@ public class BiomeCommands { Operations.completeLegacy(visitor); player.printInfo(TranslatableComponent.of( - pluraliseI18n("worldedit.setbiome.changed", visitor.getAffected()), + "worldedit.setbiome.changed", TextComponent.of(visitor.getAffected()) )); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java index d7e908e53..829766b9d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java @@ -113,7 +113,7 @@ public class ExpandCommands { session.getRegionSelector(player.getWorld()).explainRegionAdjust(player, session); int changeSize = newSize - oldSize; player.printInfo( - TranslatableComponent.of(pluraliseI18n("worldedit.expand.expanded.vert", changeSize), TextComponent.of(changeSize)) + TranslatableComponent.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize)) ); } catch (RegionOperationException e) { player.printError(TextComponent.of(e.getMessage())); @@ -152,7 +152,7 @@ public class ExpandCommands { session.getRegionSelector(world).explainRegionAdjust(actor, session); int changeSize = newSize - oldSize; - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.expand.expanded", changeSize), TextComponent.of(changeSize))); + actor.printInfo(TranslatableComponent.of("worldedit.expand.expanded", TextComponent.of(changeSize))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index 92fe2222a..b6a2a3c42 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -126,7 +126,7 @@ public class GenerationCommands { BlockVector3 pos = session.getPlacementPosition(actor); int affected = editSession.makeCylinder(pos, pattern, radiusX, radiusZ, height, !hollow); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.cyl.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.cyl.created", TextComponent.of(affected))); return affected; } @@ -193,7 +193,7 @@ public class GenerationCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.sphere.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.sphere.created", TextComponent.of(affected))); return affected; } @@ -214,7 +214,7 @@ public class GenerationCommands { worldEdit.checkMaxRadius(size); density /= 100; int affected = editSession.makeForest(session.getPlacementPosition(actor), size, density, type); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.forestgen.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.forestgen.created", TextComponent.of(affected))); return affected; } @@ -229,7 +229,7 @@ public class GenerationCommands { int size) throws WorldEditException { worldEdit.checkMaxRadius(size); int affected = editSession.makePumpkinPatches(session.getPlacementPosition(actor), size); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.pumpkins.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.pumpkins.created", TextComponent.of(affected))); return affected; } @@ -266,7 +266,7 @@ public class GenerationCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.pyramid.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.pyramid.created", TextComponent.of(affected))); return affected; } @@ -325,7 +325,7 @@ public class GenerationCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.generate.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.generate.created", TextComponent.of(affected))); return affected; } catch (ExpressionException e) { actor.printError(TextComponent.of(e.getMessage())); @@ -384,7 +384,7 @@ public class GenerationCommands { try { final int affected = editSession.makeBiomeShape(region, zero, unit, target, String.join(" ", expression), hollow, session.getTimeout()); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.generatebiome.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.generatebiome.changed", TextComponent.of(affected))); return affected; } catch (ExpressionException e) { actor.printError(TextComponent.of(e.getMessage())); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java index e168389b9..f1a815b39 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java @@ -86,7 +86,7 @@ public class NavigationCommands { if (ascentLevels == 0) { player.printError(TranslatableComponent.of("worldedit.ascend.obstructed")); } else { - player.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.ascend.moved", ascentLevels), TextComponent.of(ascentLevels))); + player.printInfo(TranslatableComponent.of("worldedit.ascend.moved", TextComponent.of(ascentLevels))); } } @@ -109,7 +109,7 @@ public class NavigationCommands { if (descentLevels == 0) { player.printError(TranslatableComponent.of("worldedit.descend.obstructed")); } else { - player.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.descend.moved", descentLevels), TextComponent.of(descentLevels))); + player.printInfo(TranslatableComponent.of("worldedit.descend.moved", TextComponent.of(descentLevels))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 59584a1e8..6d59e128f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -139,7 +139,7 @@ public class RegionCommands { BlockVector3 pos2 = cuboidregion.getPos2(); int blocksChanged = editSession.drawLine(pattern, pos1, pos2, thickness, !shell); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.line.changed", blocksChanged), TextComponent.of(blocksChanged))); + actor.printInfo(TranslatableComponent.of("worldedit.line.changed", TextComponent.of(blocksChanged))); return blocksChanged; } @@ -169,7 +169,7 @@ public class RegionCommands { int blocksChanged = editSession.drawSpline(pattern, vectors, 0, 0, 0, 10, thickness, !shell); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.curve.changed", blocksChanged), TextComponent.of(blocksChanged))); + actor.printInfo(TranslatableComponent.of("worldedit.curve.changed", TextComponent.of(blocksChanged))); return blocksChanged; } @@ -189,7 +189,7 @@ public class RegionCommands { from = new ExistingBlockMask(editSession); } int affected = editSession.replaceBlocks(region, from, to); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.replace.replaced", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.replace.replaced", TextComponent.of(affected))); return affected; } @@ -203,7 +203,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to overlay") Pattern pattern) throws WorldEditException { int affected = editSession.overlayCuboidBlocks(region, pattern); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.overlay.overlaid", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.overlay.overlaid", TextComponent.of(affected))); return affected; } @@ -218,7 +218,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to set") Pattern pattern) throws WorldEditException { int affected = editSession.center(region, pattern); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.center.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.center.changed", TextComponent.of(affected))); return affected; } @@ -230,7 +230,7 @@ public class RegionCommands { @Logging(REGION) public int naturalize(Actor actor, EditSession editSession, @Selection Region region) throws WorldEditException { int affected = editSession.naturalizeCuboidBlocks(region); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.naturalize.naturalized", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.naturalize.naturalized", TextComponent.of(affected))); return affected; } @@ -244,7 +244,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to set") Pattern pattern) throws WorldEditException { int affected = editSession.makeWalls(region, pattern); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.walls.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.walls.changed", TextComponent.of(affected))); return affected; } @@ -259,7 +259,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to set") Pattern pattern) throws WorldEditException { int affected = editSession.makeCuboidFaces(region, pattern); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.faces.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.faces.changed", TextComponent.of(affected))); return affected; } @@ -278,7 +278,7 @@ public class RegionCommands { HeightMap heightMap = new HeightMap(editSession, region, mask); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); int affected = heightMap.applyFilter(filter, iterations); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.smooth.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.smooth.changed", TextComponent.of(affected))); return affected; } @@ -333,7 +333,7 @@ public class RegionCommands { } } - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.move.moved", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.move.moved", TextComponent.of(affected))); return affected; } @@ -388,7 +388,7 @@ public class RegionCommands { } } - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.stack.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.stack.changed", TextComponent.of(affected))); return affected; } @@ -455,7 +455,7 @@ public class RegionCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.deform.deformed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.deform.deformed", TextComponent.of(affected))); return affected; } catch (ExpressionException e) { actor.printError(TextComponent.of(e.getMessage())); @@ -479,7 +479,7 @@ public class RegionCommands { checkCommandArgument(thickness >= 0, "Thickness must be >= 0"); int affected = editSession.hollowOutRegion(region, thickness, pattern); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.hollow.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.hollow.changed", TextComponent.of(affected))); return affected; } @@ -496,7 +496,7 @@ public class RegionCommands { double density) throws WorldEditException { checkCommandArgument(0 <= density && density <= 100, "Density must be in [0, 100]"); int affected = editSession.makeForest(region, density / 100, type); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.forest.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.forest.created", TextComponent.of(affected))); return affected; } @@ -518,7 +518,7 @@ public class RegionCommands { Operations.completeLegacy(visitor); int affected = ground.getAffected(); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.flora.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.flora.created", TextComponent.of(affected))); return affected; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 1252a12c6..d3eb84ea2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.command; import static com.sk89q.worldedit.command.util.Logging.LogMode.PLACEMENT; -import static com.sk89q.worldedit.util.translation.LocalisationHelpers.pluraliseI18n; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.IncompleteRegionException; @@ -101,7 +100,7 @@ public class UtilityCommands { BlockVector3 pos = session.getPlacementPosition(actor); int affected = editSession.fillXZ(pos, pattern, radius, depth, false); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.fill.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.fill.created", TextComponent.of(affected))); return affected; } @@ -125,7 +124,7 @@ public class UtilityCommands { BlockVector3 pos = session.getPlacementPosition(actor); int affected = editSession.fillXZ(pos, pattern, radius, depth, true); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.fillr.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.fillr.created", TextComponent.of(affected))); return affected; } @@ -143,7 +142,7 @@ public class UtilityCommands { radius = Math.max(0, radius); we.checkMaxRadius(radius); int affected = editSession.drainArea(session.getPlacementPosition(actor), radius, waterlogged); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.drain.drained", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.drain.drained", TextComponent.of(affected))); return affected; } @@ -160,7 +159,7 @@ public class UtilityCommands { radius = Math.max(0, radius); we.checkMaxRadius(radius); int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.LAVA); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.fixlava.fixed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.fixlava.fixed", TextComponent.of(affected))); return affected; } @@ -177,7 +176,7 @@ public class UtilityCommands { radius = Math.max(0, radius); we.checkMaxRadius(radius); int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.WATER); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.fixwater.fixed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.fixwater.fixed", TextComponent.of(affected))); return affected; } @@ -198,7 +197,7 @@ public class UtilityCommands { height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); int affected = editSession.removeAbove(session.getPlacementPosition(actor), size, height); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.removeabove.removed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.removeabove.removed", TextComponent.of(affected))); return affected; } @@ -219,7 +218,7 @@ public class UtilityCommands { height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); int affected = editSession.removeBelow(session.getPlacementPosition(actor), size, height); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.removebelow.removed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.removebelow.removed", TextComponent.of(affected))); return affected; } @@ -239,7 +238,7 @@ public class UtilityCommands { we.checkMaxRadius(radius); int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, radius); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.removenear.removed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.removenear.removed", TextComponent.of(affected))); return affected; } @@ -270,7 +269,7 @@ public class UtilityCommands { } int affected = editSession.replaceBlocks(region, from, to); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.replacenear.replaced", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.replacenear.replaced", TextComponent.of(affected))); return affected; } @@ -288,7 +287,7 @@ public class UtilityCommands { we.checkMaxRadius(size); int affected = editSession.simulateSnow(session.getPlacementPosition(actor), size); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.snow.created", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.snow.created", TextComponent.of(affected))); return affected; } @@ -306,7 +305,7 @@ public class UtilityCommands { we.checkMaxRadius(size); int affected = editSession.thaw(session.getPlacementPosition(actor), size); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.thaw.removed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.thaw.removed", TextComponent.of(affected))); return affected; } @@ -327,7 +326,7 @@ public class UtilityCommands { final boolean onlyNormalDirt = !convertCoarse; final int affected = editSession.green(session.getPlacementPosition(actor), size, onlyNormalDirt); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.green.changed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.green.changed", TextComponent.of(affected))); return affected; } @@ -350,7 +349,7 @@ public class UtilityCommands { Mask mask = new BlockTypeMask(editSession, BlockTypes.FIRE); int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, size); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.extinguish.removed", affected), TextComponent.of(affected))); + actor.printInfo(TranslatableComponent.of("worldedit.extinguish.removed", TextComponent.of(affected))); return affected; } @@ -408,7 +407,7 @@ public class UtilityCommands { int killed = killMatchingEntities(radius, actor, flags::createFunction); actor.printInfo(TranslatableComponent.of( - pluraliseI18n("worldedit.butcher.killed", killed), + "worldedit.butcher.killed", TextComponent.of(killed), TextComponent.of(radius) )); @@ -434,7 +433,7 @@ public class UtilityCommands { } int removed = killMatchingEntities(radius, actor, remover::createFunction); - actor.printInfo(TranslatableComponent.of(pluraliseI18n("worldedit.remove.removed", removed), TextComponent.of(removed))); + actor.printInfo(TranslatableComponent.of("worldedit.remove.removed", TextComponent.of(removed))); return removed; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index ddc35e107..a08507e03 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -345,11 +345,11 @@ public class ForwardExtentCopy implements Operation { @Override public Iterable getStatusMessages() { List messages = new ArrayList<>(); - messages.add(TranslatableComponent.of(pluraliseI18n("worldedit.operation.affected.block", affectedBlocks), + messages.add(TranslatableComponent.of("worldedit.operation.affected.block", TextComponent.of(affectedBlocks)).color(TextColor.LIGHT_PURPLE)); - messages.add(TranslatableComponent.of(pluraliseI18n("worldedit.operation.affected.biome", affectedBiomeCols), + messages.add(TranslatableComponent.of("worldedit.operation.affected.biome", TextComponent.of(affectedBiomeCols)).color(TextColor.LIGHT_PURPLE)); - messages.add(TranslatableComponent.of(pluraliseI18n("worldedit.operation.affected.entity", affectedEntities), + messages.add(TranslatableComponent.of("worldedit.operation.affected.entity", TextComponent.of(affectedEntities)).color(TextColor.LIGHT_PURPLE)); return messages; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index 9d4144d3f..e32ec54d9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -189,7 +189,7 @@ public abstract class BreadthFirstSearch implements Operation { @Override public Iterable getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( - pluraliseI18n("worldedit.operation.affected.block", getAffected()), + "worldedit.operation.affected.block", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java index 719fa3e60..b8e9cb99f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java @@ -86,7 +86,7 @@ public class EntityVisitor implements Operation { @Override public Iterable getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( - pluraliseI18n("worldedit.operation.affected.entity", getAffected()), + "worldedit.operation.affected.entity", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java index e7b0daa57..70d3c9df0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java @@ -87,7 +87,7 @@ public class FlatRegionVisitor implements Operation { @Override public Iterable getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( - pluraliseI18n("worldedit.operation.affected.column", getAffected()), + "worldedit.operation.affected.column", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java index 4f595584b..a7070e1c4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java @@ -74,7 +74,7 @@ public class RegionVisitor implements Operation { @Override public Iterable getStatusMessages() { return Lists.newArrayList(TranslatableComponent.of( - pluraliseI18n("worldedit.operation.affected.block", getAffected()), + "worldedit.operation.affected.block", TextComponent.of(getAffected()) ).color(TextColor.LIGHT_PURPLE)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/LocalisationHelpers.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/LocalisationHelpers.java deleted file mode 100644 index 7909076b5..000000000 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/LocalisationHelpers.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.util.translation; - -public class LocalisationHelpers { - - private LocalisationHelpers() { - } - - /** - * Turn a translation key into a ".singular" or ".plural" - * depending on what the given number is. - * - * @param translationKey The base translation key - * @param number The number - * @return The key with .plural or .singular appended - */ - public static String pluraliseI18n(String translationKey, float number) { - if (number == 1) { - return translationKey + ".singular"; - } else { - return translationKey + ".plural"; - } - } -} diff --git a/worldedit-core/src/main/resources/lang/strings.json b/worldedit-core/src/main/resources/lang/strings.json index 758f33654..341c5a2ee 100644 --- a/worldedit-core/src/main/resources/lang/strings.json +++ b/worldedit-core/src/main/resources/lang/strings.json @@ -1,16 +1,11 @@ { "worldedit.expand.description.vert": "Vertically expand the selection to world limits.", - "worldedit.expand.expanded.singular": "Region expanded {0} block", - "worldedit.expand.expanded.plural": "Region expanded {0} blocks", - "worldedit.expand.expanded.vert.singular": "Region expanded {0} block (top-to-bottom).", - "worldedit.expand.expanded.vert.plural": "Region expanded {0} blocks (top-to-bottom).", + "worldedit.expand.expanded": "Region expanded {0} blocks", + "worldedit.expand.expanded.vert": "Region expanded {0} blocks (top-to-bottom).", - "worldedit.biomeinfo.lineofsight.singular": "Biome at line of sight point: {0}", - "worldedit.biomeinfo.lineofsight.plural": "Biomes at line of sight point: {0}", - "worldedit.biomeinfo.position.singular": "Biome at your position: {0}", - "worldedit.biomeinfo.position.plural": "Biomes at your position: {0}", - "worldedit.biomeinfo.selection.singular": "Biome in your selection: {0}", - "worldedit.biomeinfo.selection.plural": "Biomes in your selection: {0}", + "worldedit.biomeinfo.lineofsight": "Biomes at line of sight point: {0}", + "worldedit.biomeinfo.position": "Biomes at your position: {0}", + "worldedit.biomeinfo.selection": "Biomes in your selection: {0}", "worldedit.bruch.radius-too-large": "Maximum allowed brush radius: {0}", "worldedit.brush.apply.description": "Apply brush, apply a function to every block", @@ -34,8 +29,7 @@ "worldedit.brush.operation.equip": "Set brush to {0}.", "worldedit.brush.none.equip": "Brush unbound from your current item.", - "worldedit.setbiome.changed.singular": "Biomes were changed in {0} column. You may have to rejoin your game (or close and reopen your world) to see a change.", - "worldedit.setbiome.changed.plural": "Biomes were changed in {0} columns. You may have to rejoin your game (or close and reopen your world) to see a change.", + "worldedit.setbiome.changed": "Biomes were changed in {0} columns. You may have to rejoin your game (or close and reopen your world) to see a change.", "worldedit.drawsel.disabled": "Server CUI disabled.", "worldedit.drawsel.enabled": "Server CUI enabled. This only supports cuboid regions, with a maximum size of 32x32x32.", @@ -99,37 +93,22 @@ "worldedit.schematic.delete.deleted": "{0} has been deleted.", "worldedit.schematic.formats.title": "Available clipboard formats (Name: Lookup names)", - "worldedit.drain.drained.singular": "{0} block has been drained.", - "worldedit.drain.drained.plural": "{0} blocks have been drained.", - "worldedit.fill.created.singular": "{0} block has been filled.", - "worldedit.fill.created.plural": "{0} blocks have been filled.", - "worldedit.fillr.created.singular": "{0} block has been filled.", - "worldedit.fillr.created.plural": "{0} blocks have been filled.", - "worldedit.fixlava.fixed.singular": "{0} block has been fixed.", - "worldedit.fixlava.fixed.plural": "{0} blocks have been fixed.", - "worldedit.fixwater.fixed.singular": "{0} block has been fixed.", - "worldedit.fixwater.fixed.plural": "{0} blocks have been fixed.", - "worldedit.removeabove.removed.singular": "{0} block has been removed.", - "worldedit.removeabove.removed.plural": "{0} blocks have been removed.", - "worldedit.removebelow.removed.singular": "{0} block has been removed.", - "worldedit.removebelow.removed.plural": "{0} blocks have been removed.", - "worldedit.removenear.removed.singular": "{0} block has been removed.", - "worldedit.removenear.removed.plural": "{0} blocks have been removed.", - "worldedit.replacenear.replaced.singular": "{0} block has been replaced.", - "worldedit.replacenear.replaced.plural": "{0} blocks have been replaced.", - "worldedit.snow.created.singular": "{0} surface has been covered.", - "worldedit.snow.created.plural": "{0} surfaces have been covered.", - "worldedit.thaw.removed.singular": "{0} block has been thawed.", - "worldedit.thaw.removed.plural": "{0} blocks have been thawed.", - "worldedit.green.changed.singular": "{0} block has been greened.", - "worldedit.green.changed.plural": "{0} blocks have been greened.", - "worldedit.extinguish.removed.singular": "{0} fire has been extinguished.", - "worldedit.extinguish.removed.plural": "{0} fires have been extinguished.", - "worldedit.butcher.killed.singular": "{0} mob has been killed in a radius of {1}.", - "worldedit.butcher.killed.plural": "{0} mobs have been killed in a radius of {1}.", + "worldedit.drain.drained": "{0} blocks have been drained.", + "worldedit.fill.created": "{0} blocks have been filled.", + "worldedit.fillr.created": "{0} blocks have been filled.", + "worldedit.fixlava.fixed": "{0} blocks have been fixed.", + "worldedit.fixwater.fixed": "{0} blocks have been fixed.", + "worldedit.removeabove.removed": "{0} blocks have been removed.", + "worldedit.removebelow.removed": "{0} blocks have been removed.", + "worldedit.removenear.removed": "{0} blocks have been removed.", + "worldedit.replacenear.replaced": "{0} blocks have been replaced.", + "worldedit.snow.created": "{0} surfaces have been covered.", + "worldedit.thaw.removed": "{0} blocks have been thawed.", + "worldedit.green.changed": "{0} blocks have been greened.", + "worldedit.extinguish.removed": "{0} fires have been extinguished.", + "worldedit.butcher.killed": "{0} mobs have been killed in a radius of {1}.", "worldedit.butcher.explain-all": "Use -1 to remove all mobs in loaded chunks", - "worldedit.remove.removed.singular": "{0} entity has been marked for removal.", - "worldedit.remove.removed.plural": "{0} entities have been marked for removal.", + "worldedit.remove.removed": "{0} entities have been marked for removal.", "worldedit.remove.explain-all": "Use -1 to remove all entities in loaded chunks", "worldedit.calc.invalid": "'{0}' could not be parsed as a valid expression", @@ -142,47 +121,30 @@ "worldedit.set.done": "Operation completed.", "worldedit.set.done.verbose": "Operation completed ({0}).", - "worldedit.line.changed.singular": "{0} block has been changed.", - "worldedit.line.changed.plural": "{0} blocks have been changed.", + "worldedit.line.changed": "{0} blocks have been changed.", "worldedit.line.cuboid-only": "//line only works with cuboid selections", - "worldedit.curve.changed.singular": "{0} block has been changed.", - "worldedit.curve.changed.plural": "{0} blocks have been changed.", + "worldedit.curve.changed": "{0} blocks have been changed.", "worldedit.curve.convex-only": "//curve only works with convex polyhedral selections", - "worldedit.replace.replaced.singular": "{0} block has been replaced.", - "worldedit.replace.replaced.plural": "{0} blocks have been replaced.", - "worldedit.stack.changed.singular": "{0} block changed. Undo with //undo", - "worldedit.stack.changed.plural": "{0} blocks changed. Undo with //undo", + "worldedit.replace.replaced": "{0} blocks have been replaced.", + "worldedit.stack.changed": "{0} blocks changed. Undo with //undo", "worldedit.regen.regenerated": "Region regenerated.", - "worldedit.walls.changed.singular": "{0} block has been changed.", - "worldedit.walls.changed.plural": "{0} blocks have been changed.", - "worldedit.faces.changed.singular": "{0} block has been changed.", - "worldedit.faces.changed.plural": "{0} blocks have been changed.", - "worldedit.overlay.overlaid.singular": "{0} block has been overlaid.", - "worldedit.overlay.overlaid.plural": "{0} blocks have been overlaid.", - "worldedit.naturalize.naturalized.singular": "{0} block has been made to look more natural.", - "worldedit.naturalize.naturalized.plural": "{0} block(s) have been made to look more natural.", - "worldedit.center.changed.singular": "Center set. ({0} block changed)", - "worldedit.center.changed.plural": "Center set. ({0} blocks changed)", - "worldedit.smooth.changed.singular": "Terrain's height map smoothed. {0} block changed.", - "worldedit.smooth.changed.plural": "Terrain's height map smoothed. {0} blocks changed.", - "worldedit.move.moved.singular": "{0} block moved.", - "worldedit.move.moved.plural": "{0} blocks moved.", - "worldedit.deform.deformed.singular": "{0} block has been deformed.", - "worldedit.deform.deformed.plural": "{0} blocks have been deformed.", - "worldedit.hollow.changed.singular": "{0} block has been changed.", - "worldedit.hollow.changed.plural": "{0} blocks have been changed.", - "worldedit.forest.created.singular": "{0} tree created.", - "worldedit.forest.created.plural": "{0} trees created.", - "worldedit.flora.created.singular": "{0} flora created.", - "worldedit.flora.created.plural": "{0} flora created.", + "worldedit.walls.changed": "{0} blocks have been changed.", + "worldedit.faces.changed": "{0} blocks have been changed.", + "worldedit.overlay.overlaid": "{0} blocks have been overlaid.", + "worldedit.naturalize.naturalized": "{0} block(s) have been made to look more natural.", + "worldedit.center.changed": "Center set. ({0} blocks changed)", + "worldedit.smooth.changed": "Terrain's height map smoothed. {0} blocks changed.", + "worldedit.move.moved": "{0} blocks moved.", + "worldedit.deform.deformed": "{0} blocks have been deformed.", + "worldedit.hollow.changed": "{0} blocks have been changed.", + "worldedit.forest.created": "{0} trees created.", + "worldedit.flora.created": "{0} flora created.", "worldedit.unstuck.moved": "There you go!", "worldedit.ascend.obstructed": "No free spot above you found.", - "worldedit.ascend.moved.singular": "Ascended a level.", - "worldedit.ascend.moved.plural": "Ascended {0} levels.", + "worldedit.ascend.moved": "Ascended {0} levels.", "worldedit.descend.obstructed": "No free spot below you found.", - "worldedit.descend.moved.singular": "Descended a level.", - "worldedit.descend.moved.plural": "Descended {0} levels.", + "worldedit.descend.moved": "Descended {0} levels.", "worldedit.ceil.obstructed": "No free spot above you found.", "worldedit.ceil.moved": "Woosh!", "worldedit.thru.obstructed": "No free spot ahead of you found.", @@ -193,21 +155,14 @@ "worldedit.up.moved": "Woosh!", "worldedit.cyl.invalid-radius": "You must either specify 1 or 2 radius values.", - "worldedit.cyl.created.singular": "{0} block has been created.", - "worldedit.cyl.created.plural": "{0} blocks have been created.", + "worldedit.cyl.created": "{0} blocks have been created.", "worldedit.sphere.invalid-radius": "You must either specify 1 or 3 radius values.", - "worldedit.sphere.created.singular": "{0} block has been created.", - "worldedit.sphere.created.plural": "{0} blocks have been created.", - "worldedit.forestgen.created.singular": "{0} tree created.", - "worldedit.forestgen.created.plural": "{0} trees created.", - "worldedit.pumpkins.created.singular": "{0} pumpkin patch created.", - "worldedit.pumpkins.created.plural": "{0} pumpkin patches created.", - "worldedit.pyramid.created.singular": "{0} block has been created.", - "worldedit.pyramid.created.plural": "{0} blocks have been created.", - "worldedit.generate.created.singular": "{0} block has been created.", - "worldedit.generate.created.plural": "{0} blocks have been created.", - "worldedit.generate.changed.singular": "{0} column affected.", - "worldedit.generate.changed.plural": "{0} columns affected.", + "worldedit.sphere.created": "{0} blocks have been created.", + "worldedit.forestgen.created": "{0} trees created.", + "worldedit.pumpkins.created": "{0} pumpkin patches created.", + "worldedit.pyramid.created": "{0} blocks have been created.", + "worldedit.generate.created": "{0} blocks have been created.", + "worldedit.generate.changed": "{0} columns affected.", "worldedit.reload.config": "Configuration reloaded!", "worldedit.report.written": "WorldEdit report written to {0}", @@ -253,14 +208,10 @@ "worldedit.superpickaxe.mode.recursive": "Mode is now recursive. Left click with a pickaxe. // to disable.", "worldedit.superpickaxe.max-range": "Maximum range is {0}.", - "worldedit.operation.affected.biome.singular": "{0} biome affected", - "worldedit.operation.affected.biome.plural": "{0} biomes affected", - "worldedit.operation.affected.block.singular": "{0} block affected", - "worldedit.operation.affected.block.plural": "{0} blocks affected", - "worldedit.operation.affected.column.singular": "{0} column affected", - "worldedit.operation.affected.column.plural": "{0} columns affected", - "worldedit.operation.affected.entity.singular": "{0} entity affected", - "worldedit.operation.affected.entity.plural": "{0} entities affected", + "worldedit.operation.affected.biome": "{0} biomes affected", + "worldedit.operation.affected.block": "{0} blocks affected", + "worldedit.operation.affected.column": "{0} columns affected", + "worldedit.operation.affected.entity": "{0} entities affected", "worldedit.operation.deform.expression": "deformed using {0}", "worldedit.help.command-not-found": "The command '{0}' could not be found."