diff --git a/src/main/java/me/cortex/voxy/client/ClientImportManager.java b/src/main/java/me/cortex/voxy/client/ClientImportManager.java index 22b3606f3..907511564 100644 --- a/src/main/java/me/cortex/voxy/client/ClientImportManager.java +++ b/src/main/java/me/cortex/voxy/client/ClientImportManager.java @@ -18,7 +18,7 @@ protected ClientImportTask(IDataImporter importer) { super(importer); this.bossbarUUID = UUID.randomUUID(); - this.bossBar = new LerpingBossEvent(this.bossbarUUID, Component.nullToEmpty("Voxy world importer"), 0.0f, BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS, false, false, false); + this.bossBar = new LerpingBossEvent(this.bossbarUUID, Component.translatable("voxy.command.import.bossbarTitle"), 0.0f, BossEvent.BossBarColor.GREEN, BossEvent.BossBarOverlay.PROGRESS, false, false, false); Minecraft.getInstance().execute(()->{ Minecraft.getInstance().gui.hud.getBossOverlay().events.put(bossBar.getId(), bossBar); }); @@ -31,7 +31,7 @@ protected boolean onUpdate(int completed, int outOf) { } Minecraft.getInstance().execute(()->{ this.bossBar.setProgress((float) (((double)completed) / ((double) Math.max(1, outOf)))); - this.bossBar.setName(Component.nullToEmpty("Voxy import: " + completed + "/" + outOf + " chunks")); + this.bossBar.setName(Component.translatable("voxy.command.import.progress", completed, outOf)); }); return true; } @@ -44,7 +44,7 @@ protected void onCompleted(int total) { long delta = Math.max(System.currentTimeMillis() - this.startTime, 1); String msg = "Voxy world import finished in " + (delta/1000) + " seconds, averaging " + (int)(total/(delta/1000f)) + " chunks per second"; - Minecraft.getInstance().gui.hud.getChat().addClientSystemMessage(Component.literal(msg)); + Minecraft.getInstance().gui.hud.getChat().addClientSystemMessage(Component.translatable("voxy.command.import.finished", delta/1000, (int)(total/(delta/1000f)))); Logger.info(msg); }); } diff --git a/src/main/java/me/cortex/voxy/client/VoxyCommands.java b/src/main/java/me/cortex/voxy/client/VoxyCommands.java index a902a5784..baef8254d 100644 --- a/src/main/java/me/cortex/voxy/client/VoxyCommands.java +++ b/src/main/java/me/cortex/voxy/client/VoxyCommands.java @@ -77,7 +77,7 @@ public static LiteralArgumentBuilder register() { private static int reloadInstance(CommandContext ctx) { var instance = (VoxyClientInstance)VoxyCommon.getInstance(); if (instance == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } @@ -98,7 +98,7 @@ private static int reloadInstance(CommandContext ctx) private static int verifyTLNs(CommandContext ctx, boolean attemptRepair) { var instance = VoxyCommon.getInstance(); if (instance == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } if (Minecraft.getInstance().level == null) { @@ -116,7 +116,7 @@ private static int verifyTLNs(CommandContext ctx, boo private static int importDistantHorizons(CommandContext ctx) { var instance = (VoxyClientInstance)VoxyCommon.getInstance(); if (instance == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } var dbFile = new File(ctx.getArgument("sqlDbPath", String.class)); @@ -154,7 +154,7 @@ private static boolean fileBasedImporter(File directory) { private static int importRaw(CommandContext ctx) { if (VoxyCommon.getInstance() == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } @@ -163,7 +163,7 @@ private static int importRaw(CommandContext ctx) { private static int importBobby(CommandContext ctx) { if (VoxyCommon.getInstance() == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } @@ -223,18 +223,18 @@ private static CompletableFuture fileDirectorySuggester(Path dir, S private static int importCurrentWorldIn(CommandContext ctx) { if (VoxyCommon.getInstance() == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } var localServer = Minecraft.getInstance().getSingleplayerServer(); if (localServer == null) { - ctx.getSource().sendError(Component.translatable("You must be in single player to use this command")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.singlePlayerOnly")); return 1; } var regionPath = DimensionType.getStorageFolder(Minecraft.getInstance().level.dimension(), localServer.getWorldPath(LevelResource.ROOT)).resolve("region"); if ((!regionPath.toFile().exists())||!regionPath.toFile().isDirectory()) { - ctx.getSource().sendError(Component.translatable("Cannot find region folder for current dimension")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.noRegionFolder")); return 1; } return fileBasedImporter(regionPath.toFile())?0:1; @@ -242,7 +242,7 @@ private static int importCurrentWorldIn(CommandContext ctx) { if (VoxyCommon.getInstance() == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } @@ -288,7 +288,7 @@ private static int importZip(CommandContext ctx) { var instance = (VoxyClientInstance)VoxyCommon.getInstance(); if (instance == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } String finalInnerDir = innerDir; @@ -307,7 +307,7 @@ private static int importZip(CommandContext ctx) { private static int cancelImport(CommandContext ctx) { var instance = (VoxyClientInstance)VoxyCommon.getInstance(); if (instance == null) { - ctx.getSource().sendError(Component.translatable("Voxy must be enabled in settings to use this")); + ctx.getSource().sendError(Component.translatable("voxy.command.error.voxyDisabled")); return 1; } var world = WorldIdentifier.ofEngineNullable(Minecraft.getInstance().level); diff --git a/src/main/java/me/cortex/voxy/client/config/VoxyConfigMenu.java b/src/main/java/me/cortex/voxy/client/config/VoxyConfigMenu.java index fc0a4a722..0eb2cb50c 100644 --- a/src/main/java/me/cortex/voxy/client/config/VoxyConfigMenu.java +++ b/src/main/java/me/cortex/voxy/client/config/VoxyConfigMenu.java @@ -128,6 +128,7 @@ public void registerConfigLate(ConfigBuilder B) { SSAO.SSAOMode.class, Component.translatable("voxy.config.general.ssao_mode"), ()->CFG.getSSAOMode(), v->CFG.setSSAOMode(v)) + .setNameProvider(value -> Component.translatable("voxy.config.general.ssao_mode." + value.name().toLowerCase())) .setImpact(OptionImpact.MEDIUM)//TODO make it on igpus this is high .setPostChangeFlags(RENDER_RELOAD) ).setEnablerInherit(s->!IrisUtil.irisShadersEnabledInConfig(), ConfigState.UPDATE_ON_REBUILD) diff --git a/src/main/resources/assets/voxy/lang/en_us.json b/src/main/resources/assets/voxy/lang/en_us.json index cd1c8d146..a10d97c8c 100644 --- a/src/main/resources/assets/voxy/lang/en_us.json +++ b/src/main/resources/assets/voxy/lang/en_us.json @@ -32,5 +32,18 @@ "voxy.config.general.render_fog.tooltip": "Enables or disables render fog effect", "voxy.config.general.ssao_mode": "SSAO Mode", - "voxy.config.general.ssao_mode.tooltip": "The mode used for screenspace ambient occlusion (Auto attempts to pick the best option while reducing performance impact)" + "voxy.config.general.ssao_mode.tooltip": "The mode used for screenspace ambient occlusion (Auto attempts to pick the best option while reducing performance impact)", + + "voxy.config.general.ssao_mode.auto": "Auto", + "voxy.config.general.ssao_mode.basic": "Basic", + "voxy.config.general.ssao_mode.better": "Better", + "voxy.config.general.ssao_mode.best": "Best", + + "voxy.command.error.voxyDisabled": "Voxy must be enabled in settings to use this", + "voxy.command.error.singlePlayerOnly": "You must be in single player to use this command", + "voxy.command.error.noRegionFolder": "Cannot find region folder for current dimension", + + "voxy.command.import.bossbarTitle": "Voxy world importer", + "voxy.command.import.progress": "Voxy import: %d/%d chunks", + "voxy.command.import.finished": "Voxy world import finished in %d seconds, averaging %d chunks per second" } \ No newline at end of file diff --git a/src/main/resources/assets/voxy/lang/zh_cn.json b/src/main/resources/assets/voxy/lang/zh_cn.json new file mode 100644 index 000000000..4e9dc951b --- /dev/null +++ b/src/main/resources/assets/voxy/lang/zh_cn.json @@ -0,0 +1,49 @@ +{ + "voxy.config.title": "Voxy", + + "voxy.config.general": "通用", + "voxy.config.rendering": "渲染", + + "voxy.config.general.enabled": "启用 Voxy", + "voxy.config.general.enabled.tooltip": "完全启用或禁用 Voxy", + + "voxy.config.general.serviceThreads": "服务线程数", + "voxy.config.general.serviceThreads.tooltip": "ServiceThreadPool 可使用的线程数量", + + "voxy.config.general.useSodiumBuilder": "使用 Sodium 线程", + "voxy.config.general.useSodiumBuilder.tooltip": "使用 Sodium 的构建线程作为 Voxy 线程池的一部分,在高渲染距离下快速移动时可减少卡顿和延迟", + + "voxy.config.general.ingest": "区块摄入", + "voxy.config.general.ingest.tooltip": "启用或禁用 Voxy 将新区块转换为 LOD 的功能", + + "voxy.config.general.rendering": "Voxy 渲染", + "voxy.config.general.rendering.tooltip": "启用或禁用 Voxy 渲染", + + "voxy.config.general.subDivisionSize": "细分大小(像素²)", + "voxy.config.general.subDivisionSize.tooltip": "细分到更小 LOD 前,屏幕空间 AABB 的最大像素大小(越小质量越高)", + + "voxy.config.general.renderDistance": "渲染距离", + "voxy.config.general.renderDistance.tooltip": "Voxy 的渲染距离(以区块为单位)", + + "voxy.config.general.environmental_fog": "启用环境雾", + "voxy.config.general.environmental_fog.tooltip": "启用或禁用 Voxy 渲染环境雾效果", + + "voxy.config.general.render_fog": "启用渲染雾", + "voxy.config.general.render_fog.tooltip": "启用或禁用渲染雾效果", + + "voxy.config.general.ssao_mode": "SSAO 模式", + "voxy.config.general.ssao_mode.tooltip": "屏幕空间环境光遮蔽的模式(自动模式会尝试选择最佳选项并减少性能影响)", + + "voxy.config.general.ssao_mode.auto": "自动", + "voxy.config.general.ssao_mode.basic": "基础", + "voxy.config.general.ssao_mode.better": "较好", + "voxy.config.general.ssao_mode.best": "最佳", + + "voxy.command.error.voxyDisabled": "Voxy 必须在设置中启用才能使用此命令", + "voxy.command.error.singlePlayerOnly": "你必须在单人游戏中才能使用此命令", + "voxy.command.error.noRegionFolder": "找不到当前维度的区域文件夹", + + "voxy.command.import.bossbarTitle": "Voxy 世界导入器", + "voxy.command.import.progress": "Voxy 导入中:%d/%d 个区块", + "voxy.command.import.finished": "Voxy 世界导入完成,耗时 %d 秒,平均每秒处理 %d 个区块" +}