mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2025-06-29 23:10:45 +02:00
refactor code to use with intllib tool
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
local S = unified_inventory.gettext
|
||||
local F = unified_inventory.fgettext
|
||||
local F = minetest.formspec_escape
|
||||
|
||||
local hud_colors = {
|
||||
{"#FFFFFF", 0xFFFFFF, S("White")},
|
||||
@ -25,7 +25,7 @@ unified_inventory.register_page("waypoints", {
|
||||
local waypoints = datastorage.get(player_name, "waypoints")
|
||||
local formspec = "background[0,4.5;8,4;ui_main_inventory.png]" ..
|
||||
"image[0,0;1,1;ui_waypoints_icon.png]" ..
|
||||
"label[1,0;" .. F("Waypoints") .. "]"
|
||||
"label[1,0;" .. F(S("Waypoints")) .. "]"
|
||||
|
||||
-- Tabs buttons:
|
||||
for i = 1, 5, 1 do
|
||||
@ -49,43 +49,43 @@ unified_inventory.register_page("waypoints", {
|
||||
"ui_waypoint_set_icon.png;"..
|
||||
"set_waypoint"..i..";]"..
|
||||
"tooltip[set_waypoint" .. i .. ";"
|
||||
.. F("Set waypoint to current location").."]"
|
||||
.. F(S("Set waypoint to current location")).."]"
|
||||
|
||||
formspec = formspec ..
|
||||
"image_button[5.2,3.7;.8,.8;"..
|
||||
(waypoint.active and "ui_on_icon.png" or "ui_off_icon.png")..";"..
|
||||
"toggle_waypoint"..i..";]"..
|
||||
"tooltip[toggle_waypoint" .. i .. ";"
|
||||
.. F("Make waypoint "
|
||||
..(waypoint.active and "invisible" or "visible")).."]"
|
||||
.. F(S("Make waypoint @1",
|
||||
waypoint.active and S("invisible") or S("visible"))).."]"
|
||||
|
||||
formspec = formspec ..
|
||||
"image_button[5.9,3.7;.8,.8;"..
|
||||
(waypoint.display_pos and "ui_green_icon_background.png" or "ui_red_icon_background.png").."^ui_xyz_icon.png;"..
|
||||
"toggle_display_pos" .. i .. ";]"..
|
||||
"tooltip[toggle_display_pos" .. i .. ";"
|
||||
.. F((waypoint.display_pos and "Disable" or "Enable")
|
||||
.." display of waypoint coordinates").."]"
|
||||
.. F(S("@1 display of waypoint coordinates",
|
||||
waypoint.display_pos and S("Disable") or S("Enable"))) .."]"
|
||||
|
||||
formspec = formspec ..
|
||||
"image_button[6.6,3.7;.8,.8;"..
|
||||
"ui_circular_arrows_icon.png;"..
|
||||
"toggle_color"..i..";]"..
|
||||
"tooltip[toggle_color" .. i .. ";"
|
||||
.. F("Change color of waypoint display").."]"
|
||||
.. F(S("Change color of waypoint display")).."]"
|
||||
|
||||
formspec = formspec ..
|
||||
"image_button[7.3,3.7;.8,.8;"..
|
||||
"ui_pencil_icon.png;"..
|
||||
"rename_waypoint"..i..";]"..
|
||||
"tooltip[rename_waypoint" .. i .. ";"
|
||||
.. F("Edit waypoint name").."]"
|
||||
.. F(S("Edit waypoint name")).."]"
|
||||
|
||||
-- Waypoint's info:
|
||||
if waypoint.active then
|
||||
formspec = formspec .. "label[1,0.8;"..F("Waypoint active").."]"
|
||||
formspec = formspec .. "label[1,0.8;"..F(S("Waypoint active")).."]"
|
||||
else
|
||||
formspec = formspec .. "label[1,0.8;"..F("Waypoint inactive").."]"
|
||||
formspec = formspec .. "label[1,0.8;"..F(S("Waypoint inactive")).."]"
|
||||
end
|
||||
|
||||
if temp.edit then
|
||||
@ -96,13 +96,13 @@ unified_inventory.register_page("waypoints", {
|
||||
"ui_ok_icon.png;"..
|
||||
"confirm_rename"..i.. ";]"..
|
||||
"tooltip[confirm_rename" .. i .. ";"
|
||||
.. F("Finish editing").."]"
|
||||
.. F(S("Finish editing")).."]"
|
||||
end
|
||||
|
||||
formspec = formspec .. "label[1,1.3;"..F("World position")..": " ..
|
||||
formspec = formspec .. "label[1,1.3;"..F(S("World position"))..": " ..
|
||||
minetest.pos_to_string(waypoint.world_pos or vector.new()) .. "]" ..
|
||||
"label[1,1.8;"..F("Name")..": ".. (waypoint.name or default_name) .. "]" ..
|
||||
"label[1,2.3;"..F("HUD text color")..": " ..
|
||||
"label[1,1.8;"..F(S("Name"))..": ".. (waypoint.name or default_name) .. "]" ..
|
||||
"label[1,2.3;"..F(S("HUD text color"))..": " ..
|
||||
hud_colors[waypoint.color or 1][3] .. "]"
|
||||
|
||||
return {formspec=formspec}
|
||||
|
Reference in New Issue
Block a user