Page 1 of 1

[1.0.0] Localized string using __CONTROL__ not updated if control changed

Posted: Mon Oct 26, 2020 3:20 am
by Silari
I've got a localized string used in an entity description that includes a reference to a custom control -

Code: Select all

teleportation-teleprovider=Sends items to the beacon it's linked to. Build it then hover a mouse and press "__CONTROL__teleportation-hotkey-adjust-teleprovider__" to open adjustment menu.
What happens:
This displays normally, except if the control is changed. Then the entity continues showing the old control key, instead of the new one. This seems to remain unchanged until a map is loaded or a new one started.

What I expect to happen:
The control key is updated in the description once the control key is changed, without having to quit the map to refresh it.

There's a similar issue with using a localized string in a GUI element. There's a GUI element that has the tooltip set as:

Code: Select all

tooltip-button-main="__CONTROL__teleportation-hotkey-main-window__" - Toggle visiblity of beacon list \n"__CONTROL__teleportation-hotkey-activate-closest-beacon__" - Jump to the closest beacon
If the control is changed, the key again stays as the old string. The one difference is that if the GUI element is removed and remade, the correct key is shown in the tooltip, without needing to reload the save.


Mostly a minor thing, but I couldn't find any reports of the problem when searching so I'm making a report.

Re: [1.0.0] Localized string using __CONTROL__ not updated if control changed

Posted: Mon Oct 26, 2020 3:53 pm
by Rseding91
Thanks for the report. That's a known thing with almost all locale in the game: existing translated strings do not update when you change the language or controls.

It's not likely to change since it would mean we have to track every place a translated string has been stored in some global list and update all of them with what ever arguments they had at the time of creation whenever things like language or controls change.