From 4d51dc9b6cfbcbf4307cd74501ab0c400423eb14 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 9 Oct 2020 17:47:51 +0100 Subject: [PATCH] Switch to translateable captions --- .../plotsquared/core/util/RegionManager.java | 20 +++++++++---------- Core/src/main/resources/lang/messages_en.json | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java index bfc09d9d8..e406c10d6 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java @@ -28,7 +28,6 @@ package com.plotsquared.core.util; import com.google.inject.Inject; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Settings; -import com.plotsquared.core.configuration.caption.StaticCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.inject.factory.ProgressSubscriberFactory; import com.plotsquared.core.location.Location; @@ -66,7 +65,8 @@ public abstract class RegionManager { private final GlobalBlockQueue blockQueue; private final ProgressSubscriberFactory subscriberFactory; - @Inject public RegionManager(@Nonnull WorldUtil worldUtil, @Nonnull GlobalBlockQueue blockQueue, @Nonnull ProgressSubscriberFactory subscriberFactory) { + @Inject + public RegionManager(@Nonnull WorldUtil worldUtil, @Nonnull GlobalBlockQueue blockQueue, @Nonnull ProgressSubscriberFactory subscriberFactory) { this.worldUtil = worldUtil; this.blockQueue = blockQueue; this.subscriberFactory = subscriberFactory; @@ -189,15 +189,15 @@ public abstract class RegionManager { copyFromTo(pos1, pos2, relX, relZ, oldWorld, copyFrom, copyTo, false); copyFrom.setCompleteTask(copyTo::enqueue); if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) { - copyFrom.addProgressSubscriber(subscriberFactory.createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, - StaticCaption.of("Current copy progress: %"))); + copyFrom.addProgressSubscriber(subscriberFactory + .createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, TranslatableCaption.of("swap.progress_region_copy"))); } copyFrom .addReadChunks(new CuboidRegion(BlockVector3.at(pos1.getX(), 0, pos1.getZ()), BlockVector3.at(pos2.getX(), 0, pos2.getZ())).getChunks()); copyTo.setCompleteTask(whenDone); if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) { - copyTo.addProgressSubscriber(subscriberFactory.createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, - StaticCaption.of("Current paste progress: %"))); + copyTo.addProgressSubscriber(subscriberFactory + .createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, TranslatableCaption.of("swap.progress_region_paste"))); } return copyFrom.enqueue(); } @@ -247,13 +247,13 @@ public abstract class RegionManager { copyFromTo(pos1, pos2, relX, relZ, world1, fromQueue2, toQueue1, true); fromQueue1.setCompleteTask(fromQueue2::enqueue); if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) { - fromQueue1.addProgressSubscriber(subscriberFactory.createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, - TranslatableCaption.of("swap.progress_region1_copy"))); + fromQueue1.addProgressSubscriber(subscriberFactory + .createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, TranslatableCaption.of("swap.progress_region1_copy"))); } fromQueue2.setCompleteTask(toQueue1::enqueue); if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) { - fromQueue2.addProgressSubscriber(subscriberFactory.createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, - TranslatableCaption.of("swap.progress_region2_copy"))); + fromQueue2.addProgressSubscriber(subscriberFactory + .createFull(actor, Settings.QUEUE.NOTIFY_INTERVAL, Settings.QUEUE.NOTIFY_WAIT, TranslatableCaption.of("swap.progress_region2_copy"))); } toQueue1.setCompleteTask(toQueue2::enqueue); if (actor != null && Settings.QUEUE.NOTIFY_PROGRESS) { diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index b761e3070..f15ee9e18 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -78,6 +78,8 @@ "swap.progress_region2_copy": "Current region 2 copy progress: %Current region 1 paste progress: %", "swap.progress_region2_paste": "Current region 2 paste progress: %", + "swap.progress_region_copy": "Current copy progress: %", + "swap.progress_region_paste": "Current paste progress: %", "comment.inbox_notification": " unread messages. Use .", "comment.not_valid_inbox_index": "No comment at index .",