Chart tag using localised strings

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
DutchTed
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Jul 30, 2016 8:09 am
Contact:

Chart tag using localised strings

Post 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
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Chart tag using localised strings

Post by bobingabout »

Isn't there already a system to read locale entries? Maybe it just hasn't been applied to chart tag text?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5210
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Chart tag using localised strings

Post by eradicator »

+1 for optionally localized chart tags. Would definetly open some interesting modding vectors.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14408
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Chart tag using localised strings

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Lowosos
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Oct 21, 2018 12:09 pm
Contact:

Re: Chart tag using localised strings

Post 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]
Mernom
Fast Inserter
Fast Inserter
Posts: 123
Joined: Sun Jul 15, 2018 10:05 pm
Contact:

Re: Chart tag using localised strings

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

Return to “Modding interface requests”