Update for translation function
Some checks are pending
Check & Release / lint (push) Waiting to run

This commit is contained in:
Vitaliy Olkhin 2025-01-07 14:04:26 +05:00
parent 0fd8fe2e10
commit 6dbbf05261
22 changed files with 47 additions and 48 deletions

View File

@ -15,7 +15,7 @@ local fuel_type = "technic:uranium_fuel" -- The reactor burns this
local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct") local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct")
local digiline_remote_path = minetest.get_modpath("digiline_remote") local digiline_remote_path = minetest.get_modpath("digiline_remote")
local S = technic.getter local S = minetest.get_translator("technic")
local reactor_desc = S("@1 Nuclear Reactor Core", S("HV")) local reactor_desc = S("@1 Nuclear Reactor Core", S("HV"))
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"

View File

@ -1,5 +1,5 @@
local S = technic.getter local S = minetest.get_translator("technic")
local tube_entry = "^pipeworks_tube_connection_metallic.png" local tube_entry = "^pipeworks_tube_connection_metallic.png"
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"
@ -22,7 +22,7 @@ local function set_quarry_formspec(meta)
local formspec = "size[6,4.3]".. local formspec = "size[6,4.3]"..
"list[context;cache;0,1;4,3;]".. "list[context;cache;0,1;4,3;]"..
"item_image[4.8,0;1,1;technic:quarry]".. "item_image[4.8,0;1,1;technic:quarry]"..
"label[0,0.2;"..S("%s Quarry"):format("HV").."]".. "label[0,0.2;"..S("@1 Quarry", "HV").."]"..
"field[4.3,3.5;2,1;size;"..S("Radius:")..";"..radius.."]" "field[4.3,3.5;2,1;size;"..S("Radius:")..";"..radius.."]"
if meta:get_int("enabled") == 0 then if meta:get_int("enabled") == 0 then
formspec = formspec.."button[4,1;2,1;enable;"..S("Disabled").."]" formspec = formspec.."button[4,1;2,1;enable;"..S("Disabled").."]"
@ -46,11 +46,11 @@ end
local function set_quarry_demand(meta) local function set_quarry_demand(meta)
local radius = meta:get_int("size") local radius = meta:get_int("size")
local diameter = radius*2 + 1 local diameter = radius*2 + 1
local machine_name = S("%s Quarry"):format("HV") local machine_name = S("@1 Quarry", "HV")
local do_purge = meta:get_int("purge_on") == 1 local do_purge = meta:get_int("purge_on") == 1
if meta:get_int("enabled") == 0 or do_purge then if meta:get_int("enabled") == 0 or do_purge then
local infotext = do_purge and local infotext = do_purge and
S("%s purging cache") or S("%s Disabled") S("@1 purging cache") or S("%s Disabled")
meta:set_string("infotext", infotext:format(machine_name)) meta:set_string("infotext", infotext:format(machine_name))
meta:set_int("HV_EU_demand", 0) meta:set_int("HV_EU_demand", 0)
elseif meta:get_int("dug") == diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) then elseif meta:get_int("dug") == diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) then

View File

@ -3,7 +3,7 @@
-- Illuminates a 7x7x3(H) volume below itself with light bright as the sun. -- Illuminates a 7x7x3(H) volume below itself with light bright as the sun.
local S = technic.getter local S = minetest.get_translator("technic")
local desc = S("@1 Lamp", S("LV")) local desc = S("@1 Lamp", S("LV"))
local active_desc = S("@1 Active", desc) local active_desc = S("@1 Active", desc)

View File

@ -1,7 +1,7 @@
-- LED -- LED
-- Intended primarily as a core component for LED lamps. -- Intended primarily as a core component for LED lamps.
local S = technic.getter local S = minetest.get_translator("technic")
local desc = S("@1 LED", S("LV")) local desc = S("@1 LED", S("LV"))
local active_desc = S("@1 Active", desc) local active_desc = S("@1 Active", desc)

View File

@ -1,7 +1,7 @@
-- LV Music player. -- LV Music player.
-- The player can play music. But it is high ampage! -- The player can play music. But it is high ampage!
local S = technic.getter local S = minetest.get_translator("technic")
minetest.register_alias("music_player", "technic:music_player") minetest.register_alias("music_player", "technic:music_player")
minetest.register_craft({ minetest.register_craft({
@ -23,7 +23,7 @@ end
local run = function(pos, node) local run = function(pos, node)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local eu_input = meta:get_int("LV_EU_input") local eu_input = meta:get_int("LV_EU_input")
local machine_name = S("%s Music Player"):format("LV") local machine_name = S("@1 Music Player", "LV")
local demand = 150 local demand = 150
local current_track = meta:get_int("current_track") local current_track = meta:get_int("current_track")
@ -38,19 +38,19 @@ local run = function(pos, node)
end end
if meta:get_int("active") == 0 then if meta:get_int("active") == 0 then
meta:set_string("infotext", S("%s Idle"):format(machine_name)) meta:set_string("infotext", S("@1 Idle", machine_name))
meta:set_int("LV_EU_demand", 0) meta:set_int("LV_EU_demand", 0)
return return
end end
if eu_input < demand then if eu_input < demand then
meta:set_string("infotext", S("%s Unpowered"):format(machine_name)) meta:set_string("infotext", S("@1 Unpowered", machine_name))
if music_handle then if music_handle then
minetest.sound_stop(music_handle) minetest.sound_stop(music_handle)
music_handle = nil music_handle = nil
end end
elseif eu_input >= demand then elseif eu_input >= demand then
meta:set_string("infotext", S("%s Active"):format(machine_name)) meta:set_string("infotext", S("@1 Active", machine_name))
if not music_handle then if not music_handle then
music_handle = play_track(pos, current_track) music_handle = play_track(pos, current_track)
end end
@ -72,7 +72,7 @@ local function set_display(meta)
meta:set_string("formspec", meta:set_string("formspec",
"size[4,4.5]".. "size[4,4.5]"..
"item_image[0,0;1,1;technic:music_player]".. "item_image[0,0;1,1;technic:music_player]"..
"label[1,0;"..S("%s Music Player"):format("LV").."]".. "label[1,0;"..S("@1 Music Player", "LV").."]"..
"button[0,1;1,1;track1;1]".. "button[0,1;1,1;track1;1]"..
"button[1,1;1,1;track2;2]".. "button[1,1;1,1;track2;2]"..
"button[2,1;1,1;track3;3]".. "button[2,1;1,1;track3;3]"..
@ -86,11 +86,11 @@ local function set_display(meta)
"label[0,4;"..minetest.formspec_escape( "label[0,4;"..minetest.formspec_escape(
meta:get_int("active") == 0 and meta:get_int("active") == 0 and
S("Stopped") or S("Stopped") or
S("Current track %s"):format(meta:get_int("current_track"))).."]") S("Current track @1", "current_track")).."]")
end end
minetest.register_node("technic:music_player", { minetest.register_node("technic:music_player", {
description = S("%s Music Player"):format("LV"), description = S("@1 Music Player", "LV"),
tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png", tiles = {"technic_music_player_top.png", "technic_machine_bottom.png", "technic_music_player_side.png",
"technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"}, "technic_music_player_side.png", "technic_music_player_side.png", "technic_music_player_side.png"},
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
@ -99,7 +99,7 @@ minetest.register_node("technic:music_player", {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("%s Music Player"):format("LV")) meta:set_string("infotext", S("@1 Music Player", "LV"))
set_display(meta) set_display(meta)
end, end,
on_receive_fields = function(pos, formanme, fields, sender) on_receive_fields = function(pos, formanme, fields, sender)

View File

@ -2,7 +2,7 @@
-- They can however also be used separately but with reduced efficiency due to the missing transformer. -- They can however also be used separately but with reduced efficiency due to the missing transformer.
-- Individual panels are less efficient than when the panels are combined into full arrays. -- Individual panels are less efficient than when the panels are combined into full arrays.
local S = technic.getter local S = minetest.get_translator("technic")
minetest.register_craft({ minetest.register_craft({
@ -23,7 +23,7 @@ local run = function(pos, node)
-- To take care of some of it solar panels do not work outside daylight hours or if -- To take care of some of it solar panels do not work outside daylight hours or if
-- built below 0m -- built below 0m
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
local machine_name = S("Small Solar %s Generator"):format("LV") local machine_name = S("Small Solar @1 Generator", "LV")
local light = minetest.get_node_light(pos1, nil) local light = minetest.get_node_light(pos1, nil)
local time_of_day = minetest.get_timeofday() local time_of_day = minetest.get_timeofday()
@ -39,7 +39,7 @@ local run = function(pos, node)
technic.EU_string(charge_to_give))) technic.EU_string(charge_to_give)))
meta:set_int("LV_EU_supply", charge_to_give) meta:set_int("LV_EU_supply", charge_to_give)
else else
meta:set_string("infotext", S("%s Idle"):format(machine_name)) meta:set_string("infotext", S("@1 Idle", machine_name))
meta:set_int("LV_EU_supply", 0) meta:set_int("LV_EU_supply", 0)
end end
end end
@ -51,7 +51,7 @@ minetest.register_node("technic:solar_panel", {
technic_machine=1, technic_lv=1}, technic_machine=1, technic_lv=1},
connect_sides = {"bottom"}, connect_sides = {"bottom"},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
description = S("Small Solar %s Generator"):format("LV"), description = S("Small Solar @1 Generator", "LV"),
active = false, active = false,
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
@ -63,7 +63,7 @@ minetest.register_node("technic:solar_panel", {
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_int("LV_EU_supply", 0) meta:set_int("LV_EU_supply", 0)
meta:set_string("infotext", S("Small Solar %s Generator"):format("LV")) meta:set_string("infotext", S("Small Solar @1 Generator", "LV"))
end, end,
technic_run = run, technic_run = run,
}) })

View File

@ -2,7 +2,7 @@
-- It is a LV EU supplier and fairly low yield (max 180EUs) -- It is a LV EU supplier and fairly low yield (max 180EUs)
-- It is a little over half as good as the thermal generator. -- It is a little over half as good as the thermal generator.
local S = technic.getter local S = minetest.get_translator("technic")
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"
@ -53,7 +53,7 @@ local run = function(pos, node)
meta:set_int("LV_EU_supply", eu_supply) meta:set_int("LV_EU_supply", eu_supply)
meta:set_string("infotext", meta:set_string("infotext",
S("Hydro %s Generator"):format("LV").." ("..production_level.."%)") S("Hydro @1 Generator", "LV").." ("..production_level.."%)")
if production_level > 0 and if production_level > 0 and
minetest.get_node(pos).name == "technic:water_mill" then minetest.get_node(pos).name == "technic:water_mill" then
@ -67,7 +67,7 @@ local run = function(pos, node)
end end
minetest.register_node("technic:water_mill", { minetest.register_node("technic:water_mill", {
description = S("Hydro %s Generator"):format("LV"), description = S("Hydro @1 Generator", "LV"),
tiles = { tiles = {
"technic_water_mill_top.png", "technic_water_mill_top.png",
"technic_machine_bottom.png"..cable_entry, "technic_machine_bottom.png"..cable_entry,
@ -83,14 +83,14 @@ minetest.register_node("technic:water_mill", {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Hydro %s Generator"):format("LV")) meta:set_string("infotext", S("Hydro @1 Generator", "LV"))
meta:set_int("LV_EU_supply", 0) meta:set_int("LV_EU_supply", 0)
end, end,
technic_run = run, technic_run = run,
}) })
minetest.register_node("technic:water_mill_active", { minetest.register_node("technic:water_mill_active", {
description = S("Hydro %s Generator"):format("LV"), description = S("Hydro @1 Generator", "LV"),
tiles = {"technic_water_mill_top_active.png", "technic_machine_bottom.png", tiles = {"technic_water_mill_top_active.png", "technic_machine_bottom.png",
"technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png", "technic_water_mill_side.png",
"technic_water_mill_side.png", "technic_water_mill_side.png"}, "technic_water_mill_side.png", "technic_water_mill_side.png"},

View File

@ -1,4 +1,4 @@
local S = technic.getter local S = minetest.get_translator("technic")
local desc = S("Administrative World Anchor") local desc = S("Administrative World Anchor")

View File

@ -1,7 +1,7 @@
-- Fuel driven alloy furnace. This uses no EUs: -- Fuel driven alloy furnace. This uses no EUs:
local S = technic.getter local S = minetest.get_translator("technic")
minetest.register_craft({ minetest.register_craft({
output = 'technic:coal_alloy_furnace', output = 'technic:coal_alloy_furnace',

View File

@ -1,4 +1,4 @@
local S = technic.getter local S = minetest.get_translator("technic")
if minetest.registered_nodes["default:furnace"].description == "Furnace" then if minetest.registered_nodes["default:furnace"].description == "Furnace" then
minetest.override_item("default:furnace", { description = S("Fuel-Fired Furnace") }) minetest.override_item("default:furnace", { description = S("Fuel-Fired Furnace") })

View File

@ -1,4 +1,4 @@
local S = technic.getter local S = minetest.get_translator("technic")
local infinite_stacks = minetest.settings:get_bool("creative_mode") local infinite_stacks = minetest.settings:get_bool("creative_mode")
and minetest.get_modpath("unified_inventory") == nil and minetest.get_modpath("unified_inventory") == nil

View File

@ -1,5 +1,5 @@
local S = technic.getter local S = minetest.get_translator("technic")
local fs_helpers = pipeworks.fs_helpers local fs_helpers = pipeworks.fs_helpers

View File

@ -2,7 +2,7 @@
-- The power monitor can be used to monitor how much power is available on a network, -- The power monitor can be used to monitor how much power is available on a network,
-- similarly to the old "slave" switching stations. -- similarly to the old "slave" switching stations.
local S = technic.getter local S = minetest.get_translator("technic")
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"

View File

@ -9,7 +9,7 @@
local digilines_path = minetest.get_modpath("digilines") local digilines_path = minetest.get_modpath("digilines")
local S = technic.getter local S = minetest.get_translator("technic")
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"
@ -30,9 +30,9 @@ local function set_supply_converter_formspec(meta)
formspec = formspec.."button[0,1;5,1;mesecon_mode_0;"..S("Controlled by Mesecon Signal").."]" formspec = formspec.."button[0,1;5,1;mesecon_mode_0;"..S("Controlled by Mesecon Signal").."]"
end end
if meta:get_int("enabled") == 0 then if meta:get_int("enabled") == 0 then
formspec = formspec.."button[0,1.75;5,1;enable;"..S("%s Disabled"):format(S("Supply Converter")).."]" formspec = formspec.."button[0,1.75;5,1;enable;"..S("@1 Disabled", S("Supply Converter")).."]"
else else
formspec = formspec.."button[0,1.75;5,1;disable;"..S("%s Enabled"):format(S("Supply Converter")).."]" formspec = formspec.."button[0,1.75;5,1;disable;"..S("@1 Enabled", S("Supply Converter")).."]"
end end
meta:set_string("formspec", formspec) meta:set_string("formspec", formspec)
end end
@ -172,10 +172,10 @@ local run = function(pos, node, run_stage)
technic.EU_string(input), from, technic.EU_string(input), from,
technic.EU_string(input * efficiency), to)) technic.EU_string(input * efficiency), to))
else else
meta:set_string("infotext",S("%s Has No Network"):format(machine_name)) meta:set_string("infotext",S("@1 Has No Network", machine_name))
end end
else else
meta:set_string("infotext", S("%s Has Bad Cabling"):format(machine_name)) meta:set_string("infotext", S("@1 Has Bad Cabling", machine_name))
if to then if to then
meta:set_int(to.."_EU_supply", 0) meta:set_int(to.."_EU_supply", 0)
end end

View File

@ -7,7 +7,7 @@ technic.redundant_warn = {}
local mesecons_path = minetest.get_modpath("mesecons") local mesecons_path = minetest.get_modpath("mesecons")
local digilines_path = minetest.get_modpath("digilines") local digilines_path = minetest.get_modpath("digilines")
local S = technic.getter local S = minetest.get_translator("technic")
local cable_entry = "^technic_cable_connection_overlay.png" local cable_entry = "^technic_cable_connection_overlay.png"

View File

@ -1,4 +1,4 @@
local S = technic.getter local S = minetest.get_translator("technic")
local function set_can_wear(itemstack, level, max_level) local function set_can_wear(itemstack, level, max_level)
local temp local temp

View File

@ -11,7 +11,7 @@ local chainsaw_efficiency = 0.92 -- Drops less items
local tree_max_radius = 10 local tree_max_radius = 10
local tree_max_height = 70 local tree_max_height = 70
local S = technic.getter local S = minetest.get_translator("technic")
--[[ --[[
Format: [node_name] = dig_cost Format: [node_name] = dig_cost
@ -203,8 +203,7 @@ local function chainsaw_dig(player, pos, remaining_charge)
end end
if cutter.stopped_by_safe_cut then if cutter.stopped_by_safe_cut then
minetest.chat_send_player(player_name, S("The chainsaw could not dig all nodes" .. minetest.chat_send_player(player_name, S("The chainsaw could not dig all nodes because the safety mechanism was activated."))
" because the safety mechanism was activated."))
end end
minetest.sound_play("chainsaw", { minetest.sound_play("chainsaw", {

View File

@ -6,7 +6,7 @@ local mining_lasers_list = {
} }
local allow_entire_discharging = true local allow_entire_discharging = true
local S = technic.getter local S = minetest.get_translator("technic")
minetest.register_craft({ minetest.register_craft({
output = "technic:laser_mk1", output = "technic:laser_mk1",
@ -94,7 +94,7 @@ end
for _, m in pairs(mining_lasers_list) do for _, m in pairs(mining_lasers_list) do
technic.register_power_tool("technic:laser_mk"..m[1], m[3]) technic.register_power_tool("technic:laser_mk"..m[1], m[3])
minetest.register_tool("technic:laser_mk"..m[1], { minetest.register_tool("technic:laser_mk"..m[1], {
description = S("Mining Laser Mk%d"):format(m[1]), description = S("Mining Laser Mk@1", m[1]),
inventory_image = "technic_mining_laser_mk"..m[1]..".png", inventory_image = "technic_mining_laser_mk"..m[1]..".png",
range = 0, range = 0,
stack_max = 1, stack_max = 1,

View File

@ -1,4 +1,4 @@
local S = technic.getter local S = minetest.get_translator("technic")
technic.register_power_tool("technic:prospector", 300000) technic.register_power_tool("technic:prospector", 300000)

View File

@ -1,6 +1,6 @@
local sonic_screwdriver_max_charge = 15000 local sonic_screwdriver_max_charge = 15000
local S = technic.getter local S = minetest.get_translator("technic")
technic.register_power_tool("technic:sonic_screwdriver", sonic_screwdriver_max_charge) technic.register_power_tool("technic:sonic_screwdriver", sonic_screwdriver_max_charge)

View File

@ -1,5 +1,5 @@
local S = technic.getter local S = minetest.get_translator("technic")
local mesecons_materials = minetest.get_modpath("mesecons_materials") local mesecons_materials = minetest.get_modpath("mesecons_materials")
minetest.register_tool("technic:treetap", { minetest.register_tool("technic:treetap", {

View File

@ -3,7 +3,7 @@ local vacuum_max_charge = 10000 -- 10000 - Maximum charge of the vacuum c
local vacuum_charge_per_object = 100 -- 100 - Capable of picking up 50 objects local vacuum_charge_per_object = 100 -- 100 - Capable of picking up 50 objects
local vacuum_range = 8 -- 8 - Area in which to pick up objects local vacuum_range = 8 -- 8 - Area in which to pick up objects
local S = technic.getter local S = minetest.get_translator("technic")
technic.register_power_tool("technic:vacuum", vacuum_max_charge) technic.register_power_tool("technic:vacuum", vacuum_max_charge)