Stroomschok Posted February 23, 2025 Report Posted February 23, 2025 (edited) I'm trying to fix a few spelling errors in another mod. But I can't get to seem to get the necessary path right as the game's language files aren't formatted in the kind of array you'd usually use the 'replace' operation on (single dimensional key-value, instead of key-value inside an array), so I'm guessing that's failing my attempts. For the code example below, what would be the required path to change the value of "farewell", if that is even possible? } "greeting": "hello", "farewell": "goodbye" } Edited February 23, 2025 by Stroomschok
Brady_The Posted February 23, 2025 Report Posted February 23, 2025 (edited) 8 hours ago, Stroomschok said: use the 'replace' operation Patching language files doesn't work. But you can overwrite these values. 8 hours ago, Stroomschok said: what would be the required path to change the value of "farewell" You would need to be a bit more concrete. This pseudo-code wouldn't work. That was quite the silly statement. Obviously it wouldn't work, it's pseudo-code after all. Spoiler That'd be the pseudo-solution: { "modid:greeting": "Hello.", "modid:farewell": "Good bye!" } Take https://github.com/Nateonus/vsmodexamples/releases/download/SimpleBlockTutorial/simpleblock-complete.zip for example. That's a wiki tutorial mod. It has the following language definitions in "simpleblock(-complete.zip)/assets/simpleblock/lang/en.json". { "block-simplegoldblock": "(Example Mod) Simple Gold Block" } If you would want to overwrite this string, you'd create this "en.json" file in "[yourmodid]/assets/[yourmodid]/lang": { "simpleblock:block-simplegoldblock": "Simple Gold Block" } The mod id (simpleblock) can be found in several places, the easiest one would be in the "modinfo.json" of the respective mod. Spoiler If you aim to release the mod to the public, you can use "dependencies" to require the downloader to have simpleblock installed, because your mod wouldn't do anything on its own. { "type": "content", "modid": "simpleblocklangfix", "name": "Simple Block Language Fix", "description": "Fixes the localization strings of the Simple Block mod.", "authors": [ "Brady_The" ], "version": "0.0.1", "dependencies": { "simpleblock": "*" }, } Dependency "*" means that your mod will take any version of simpleblock, whereas ""dependencies": { "simpleblock": "1.0.0" }" would expect the 1.0.0 (or higher) version of simpleblock. Edited February 23, 2025 by Brady_The 1 1
Stroomschok Posted February 24, 2025 Author Report Posted February 24, 2025 Thanks! I understand how to approach it now
Recommended Posts