From e6bbd155dacdc95de901872441d31d71b44d900e Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sun, 30 Aug 2026 09:40:27 -0700 Subject: [PATCH] Stop hardcoding some translations (#2049) --- .../com/gtnewhorizons/angelica/zoom/Zoom.java | 2 +- .../java/jss/notfine/config/NotFineConfig.java | 14 ++------------ .../jss/notfine/gui/NotFineGameOptionPages.java | 15 --------------- src/main/java/jss/notfine/proxy/ClientProxy.java | 6 ------ .../gui/ReeseSodiumVideoOptionsScreen.java | 6 +++--- .../components/SearchTextFieldComponent.java | 6 +----- .../sodium/client/gui/SodiumGameOptionPages.java | 12 ++++++++---- src/main/java/net/coderbot/iris/Iris.java | 12 ++++++------ .../resources/assets/angelica/lang/en_US.lang | 16 +++++++++++++++- .../resources/assets/notfine/lang/en_US.lang | 1 + 10 files changed, 37 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/gtnewhorizons/angelica/zoom/Zoom.java b/src/main/java/com/gtnewhorizons/angelica/zoom/Zoom.java index 431f5342c..af5ac1706 100644 --- a/src/main/java/com/gtnewhorizons/angelica/zoom/Zoom.java +++ b/src/main/java/com/gtnewhorizons/angelica/zoom/Zoom.java @@ -29,7 +29,7 @@ public class Zoom { private static long zoomLerpLastNano = 0L; @Getter - private static final KeyBinding zoomKey = new KeyBinding("Zoom", 0, "key.categories.misc"); + private static final KeyBinding zoomKey = new KeyBinding("angelica.keybind.zoom", 0, "key.categories.misc"); private static boolean zoomEnabled = false; diff --git a/src/main/java/jss/notfine/config/NotFineConfig.java b/src/main/java/jss/notfine/config/NotFineConfig.java index 30d17cc57..f92b70d2a 100644 --- a/src/main/java/jss/notfine/config/NotFineConfig.java +++ b/src/main/java/jss/notfine/config/NotFineConfig.java @@ -12,9 +12,7 @@ public class NotFineConfig { private static final String CATEGORY_TOGGLE = "toggle"; private static final String CATEGORY_UNFINISHED = "unfinished"; - public static boolean allowAdvancedOpenGL; public static boolean allowToggle3DAnaglyph; - public static boolean allowToggleFBO; public static boolean betterBlockFaceCulling; public static boolean renderPass; @@ -23,12 +21,7 @@ public class NotFineConfig { File configFile = new File(Launch.minecraftHome + File.separator + "config" + File.separator + NotFine.MODID + File.separator + "notfine.cfg"); Configuration config = new Configuration(configFile); - allowAdvancedOpenGL = config.getBoolean("allowAdvancedOpenGL", CATEGORY_GENERAL, false, - "Allow Advanced OpenGL to be enabled when it might be supported."); - allowToggle3DAnaglyph = config.getBoolean("allowToggle3DAnaglyph", CATEGORY_GENERAL, true, - "Allow 3D Anaglyph to be enabled."); - allowToggleFBO = config.getBoolean("allowToggleFBO", CATEGORY_GENERAL, false, - "Allow FBOs to be disabled."); + allowToggle3DAnaglyph = config.getBoolean("allowToggle3DAnaglyph", CATEGORY_GENERAL, true, "Allow 3D Anaglyph to be enabled."); config.setCategoryComment(CATEGORY_TOGGLE, "Toggle mod features."); betterBlockFaceCulling = config.getBoolean("betterBlockFaceCulling", CATEGORY_TOGGLE, true, @@ -43,10 +36,7 @@ public class NotFineConfig { config.save(); } - //These will probably break hard with Angelica. - //AdvancedOpenGL even breaks hard on its own. - allowAdvancedOpenGL = false; - allowToggleFBO = false; + //This will probably break hard with Angelica. renderPass = false; } diff --git a/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java b/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java index d9d5f5469..4546840b3 100644 --- a/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java +++ b/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java @@ -243,21 +243,6 @@ public class NotFineGameOptionPages { List groups = new ArrayList<>(); groups.add(OptionGroup.createBuilder() - .add(OptionImpl.createBuilder(boolean.class, vanillaOpts) - .setName(I18n.format("options.advancedOpengl")) - .setTooltip(I18n.format("sodium.options.advanced_opengl.tooltip")) - .setControl(TickBoxControl::new) - .setBinding((opts, value) -> opts.advancedOpengl = value, opts -> opts.advancedOpengl) - .setImpact(OptionImpact.VARIES) - .setEnabled(NotFineConfig.allowAdvancedOpenGL) - .build()) - .add(OptionImpl.createBuilder(boolean.class, vanillaOpts) - .setName(I18n.format("options.fboEnable")) - .setTooltip(I18n.format("sodium.options.fbo.tooltip")) - .setControl(TickBoxControl::new) - .setBinding((opts, value) -> opts.fboEnable = value, opts -> opts.fboEnable) - .setEnabled(NotFineConfig.allowToggleFBO) - .build()) .add(OptionImpl.createBuilder(boolean.class, vanillaOpts) .setName(I18n.format("options.anaglyph")) .setTooltip(I18n.format("sodium.options.anaglyph.tooltip")) diff --git a/src/main/java/jss/notfine/proxy/ClientProxy.java b/src/main/java/jss/notfine/proxy/ClientProxy.java index 354b766a1..3f2b58874 100644 --- a/src/main/java/jss/notfine/proxy/ClientProxy.java +++ b/src/main/java/jss/notfine/proxy/ClientProxy.java @@ -18,15 +18,9 @@ public class ClientProxy extends CommonProxy { FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); - if(!NotFineConfig.allowAdvancedOpenGL) { - Minecraft.getMinecraft().gameSettings.advancedOpengl = false; - } if(!NotFineConfig.allowToggle3DAnaglyph) { Minecraft.getMinecraft().gameSettings.anaglyph = false; } - if(!NotFineConfig.allowToggleFBO) { - Minecraft.getMinecraft().gameSettings.fboEnable = true; - } for(Settings setting : Settings.values()) { setting.ready(); diff --git a/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/ReeseSodiumVideoOptionsScreen.java b/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/ReeseSodiumVideoOptionsScreen.java index a61b87ca1..4e0c19f95 100644 --- a/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/ReeseSodiumVideoOptionsScreen.java +++ b/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/ReeseSodiumVideoOptionsScreen.java @@ -105,9 +105,9 @@ public class ReeseSodiumVideoOptionsScreen extends SodiumOptionsGUI { final Dim2i applyButtonDim = new Dim2i(tabFrameDim.getLimitX() - 134, tabFrameDim.getLimitY() + 5, 65, 20); final Dim2i closeButtonDim = new Dim2i(tabFrameDim.getLimitX() - 65, tabFrameDim.getLimitY() + 5, 65, 20); - this.undoButton = new FlatButtonWidget(undoButtonDim, "Undo", this::undoChanges); - this.applyButton = new FlatButtonWidget(applyButtonDim, "Apply", this::applyChanges); - this.closeButton = new FlatButtonWidget(closeButtonDim, "Close", this::onClose); + this.undoButton = new FlatButtonWidget(undoButtonDim, I18n.format("sodium.options.buttons.undo"), this::undoChanges); + this.applyButton = new FlatButtonWidget(applyButtonDim, I18n.format("sodium.options.buttons.apply"), this::applyChanges); + this.closeButton = new FlatButtonWidget(closeButtonDim, I18n.format("gui.done"), this::onClose); // Pre-compute button text and widths to avoid duplicate calculations final String irisText = Iris.enabled ? I18n.format(IrisApi.getInstance().getMainScreenLanguageKey()) : null; diff --git a/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/frame/components/SearchTextFieldComponent.java b/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/frame/components/SearchTextFieldComponent.java index ff72ee0d5..2da5bd072 100644 --- a/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/frame/components/SearchTextFieldComponent.java +++ b/src/main/java/me/flashyreese/mods/reeses_sodium_options/client/gui/frame/components/SearchTextFieldComponent.java @@ -93,11 +93,7 @@ public class SearchTextFieldComponent extends AbstractWidget { return; } if (!this.isFocused() && this.text.isEmpty()) { - final String key = "rso.search_bar_empty"; - String text = I18n.format(key); - if (text.equals(key)) - text = "Search options..."; - this.textRenderer.drawString(text, this.dim.getOriginX() + 6, this.dim.getOriginY() + 6, 0xFFAAAAAA); + this.textRenderer.drawString(I18n.format("rso.search_bar_empty"), this.dim.getOriginX() + 6, this.dim.getOriginY() + 6, 0xFFAAAAAA); } drawRect(this.dim.getOriginX(), this.dim.getOriginY(), this.dim.getLimitX(), this.dim.getLimitY(), this.isFocused() ? 0xE0000000 : 0x90000000); diff --git a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java index 73dad21ef..2a2e84799 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java @@ -303,9 +303,10 @@ public class SodiumGameOptionPages { .add(OptionImpl.createBuilder(StreamingUploader.UploadStrategy.class, sodiumOpts) .setName(I18n.format("sodium.options.upload_method.name")) .setTooltip(I18n.format("sodium.options.upload_method.tooltip")) - .setControl(o -> - new CyclingControl<>(o, StreamingUploader.UploadStrategy.class, StreamingUploader.UploadStrategy.values()) - ) + .setControl(o -> new CyclingControl<>(o, StreamingUploader.UploadStrategy.class, new String[]{ + I18n.format("sodium.options.upload_method.buffer_data"), + I18n.format("sodium.options.upload_method.buffer_subdata"), + I18n.format("sodium.options.upload_method.map_buffer") })) .setBinding((opts, value) -> opts.advanced.streamingUploadStrategy = value, opts -> opts.advanced.streamingUploadStrategy) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD) .setImpact(OptionImpact.VARIES) @@ -409,7 +410,10 @@ public class SodiumGameOptionPages { .add(OptionImpl.createBuilder(AsyncOcclusionMode.class, sodiumOpts) .setName(I18n.format("sodium.options.async_occlusion_mode.name")) .setTooltip(I18n.format("sodium.options.async_occlusion_mode.tooltip")) - .setControl(o -> new CyclingControl<>(o, AsyncOcclusionMode.class, new String[]{"None", "Only Shadow", "Everything"})) + .setControl(o -> new CyclingControl<>(o, AsyncOcclusionMode.class, new String[]{ + I18n.format("sodium.options.async_occlusion_mode.none"), + I18n.format("sodium.options.async_occlusion_mode.only_shadow"), + I18n.format("sodium.options.async_occlusion_mode.everything") })) .setImpact(OptionImpact.MEDIUM) .setBinding((opts, value) -> opts.performance.asyncOcclusionMode = value, opts -> opts.performance.asyncOcclusionMode) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD) diff --git a/src/main/java/net/coderbot/iris/Iris.java b/src/main/java/net/coderbot/iris/Iris.java index 70e8be86f..c791d7c04 100644 --- a/src/main/java/net/coderbot/iris/Iris.java +++ b/src/main/java/net/coderbot/iris/Iris.java @@ -343,11 +343,11 @@ public class Iris { final Minecraft mc = Minecraft.getMinecraft(); try { reload(); - if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText("Shaders Reloaded!")); + if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(I18n.format("iris.shaders.reloaded"))); } catch (Exception e) { logger.error("Error while reloading Shaders for Iris!", e); - if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText( "Failed tgo reload shaders! Reason: " + Throwables.getRootCause(e).getMessage())); + if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(I18n.format("iris.shaders.reloaded.failure", Throwables.getRootCause(e).getMessage()))); } } else if (toggleShadersKeybind.isPressed()) { final Minecraft mc = Minecraft.getMinecraft(); @@ -356,7 +356,7 @@ public class Iris { } catch (Exception e) { logger.error("Error while toggling shaders!", e); - if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText( "Failed tgo toggle shaders! Reason: " + Throwables.getRootCause(e).getMessage())); + if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(I18n.format("iris.shaders.toggled.failure", Throwables.getRootCause(e).getMessage()))); setShadersDisabled(); fallback = true; } @@ -974,9 +974,9 @@ public class Iris { public void fmlInitEvent() { IRIS_VERSION = Tags.VERSION; - reloadKeybind = new KeyBinding("Reload Shaders", 0, "Iris Keybinds"); - toggleShadersKeybind = new KeyBinding("Toggle Shaders", 0, "Iris Keybinds"); - shaderpackScreenKeybind = new KeyBinding("Shaderpack Selection Screen", 0, "Iris Keybinds"); + reloadKeybind = new KeyBinding("iris.keybind.reload", 0, "key.category.iris.keybinds"); + toggleShadersKeybind = new KeyBinding("iris.keybind.toggleShaders", 0, "key.category.iris.keybinds"); + shaderpackScreenKeybind = new KeyBinding("iris.keybind.shaderPackSelection", 0, "key.category.iris.keybinds"); ClientRegistry.registerKeyBinding(reloadKeybind); ClientRegistry.registerKeyBinding(toggleShadersKeybind); diff --git a/src/main/resources/assets/angelica/lang/en_US.lang b/src/main/resources/assets/angelica/lang/en_US.lang index 004f61055..eeb2dbd76 100644 --- a/src/main/resources/assets/angelica/lang/en_US.lang +++ b/src/main/resources/assets/angelica/lang/en_US.lang @@ -101,13 +101,18 @@ sodium.options.use_no_error_context.name=No Error Context sodium.options.use_no_error_context.tooltip=If enabled, the OpenGL context will be created with error checking disabled. This may slightly improve performance, but it also increases the risk that the game will crash instead of gracefully handling OpenGL errors. You should disable this option if you are experiencing sudden unexplained crashes. sodium.options.async_occlusion_mode.name=Async Occlusion sodium.options.async_occlusion_mode.tooltip=Controls which render passes use asynchronous occlusion culling. ONLY_SHADOW (default) runs async occlusion only for the shadow pass, keeping the main render list synchronous. EVERYTHING runs all passes async, which may cause 1-frame visibility lag during fast camera movement. NONE disables async occlusion entirely. +sodium.options.async_occlusion_mode.none=None +sodium.options.async_occlusion_mode.only_shadow=Only Shadow +sodium.options.async_occlusion_mode.everything=Everything sodium.options.use_occlusion_culling.name=Occlusion Culling sodium.options.use_occlusion_culling.tooltip=If enabled, chunks that are hidden behind other chunks will not be rendered. Disabling this will significantly reduce performance but can be useful for debugging. sodium.options.threads.value=%s thread(s) sodium.options.default=Default sodium.options.buttons.undo=Undo sodium.options.buttons.apply=Apply -sodium.options.buttons.donate=Buy coffee for JellySquid! +sodium.options.anaglyph.tooltip=If enabled, the world will be rendered twice with red/cyan color masks. +sodium.options.show_cape.tooltip=If enabled, your cape will be shown. +rso.search_bar_empty=Search options... options.dynamic_fov=Dynamic FOV options.dynamic_fov.tooltip=If enabled, the game's field of view will change based on the player's speed. @@ -115,6 +120,15 @@ options.framerate=%s FPS iris.shaders.toggled=Toggled shaders to %s! iris.shaders.disabled=Shaders disabled! +iris.shaders.reloaded=Shaders Reloaded! +iris.shaders.reloaded.failure=Failed to reload shaders! Reason: %s +iris.shaders.toggled.failure=Failed to toggle shaders! Reason: %s + +key.category.iris.keybinds=Iris Keybinds +iris.keybind.reload=Reload Shaders +iris.keybind.toggleShaders=Toggle Shaders +iris.keybind.shaderPackSelection=Shaderpack Selection Screen +angelica.keybind.zoom=Zoom options.iris.apply=Apply options.iris.refresh=Refresh diff --git a/src/main/resources/assets/notfine/lang/en_US.lang b/src/main/resources/assets/notfine/lang/en_US.lang index dee834f1b..3504efa56 100644 --- a/src/main/resources/assets/notfine/lang/en_US.lang +++ b/src/main/resources/assets/notfine/lang/en_US.lang @@ -77,6 +77,7 @@ options.total_stars.tooltip=Star Density options.void_fog=Void Fog options.void_fog.tooltip=Void Fog options.hurt_shake=Hurt Screen Shake +options.hurt_shake.tooltip=How strongly the camera tilts when you take damage. options.background.random=Random options.zoom_smooth=Smooth Zoom options.zoom_smooth.tooltip=Smoothly interpolates the camera toward the zoom level instead of snapping instantly.