Localized values for string type setting

Place to get help with not working mods / modding interface.
User avatar
Arcitos
Inserter
Inserter
Posts: 38
Joined: Sat Dec 03, 2016 1:50 pm
Contact:

Localized values for string type setting

Post by Arcitos »

Hello everyone,

does anybody know how i get localized strings to work as values for a string type setting? I want to display an array of allowed values, wich works fine, as long as those values are just "hardcoded" strings:

Code: Select all

allowed_values = {"Asphalt > Concrete > Stone", "Asphalt > Stone > Concrete", "Concrete > Asphalt > Stone", "Concrete > Stone > Asphalt", "Stone > Asphalt > Concrete", "Stone > Concrete > Asphalt" },
But i want those setting values to be localized as well, however, everytime i try to hand over a "localised_string" type, an error is thrown. Is it possible to do something like this:

Code: Select all

allowed_values = {{"pda-setting-score-1"},{"pda-setting-score-2"},{"pda-setting-score-3"},{"pda-setting-score-4"},{"pda-setting-score-5"},{"pda-setting-score-6"}},
Is this possible at all?

Greetings, Arcitos
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Localized values for string type setting

Post by DaveMcW »

What happens if you just pass the key string?

Code: Select all

allowed_values = {"pda-setting-score-1","pda-setting-score-2","pda-setting-score-3","pda-setting-score-4","pda-setting-score-5","pda-setting-score-6"},
User avatar
Arcitos
Inserter
Inserter
Posts: 38
Joined: Sat Dec 03, 2016 1:50 pm
Contact:

Re: Localized values for string type setting

Post by Arcitos »

DaveMcW wrote:What happens if you just pass the key string?

Code: Select all

allowed_values = {"pda-setting-score-1","pda-setting-score-2","pda-setting-score-3","pda-setting-score-4","pda-setting-score-5","pda-setting-score-6"},
The keys will be interpreted as strings, wich in turn results in displaying them as the setting selection options:
Image
Post Reply

Return to “Modding help”