Quick Action Locale (#518)

* quick action locale

* remove marking

* new ln
This commit is contained in:
phidias authored and GitHub committed 2026-11-07 15:18:47 +00:00
1 parent 2cca280e30
commit 637e47bf8c
4 files changed
+105 -58

No files matched your search

+71 -24
View File
@@ -24,22 +24,16 @@ local Elements = {}
local Actions = {}
--- @param command ExpCommand | function (this is needed because of the overload on commands)
--- @param locale table<string, string>
--- @param on_click? ExpElement.EventHandler<EventData.on_gui_click>
local function new_quick_action(command, on_click)
local function new_quick_action(command, locale, on_click)
local command_name = command.name
local element = Gui.define("quick_actions/" .. command_name)
:draw{
type = "button",
caption = { "?",
{ "exp-gui_quick-actions.caption-" .. command_name },
command_name,
},
tooltip = { "?",
{ "exp-gui_quick-actions.tooltip-" .. command_name },
command.description,
""
},
caption = { locale.caption },
tooltip = { locale.tooltip },
}
:style{
width = 160,
@@ -55,24 +49,77 @@ local function new_quick_action(command, on_click)
}
end
new_quick_action(addon_artillery.commands.artillery)
new_quick_action(addon_trains.commands.set_trains_to_automatic)
new_quick_action(addon_artillery.commands.artillery, {
caption = "exp-commands_artillery.selection-name",
tooltip = "exp-commands_artillery.description"
})
new_quick_action(addon_teleport.commands.spawn, function(def, player, element, event)
new_quick_action(addon_trains.commands.set_trains_to_automatic, {
caption = "exp-commands_trains.caption",
tooltip = "exp-commands_trains.description"
})
new_quick_action(addon_teleport.commands.spawn, {
caption = "exp-commands_teleport.description-spawn",
tooltip = "exp-commands_teleport.description-spawn"
}, function(def, player, element, event)
addon_teleport.commands.spawn(player, player)
end)
new_quick_action(addon_waterfill.commands.waterfill)
new_quick_action(addon_lawnmower.commands.lawnmower)
new_quick_action(addon_surface.commands.clear_ground_items)
new_quick_action(addon_surface.commands.clear_blueprints_surface)
new_quick_action(addon_surface.commands.clear_blueprints)
new_quick_action(addon_home.commands.home)
new_quick_action(addon_home.commands.home_return)
new_quick_action(addon_home.commands.set_home)
new_quick_action(addon_home.commands.get_home)
new_quick_action(addon_vlayer.commands.vlayer)
new_quick_action(addon_repair.commands.repair)
new_quick_action(addon_waterfill.commands.waterfill, {
caption = "exp-commands_waterfill.selection-name",
tooltip = "exp-commands_waterfill.description"
})
new_quick_action(addon_lawnmower.commands.lawnmower, {
caption = "exp-commands_lawnmower.selection-name",
tooltip = "exp-commands_lawnmower.description"
})
new_quick_action(addon_surface.commands.clear_ground_items, {
caption = "exp-commands_surface.caption-items",
tooltip = "exp-commands_surface.description-items"
})
new_quick_action(addon_surface.commands.clear_blueprints_surface, {
caption = "exp-commands_surface.caption-blueprints-surface",
tooltip = "exp-commands_surface.description-blueprints-surface"
})
new_quick_action(addon_surface.commands.clear_blueprints, {
caption = "exp-commands_surface.caption-blueprints",
tooltip = "exp-commands_surface.description-blueprints"
})
new_quick_action(addon_home.commands.home, {
caption = "exp-commands_home.caption-home",
tooltip = "exp-commands_home.description-home"
})
new_quick_action(addon_home.commands.home_return, {
caption = "exp-commands_home.caption-return",
tooltip = "exp-commands_home.description-return"
})
new_quick_action(addon_home.commands.set_home, {
caption = "exp-commands_home.caption-set",
tooltip = "exp-commands_home.description-set"
})
new_quick_action(addon_home.commands.get_home, {
caption = "exp-commands_home.caption-get",
tooltip = "exp-commands_home.description-get"
})
new_quick_action(addon_vlayer.commands.vlayer, {
caption = "exp-commands_vlayer.caption",
tooltip = "exp-commands_vlayer.description"
})
new_quick_action(addon_repair.commands.repair, {
caption = "exp-commands_repair.selection-name",
tooltip = "exp-commands_repair.description"
})
--- Container added to the left gui flow
--- @class ExpGui_QuickActions.elements.container: ExpElement
+10 -6
View File
@@ -73,6 +73,10 @@ description-remove=Remove all enemy spawners.
arg-surface=Surface to remove spawners from.
[exp-commands_home]
caption-home=Teleports Home.
caption-return=Teleports Previous.
caption-get=Get Home.
caption-set=Sets Home.
description-home=Teleports you to your home location.
description-return=Teleports you to previous location.
description-get=Returns your current home location.
@@ -205,6 +209,9 @@ follow-self=You can not follow yourself.
[exp-commands_surface]
selection-name=Surface
caption-items=Clear item
caption-blueprints=Clear Blueprints
caption-blueprints-surface=Clear Blueprints (Surface)
description-items=Clear all items on the ground.
description-blueprints=Clear all blueprints.
description-blueprints-surface=Clear all blueprints on the current surface.
@@ -214,6 +221,7 @@ blueprints=__1__ cleared all blueprints on __2__.
complete=__1__ blueprint ghost were removed.
[exp-commands_trains]
caption=Set Auto Train
description=Set All Trains to Automatic, does not effect trains with passengers.
arg-force=Force to set the trains for, default all.
arg-surface=Surface to set the trains for, default all.
@@ -231,8 +239,9 @@ unavailable=They was a problem teleporting you, likely no position found, please
same-player=Player can not be teleported to themselves.
[exp-commands_vlayer]
caption=Vlayer information.
description=Print all vlayer information.
title=VLayer Information:
title=Vlayer Information:
result=__1__: __2__
[exp-commands_waterfill]
@@ -309,11 +318,6 @@ caption-net=Net
[exp-gui_quick-actions]
tooltip-main=Quick Actions
caption-artillery=Artillery
caption-research=Auto Research
caption-spawn=Teleport Spawn
caption-trains=Set Auto Train
caption-waterfill=Waterfill
[exp-gui_readme]
main-tooltip=Information
+12 -14
View File
@@ -70,10 +70,14 @@ description-remove=移除蟲單位及停止生產器。
arg-surface=要移除蟲巢的位面。
[exp-commands_home]
caption-home=傳送回家。
caption-return=傳送上次。
caption-set=設定家。
caption-get=取得家。
description-home=傳送回家。
description-return=傳送回上一個位置。
description-set=設定目前位置為家。
description-get=取得家的位置。
description-return=傳送回上一個位置。
no-home=你在 __1__ 上還沒設回程傳送點。
no-return=你還沒在 __1__ 上使用過回程。
home-set=你的回程傳送點為 __1__ 上, x: __2__ y: __3__
@@ -206,6 +210,9 @@ follow-self=你不能追蹤自己。
[exp-commands_surface]
selection-name=位面
caption-items=清除物品
caption-blueprints=清除藍圖
caption-blueprints-surface=清除藍圖 (位面)
description-items=清除地面上的物品。
description-blueprints=清除藍圖。
description-blueprints-surface=清除本位面上的藍圖。
@@ -216,6 +223,7 @@ area-too-large=區域太大了,需少過 __1__ 格,你選了 __2__ 格。
complete=__1__ 個地上的藍圖已被清除。
[exp-commands_trains]
caption=自動火車
description=把火車設置為自動模式
arg-force=勢力
arg-surface=位面
@@ -233,7 +241,8 @@ unavailable=沒找到空間進行傳送
same-player=沒辦法傳送到自己
[exp-commands_vlayer]
description=vlayer 資訊
caption=vlayer 資訊
description=列印所有 vlayer 資訊
title=vlayer 資訊:
result=__1__: __2__
@@ -296,16 +305,6 @@ caption-net=淨值
[exp-gui_quick-actions]
tooltip-main=工具
caption-artillery=火炮遙控
tooltip-artillery=火炮遙控
caption-research=研究
tooltip-research=啟用自動研究
caption-spawn=傳送出生
tooltip-spawn-tooltip=傳送到出生點
caption-trains=火車
tooltip-trains=把火車設置為自動模式
caption-waterfill=挖水
tooltip-waterfill=把地換為水。
[exp-gui_readme]
main-tooltip=資訊
@@ -606,7 +605,6 @@ chat-jailed=__1__ 因被多次拆除受保護物體而被禁止行動。請等
[exp_report-jail]
chat-jailed=__1__ 因被多次舉報而被禁止行動。請等候管理員作出下一步處理。
[exp-gui_player-list]
main-tooltip = Player List
open-action-bar = Options
@@ -626,4 +624,4 @@ open-map = __1__ __2__\n__3__\nClick to open map
follow-label = Following __1__.\nClick here or press escape to stop following.
[exp-commands-authorities_feature]
deny = 此指令已在服務器上停用。
deny = 此指令已在服務器上停用。
+12 -14
View File
@@ -70,10 +70,14 @@ description-remove=移除蟲單位及停止生產器。
arg-surface=要移除蟲巢的位面。
[exp-commands_home]
caption-home=傳送回家。
caption-return=傳送上次。
caption-set=設定家。
caption-get=取得家。
description-home=傳送回家。
description-return=傳送回上一個位置。
description-set=設定目前位置為家。
description-get=取得家的位置。
description-return=傳送回上一個位置。
no-home=你在 __1__ 上還沒設回程傳送點。
no-return=你還沒在 __1__ 上使用過回程。
home-set=你的回程傳送點為 __1__ 上, x: __2__ y: __3__
@@ -206,6 +210,9 @@ follow-self=你不能追蹤自己。
[exp-commands_surface]
selection-name=位面
caption-items=清除物品
caption-blueprints=清除藍圖
caption-blueprints-surface=清除藍圖 (位面)
description-items=清除地面上的物品。
description-blueprints=清除藍圖。
description-blueprints-surface=清除本位面上的藍圖。
@@ -216,6 +223,7 @@ area-too-large=區域太大了,需少過 __1__ 格,你選了 __2__ 格。
complete=__1__ 個地上的藍圖已被清除。
[exp-commands_trains]
caption=自動火車
description=把火車設置為自動模式
arg-force=勢力
arg-surface=位面
@@ -233,7 +241,8 @@ unavailable=沒找到空間進行傳送
same-player=沒辦法傳送到自己
[exp-commands_vlayer]
description=vlayer 資訊
caption=vlayer 資訊
description=列印所有 vlayer 資訊
title=vlayer 資訊:
result=__1__: __2__
@@ -296,16 +305,6 @@ caption-net=淨值
[exp-gui_quick-actions]
tooltip-main=工具
caption-artillery=火炮遙控
tooltip-artillery=火炮遙控
caption-research=研究
tooltip-research=啟用自動研究
caption-spawn=傳送出生
tooltip-spawn-tooltip=傳送到出生點
caption-trains=火車
tooltip-trains=把火車設置為自動模式
caption-waterfill=挖水
tooltip-waterfill=把地換為水。
[exp-gui_readme]
main-tooltip=資訊
@@ -606,7 +605,6 @@ chat-jailed=__1__ 因被多次拆除受保護物體而被禁止行動。請等
[exp_report-jail]
chat-jailed=__1__ 因被多次舉報而被禁止行動。請等候管理員作出下一步處理。
[exp-gui_player-list]
main-tooltip = Player List
open-action-bar = Options
@@ -626,4 +624,4 @@ open-map = __1__ __2__\n__3__\nClick to open map
follow-label = Following __1__.\nClick here or press escape to stop following.
[exp-commands-authorities_feature]
deny = 此指令已在服務器上停用。
deny = 此指令已在服務器上停用。