Page 1 of 1

Localization for error()

Posted: Thu Jul 09, 2020 6:37 pm
by micromario
Some mods use error() as a way to tell the player that they installed the mod incorrectly

example:
Image

The issue is that there is no way to localize this string, which would make these mods impossible to install in other languages

I suggest either adding localization support for error() directly or adding a separate function called localized_error()

Re: Localization for error()

Posted: Sun Jul 19, 2020 4:23 pm
by Rseding91
Why not just ignore what the user settings are and use defaults if they're wrong?

Actually, why do the settings even allow invalid values? You can define the valid range of a setting to just *not allow* being the wrong thing and it will never be the wrong thing.

This seems suspiciously like an XY problem: https://en.wikipedia.org/wiki/XY_problem

Re: Localization for error()

Posted: Sun Jul 19, 2020 4:45 pm
by micromario
this is a modpack not a mod which means I have to set settings for other mods

for example one of the mods I use in the pack is called amator's coal and steam which has a setting to enable mod compatibility with angels

the setting is off by default but I need the user to enable it or else my custom recipes will not load correctly

Image

edit: I think I know what you mean. I could just restrict the valid values
this still wouldn't work for booleans since there is no allowed_values property

Re: Localization for error()

Posted: Sat Aug 01, 2020 2:07 pm
by justarandomgeek
error(LocalisedString) already works as far as i know, it was a part of my old hack for translating things in the debugger before localised_print!

Edit: just tested, apparently it's only translated in control, wonder how i never noticed that!