Skip to content

Commit

Permalink
localization
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGoesen committed Jan 20, 2024
1 parent b0c3c26 commit a93d8ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions locale/en/caravan.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ idle=Idle

[caravan-global-gui]
caption=Caravan organizer
empty=No caravans found

[caravan-gui]
add-outpost=+ Add destination
Expand Down
21 changes: 10 additions & 11 deletions scripts/caravan/caravan-connected-gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local function guess(event)
return defines.relative_gui_type.transport_belt_gui
end
--game.print('Using fallback for ' .. name)
-- there are other types needed as well, but i am lazy
-- there are other types needed as well, but i am lazy (and who does that anyway...)
return defines.relative_gui_type.container_gui
end

Expand All @@ -24,17 +24,16 @@ local function instantiate_main_frame(gui, anchor)
direction = 'vertical',
anchor = anchor
}
else
if not gui.relative.caravan_flow then
return
end
return gui.relative.caravan_flow.add {
type = 'frame',
name = 'connected_caravan_gui',
caption = { 'caravan-global-gui.caption' },
direction = 'vertical',
}
end
if not gui.relative.caravan_flow then
return
end
return gui.relative.caravan_flow.add {
type = 'frame',
name = 'connected_caravan_gui',
caption = { 'caravan-global-gui.caption' },
direction = 'vertical',
}
end

--anchor is optional
Expand Down
4 changes: 2 additions & 2 deletions scripts/caravan/caravan-global-gui.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'caravan-gui-shared'
local Table = require('__stdlib__/stdlib/utils/table')

function add_titlebar(gui, caption, close_button_name)
local function add_titlebar(gui, caption, close_button_name)
local titlebar = gui.add{type = "flow"}
titlebar.drag_target = gui
titlebar.add{
Expand Down Expand Up @@ -60,7 +60,7 @@ Caravan.events.on_open_global_gui = function(event)
type = 'scroll-pane',
}
if not Caravan.has_any_caravan_at_all() then
scroll_pane.add{type= 'label', caption='No caravans found'}
scroll_pane.add{type= 'label', caption={'caravan-global-gui.empty'}}
return
end
local table = scroll_pane.add {
Expand Down

0 comments on commit a93d8ec

Please sign in to comment.