Localization for error()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
micromario
Fast Inserter
Fast Inserter
Posts: 114
Joined: Thu Apr 05, 2018 11:53 am
Contact:

Localization for error()

Post 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()
Rseding91
Factorio Staff
Factorio Staff
Posts: 14591
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Localization for error()

Post 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
If you want to get ahold of me I'm almost always on Discord.
User avatar
micromario
Fast Inserter
Fast Inserter
Posts: 114
Joined: Thu Apr 05, 2018 11:53 am
Contact:

Re: Localization for error()

Post 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
justarandomgeek
Filter Inserter
Filter Inserter
Posts: 302
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: Localization for error()

Post 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!
Post Reply

Return to “Modding interface requests”