Create Config Button disappears when switching language
getItemFromBlock opened this issue ยท 4 comments
Describe the Bug
When switching language in the game (for example, form French to English) the Create config button will disappear on the main menu and the in-game menu
The button will only reappear either if you restart the game, or if the language is set back to what the game started with
Reproduction Steps
- Launch the game
- Change the language to another language (like French or Spanish)
- Go back to the main menu or the in-game pause menu
Expected Result
The button should stay when switching language
Screenshots and Videos
On startup
After switching to french
Crash Report or Log
No response
Operating System
Windows 11
Mod Version
0.5.0i
Minecraft Version
1.18.2, 1.19, 1.20
Forge Version
40.2.9
Other Mods
No response
Additional Context
I discovered this Issue while implementing my own config button (seen on the right)
The problem is caused by the way the button adds itself to the current menu
Here you can see that the reference strings are initialized in a static way when the game starts
As the translated button names are used, this makes that the reference strings are no longer valid when compared to the actual content of the menu.
A potential fix would be to do like I did to avoid this problem here
This might not be the most optimal way to do it, but it does the job
From what I see of the code, this should affect all versions of the mod that has the config button feature