To reproduce:
1. Copy the below code into a mod control.lua
2. Start a new game
3. Observe that the frame in the top-left correctly shows ice-cream
4. Observe the chat message notifying that the translation request failed
Code: Select all
local string = { "?", { "item-name.ice-cream" }, "ice-cream" }
script.on_event(defines.events.on_player_created, function(e)
local player = game.get_player(e.player_index) --[[@as LuaPlayer]]
player.gui.top.add({ type = "frame", caption = string })
player.request_translation(string)
end)
script.on_event(defines.events.on_string_translated, function(e)
if not e.translated then
game.print("Translation failed: " .. serpent.line(e.localised_string))
end
end)