Page 1 of 1

Chart tag using localised strings

Posted: Wed Oct 10, 2018 10:51 am
by DutchTed
TL;DR
Chart tag text should be a localised string

Why?
Because it would be helpful to be able to provide mod users with the ability to use localised names when creating chart tags rather than having to use the current system. An existing example would be Resource Labels by Pandemonius.

Code: Select all

--Bob's Ores
addItem ("gold-ore", "Gold", "gold-ore")
addItem ("lead-ore", "Lead", "lead-ore")
addItem ("silver-ore", "Silver", "silver-ore")
addItem ("tin-ore", "Tin", "tin-ore")
addItem ("tungsten-ore", "Tungsten", "tungsten-ore")
addItem ("zinc-ore", "Zinc", "zinc-ore")
... etc
He has to have a config file containing a number of entries as shown above so as to make a much more readable result of the data. As this data is already in game via locale files, can this functionality be provided to mod writers in the future please?

Thank you.

DutchTed

Re: Chart tag using localised strings

Posted: Thu Oct 11, 2018 10:09 am
by bobingabout
Isn't there already a system to read locale entries? Maybe it just hasn't been applied to chart tag text?

Re: Chart tag using localised strings

Posted: Fri Oct 12, 2018 8:34 am
by eradicator
+1 for optionally localized chart tags. Would definetly open some interesting modding vectors.

Re: Chart tag using localised strings

Posted: Thu Oct 24, 2019 2:07 pm
by Rseding91
Currently chart tags don't support localized strings because they are player-input. The same as train stop names. Player input is locale independent and the game treats it as such - meaning it can (and sometimes does) make gamestate decisions based off the input and treats it as deterministic.

If a mod put a localized string into the field then the game couldn't read the translation result as locale independent (because it's not) and that would have to be changed.

Not saying it couldn't be changed, but I don't consider that worth breaking everything which interacts with them.

Re: Chart tag using localised strings

Posted: Thu Jan 26, 2023 10:47 am
by Lowosos
In 1.1, there was an addition to rich text that allows showing a localized tooltip specified using a string locale key. Could this support be extended to allow for displaying the localized text inline? For example like this:

Code: Select all

[translate=item-name.iron-plate]

Re: Chart tag using localised strings

Posted: Thu Jan 26, 2023 10:54 am
by Mernom
If the whole thing is treated is one block, instead of text, if would act the same regardless of which language it's translated to. Internally, it would still be known as it's rich text alias.