Skip to content

Commit 327c83b

Browse files
committed
Added warning for translation file changes
Logs a warning about incompatible changes to `messages` files, instructing users to update and rename their translation files.
1 parent 720b5e4 commit 327c83b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/net/thenextlvl/gopaint/GoPaintPlugin.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.bukkit.plugin.java.JavaPlugin;
2929
import org.jspecify.annotations.NullMarked;
3030

31+
import java.nio.file.Files;
3132
import java.nio.file.Path;
3233
import java.util.List;
3334
import java.util.Locale;
@@ -70,6 +71,16 @@ public GoPaintPlugin() {
7071
@Override
7172
public void onLoad() {
7273
versionChecker.checkVersion();
74+
warnTranslationChanges();
75+
}
76+
77+
private void warnTranslationChanges() {
78+
if (!Files.isRegularFile(translations.resolve("messages.properties"))
79+
&& !Files.isRegularFile(translations.resolve("messages_german.properties"))) return;
80+
getComponentLogger().warn("The translations for goPaintAdvanced had major backwards incompatible changes");
81+
getComponentLogger().warn("For this reason the 'messages' files got renamed to 'gopaint'");
82+
getComponentLogger().warn("If you made changes to your translations before, you have to do them again in the new 'gopaint' files");
83+
getComponentLogger().warn("This message will go away once you have deleted the old 'messages' files from '{}'", translations);
7384
}
7485

7586
@Override

0 commit comments

Comments
 (0)