Page 1 of 1
Is it possible to have localized screenshots in the tips and tricks section?
Posted: Tue Jan 07, 2025 1:54 am
by dodther
Can you tell me if there is a mechanism for substituting localized screenshots depending on the locale in the tips and hints section?
Re: Is it possible to have localized screenshots in the tips and tricks section?
Posted: Tue Jan 07, 2025 5:35 am
by IsaacOscar
What? I didn't know you could have screenshots in tips and tricks.
They're supposed to be simulations (Bassically a mini factorio game that runs, and so should use whatever local happens to be active).
If all you want is some text to be different for different languages that should be easy with custom locale ksys.
Re: Is it possible to have localized screenshots in the tips and tricks section?
Posted: Tue Jan 07, 2025 10:41 am
by dodther
In addition to the simulation, there are just .png images. Of course, the text is translated without any issues. But the image remains in English. So I'm wondering if it's possible to replace the image depending on the locale.
Re: Is it possible to have localized screenshots in the tips and tricks section?
Posted: Tue Jan 07, 2025 10:49 am
by IsaacOscar
dodther wrote: Tue Jan 07, 2025 10:41 am
In addition to the simulation, there are just .png images. Of course, the text is translated without any issues. But the image remains in English. So I'm wondering if it's possible to replace the image depending on the locale.
You mean the icon?
https://lua-api.factorio.com/latest/pro ... html#icons
Or are you using a different field?
I'm pretty sure icon's cannot be localised. You can make a modding interface request for that, but I doubt Wube will do it (as it would be a lot of work, and icons probably shouldn't have text on them anyway, as they're very small).
Re: Is it possible to have localized screenshots in the tips and tricks section?
Posted: Tue Jan 07, 2025 12:08 pm
by dodther

- 2025-01-07_20-48-54.png (245.14 KiB) Viewed 559 times
Re: Is it possible to have localized screenshots in the tips and tricks section?
Posted: Tue Jan 07, 2025 12:23 pm
by IsaacOscar
dodther wrote: Tue Jan 07, 2025 12:08 pm
2025-01-07_20-48-54.png
You should not be using a screenshot for that.
I assume this GUI exists in factorio already?
You should be creating the GUI at runtime:
Code: Select all
data:extend{{
type = "tips-and-tricks-item",
simulation = {
...
init = [[
player = game.simulation.create_test_player{name = "Some Name"}
local frame = player.gui.screen.add{type = "frame", caption = {"locale.key"}}
.... ]]
See
https://lua-api.factorio.com/latest/classes/LuaGui.html and
https://lua-api.factorio.com/latest/cla ... ement.html
Look at the in game tips and tricks for examples of stuff you can do! (E.g., the first one in this file creates a nice little table
https://github.com/wube/factorio-data/b ... ations.lua).