From c57582e77570a383b6d094cbd26bc350f3233dd7 Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sat, 4 Feb 2017 23:08:38 -0700 Subject: [PATCH] Internationalization support What a lot of strings. --- awards.lua | 147 +++++----- class_layout.lua | 2 +- depends.txt | 3 +- intllib.lua | 45 +++ locale/template.pot | 653 +++++++++++++++++++++++++++++++++++++++++ node_axle.lua | 8 +- node_builders.lua | 36 ++- node_controllers.lua | 52 ++-- node_crate.lua | 52 ++-- node_diggers.lua | 32 +- node_misc.lua | 14 +- node_storage.lua | 18 +- recipes.lua | 6 +- util_execute_cycle.lua | 32 +- 14 files changed, 916 insertions(+), 184 deletions(-) create mode 100644 intllib.lua create mode 100644 locale/template.pot diff --git a/awards.lua b/awards.lua index 6a76371..c4b98ea 100644 --- a/awards.lua +++ b/awards.lua @@ -7,6 +7,10 @@ if not minetest.get_modpath("awards") then end --------------------------------------------------------------------------- +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + digtron.award_item_dug = function (items_dropped, player) if table.getn(items_dropped) == 0 then return @@ -162,246 +166,239 @@ digtron.award_crate = function (layout, player) end awards.register_achievement("digtron_water",{ - title = "Deep Blue Digtron", - description = "Encountered water while operating a Digtron.", + title = S("Deep Blue Digtron"), + description = S("Encounter water while operating a Digtron."), background = "awards_bg_mining.png", icon = "default_water.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_lava",{ - title = "Digtrons of Fire", - description = "Encountered lava while operating a Digtron.", + title = S("Digtrons of Fire"), + description = S("Encounter lava while operating a Digtron."), background = "awards_bg_mining.png", icon = "default_lava.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_size10",{ - title = "Bigtron", - description = "Operated a Digtron with 10 or more component blocks.", + title = S("Bigtron"), + description = S("Operate a Digtron with 10 or more component blocks."), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_crate.png", }) awards.register_achievement("digtron_size100",{ - title = "Really Bigtron", - description = "Operated a Digtron with 100 or more component blocks.", + title = S("Really Bigtron"), + description = S("Operate a Digtron with 100 or more component blocks."), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_crate.png", -- TODO: Visually distinguish this from Bigtron }) awards.register_achievement("digtron_builder25",{ - title = "Buildtron", - description = "Operated a Digtron with 25 or more builder modules.", + title = S("Buildtron"), + description = S("Operate a Digtron with 25 or more builder modules."), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_builder.png^digtron_crate.png", }) awards.register_achievement("digtron_digger25",{ - title = "Digging Leviathan", - description = "Operated a Digtron with 25 or more digger heads.", + title = S("Digging Leviathan"), + description = S("Operate a Digtron with 25 or more digger heads."), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_motor.png^digtron_crate.png", }) awards.register_achievement("digtron_height1000",{ - title = "Digtron In The Sky", - description = "Operate a Digtron above 1000m elevation", + title = S("Digtron In The Sky"), + description = S("Operate a Digtron above 1000m elevation"), background = "awards_bg_mining.png", icon = "default_river_water.png^default_snow_side.png^[transformR180^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_height100",{ - title = "Digtron High", - description = "Operated a Digtron above 100m elevation", + title = S("Digtron High"), + description = S("Operate a Digtron above 100m elevation"), background = "awards_bg_mining.png", icon = "default_river_water.png^default_snow_side.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_depth100",{ - title = "Scratching the Surface", - description = "Operated a Digtron 100m underground", + title = S("Scratching the Surface"), + description = S("Operate a Digtron 100m underground"), background = "awards_bg_mining.png", icon = "default_cobble.png^digtron_digger_yb_frame.png^awards_level1.png", }) awards.register_achievement("digtron_depth1000",{ - title = "Digging Deeper", - description = "Operated a Digtron 1,000m underground", + title = S("Digging Deeper"), + description = S("Operate a Digtron 1,000m underground"), background = "awards_bg_mining.png", icon = "default_cobble.png^[colorize:#0002^digtron_digger_yb_frame.png^awards_level2.png", }) awards.register_achievement("digtron_depth2000",{ - title = "More Than a Mile", - description = "Operated a Digtron 2,000m underground", + title = S("More Than a Mile"), + description = S("Operate a Digtron 2,000m underground"), background = "awards_bg_mining.png", icon = "default_cobble.png^[colorize:#0004^digtron_digger_yb_frame.png^awards_level3.png", }) awards.register_achievement("digtron_depth4000",{ - title = "Digging Below Plausibility", - description = "The deepest mine in the world is only 3.9 km deep, you operated a Digtron below 4km", + title = S("Digging Below Plausibility"), + description = S("The deepest mine in the world is only 3.9 km deep, you operated a Digtron below 4km"), background = "awards_bg_mining.png", icon = "default_cobble.png^[colorize:#0006^digtron_digger_yb_frame.png^awards_level4.png", }) awards.register_achievement("digtron_depth8000",{ - title = "Double Depth", - description = "Operated a Digtron 8,000m underground", + title = S("Double Depth"), + description = S("Operate a Digtron 8,000m underground"), background = "awards_bg_mining.png", icon = "default_cobble.png^[colorize:#0008^digtron_digger_yb_frame.png^awards_level5.png", }) awards.register_achievement("digtron_depth16000",{ - title = "Halfway to the Core", - description = "Operated a Digtron 16,000m underground", + title = S("Halfway to the Core"), + description = S("Operate a Digtron 16,000m underground"), background = "awards_bg_mining.png", icon = "default_cobble.png^[colorize:#000A^digtron_digger_yb_frame.png^awards_level6.png", }) awards.register_achievement("digtron_depth30000",{ - title = "Nowhere To Go But Up", - description = "Operated a Digtron 30,000m underground", + title = S("Nowhere To Go But Up"), + description = S("Operate a Digtron 30,000m underground"), background = "awards_bg_mining.png", icon = "default_cobble.png^[colorize:#000C^digtron_digger_yb_frame.png^awards_level7.png", }) awards.register_achievement("digtron_100mese_dug",{ - title = "Mese Master", - description = "Mine 100 Mese crystals with a Digtron", + title = S("Mese Master"), + description = S("Mine 100 Mese crystals with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_mese_crystal.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_100diamond_dug",{ - title = "Diamonds Vs. Diamonds", - description = "Mine 100 diamonds with a Digtron", + title = S("Diamond Vs. Diamond"), + description = S("Mine 100 diamonds with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_diamond.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000dirt_dug",{ - title = "Strip Mining", - description = "Excavate 1000 units of dirt with a Digtron", + title = S("Strip Mining"), + description = S("Excavate 1000 units of dirt with a Digtron"), background = "awards_bg_mining.png", icon = "default_dirt.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000_dug",{ - title = "Digtron Miner", - description = "Excavate 1000 blocks using Digtrons", + title = S("Digtron Miner"), + description = S("Excavate 1000 blocks using a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_tool_bronzepick.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_10000_dug",{ - title = "Digtron Expert Miner", - description = "Excavate 10,000 blocks using Digtrons", + title = S("Digtron Expert Miner"), + description = S("Excavate 10,000 blocks using a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_tool_steelpick.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_100000_dug",{ - title = "Digtron Master Miner", - description = "Excavate 100,000 blocks using Digtrons", + title = S("Digtron Master Miner"), + description = S("Excavate 100,000 blocks using a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_tool_diamondpick.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000000_dug",{ - title = "DIGTRON MEGAMINER", - description = "Excavate over a million blocks using Digtrons!", + title = S("DIGTRON MEGAMINER"), + description = S("Excavate over a million blocks using a Digtron!"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_tool_mesepick.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000wood_dug",{ - title = "Clear Cutting", - description = "Chop down 1000 units of tree with a Digtron", + title = S("Clear Cutting"), + description = S("Chop down 1000 units of tree with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_sapling.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_10000wood_dug",{ - title = "Digtron Deforestation", - description = "Chop down 10,000 units of tree with a Digtron", + title = S("Digtron Deforestation"), + description = S("Chop down 10,000 units of tree with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_sapling.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000grass_dug",{ - title = "Lawnmower", - description = "Harvest 1000 units of grass with a Digtron", + title = S("Lawnmower"), + description = S("Harvest 1000 units of grass with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_grass_5.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000iron_dug",{ - title = "Iron Digtron", - description = "Excavate 1000 units of iron ore with a Digtron", + title = S("Iron Digtron"), + description = S("Excavate 1000 units of iron ore with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_steel_ingot.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000copper_dug",{ - title = "Copper Digtron", - description = "Excavate 1000 units of copper ore with a Digtron", + title = S("Copper Digtron"), + description = S("Excavate 1000 units of copper ore with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_copper_ingot.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000coal_dug",{ - title = "Coal Digtron", - description = "Excavate 1,000 units if coal with a Digtron", + title = S("Coal Digtron"), + description = S("Excavate 1,000 units if coal with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_coal_lump.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_10000coal_dug",{ - title = "Bagger 288", - description = "Excavate 10,000 units of coal with a Digtron", + title = S("Bagger 288"), + description = S("Excavate 10,000 units of coal with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_coal_block.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_100gold_dug",{ - title = "Digtron 49er", - description = "Excavate 100 units of gold with a Digtron", + title = S("Digtron 49er"), + description = S("Excavate 100 units of gold with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^default_gold_ingot.png^digtron_digger_yb_frame.png", }) awards.register_achievement("digtron_1000_built",{ - title = "Constructive Digging", - description = "Build 1,000 blocks with a Digtron", + title = S("Constructive Digging"), + description = S("Build 1,000 blocks with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_builder.png", }) awards.register_achievement("digtron_10000_built",{ - title = "Highly Constructive Digging", - description = "Build 10,000 blocks with a Digtron", + title = S("Highly Constructive Digging"), + description = S("Build 10,000 blocks with a Digtron"), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_axel_side.png^[transformR90^digtron_builder.png", }) -awards.register_achievement("digtron_water",{ - title = "Deep Blue Digtron", - description = "Encountered water while operating a Digtron.", - background = "awards_bg_mining.png", - icon = "default_water.png^digtron_digger_yb_frame.png", -}) - awards.register_achievement("digtron_crate10",{ - title = "Digtron Packrat", - description = "Stored 10 or more Digtron blocks in one crate.", + title = S("Digtron Packrat"), + description = S("Stored 10 or more Digtron blocks in one crate."), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_crate.png", -- TODO: Visually distinguish this from Bigtron }) awards.register_achievement("digtron_crate100",{ - title = "Digtron Hoarder", - description = "Stored 100 or more Digtron blocks in one crate.", + title = S("Digtron Hoarder"), + description = S("Stored 100 or more Digtron blocks in one crate."), background = "awards_bg_mining.png", icon = "digtron_plate.png^digtron_crate.png", -- TODO: Visually distinguish this from Bigtron }) \ No newline at end of file diff --git a/class_layout.lua b/class_layout.lua index 779568b..0aa139e 100644 --- a/class_layout.lua +++ b/class_layout.lua @@ -43,7 +43,7 @@ function DigtronLayout.create(pos, player) self.contains_protected_node = false -- used to indicate if at least one node in this digtron array is protected from the player. self.controller = {x=pos.x, y=pos.y, z=pos.z} --Make a deep copy of the pos parameter just in case the calling code wants to play silly buggers with it - table.insert(self.all, get_node_image(pos, minetest.get_node(pos))) -- We never visit the source node, so insert it into the all table a priori. Revisit this if a controller node is created that contains fuel or inventory or whatever. + table.insert(self.all, get_node_image(pos, minetest.get_node(pos))) -- We never visit the source node, so insert it into the all table a priori. Revisit this design decision if a controller node is created that contains fuel or inventory or whatever. self.extents.max_x = pos.x self.extents.min_x = pos.x diff --git a/depends.txt b/depends.txt index 3806918..e3e47e8 100644 --- a/depends.txt +++ b/depends.txt @@ -3,4 +3,5 @@ pipeworks? doc? hopper? awards? -catacomb? \ No newline at end of file +catacomb? +intllib? \ No newline at end of file diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/locale/template.pot b/locale/template.pot new file mode 100644 index 0000000..745433f --- /dev/null +++ b/locale/template.pot @@ -0,0 +1,653 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-04 23:00-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: awards.lua:169 +msgid "Deep Blue Digtron" +msgstr "" + +#: awards.lua:170 +msgid "Encounter water while operating a Digtron." +msgstr "" + +#: awards.lua:176 +msgid "Digtrons of Fire" +msgstr "" + +#: awards.lua:177 +msgid "Encounter lava while operating a Digtron." +msgstr "" + +#: awards.lua:183 +msgid "Bigtron" +msgstr "" + +#: awards.lua:184 +msgid "Operate a Digtron with 10 or more component blocks." +msgstr "" + +#: awards.lua:190 +msgid "Really Bigtron" +msgstr "" + +#: awards.lua:191 +msgid "Operate a Digtron with 100 or more component blocks." +msgstr "" + +#: awards.lua:197 +msgid "Buildtron" +msgstr "" + +#: awards.lua:198 +msgid "Operate a Digtron with 25 or more builder modules." +msgstr "" + +#: awards.lua:204 +msgid "Digging Leviathan" +msgstr "" + +#: awards.lua:205 +msgid "Operate a Digtron with 25 or more digger heads." +msgstr "" + +#: awards.lua:211 +msgid "Digtron In The Sky" +msgstr "" + +#: awards.lua:212 +msgid "Operate a Digtron above 1000m elevation" +msgstr "" + +#: awards.lua:218 +msgid "Digtron High" +msgstr "" + +#: awards.lua:219 +msgid "Operate a Digtron above 100m elevation" +msgstr "" + +#: awards.lua:225 +msgid "Scratching the Surface" +msgstr "" + +#: awards.lua:226 +msgid "Operate a Digtron 100m underground" +msgstr "" + +#: awards.lua:232 +msgid "Digging Deeper" +msgstr "" + +#: awards.lua:233 +msgid "Operate a Digtron 1,000m underground" +msgstr "" + +#: awards.lua:239 +msgid "More Than a Mile" +msgstr "" + +#: awards.lua:240 +msgid "Operate a Digtron 2,000m underground" +msgstr "" + +#: awards.lua:246 +msgid "Digging Below Plausibility" +msgstr "" + +#: awards.lua:247 +msgid "" +"The deepest mine in the world is only 3.9 km deep, you operated a Digtron " +"below 4km" +msgstr "" + +#: awards.lua:253 +msgid "Double Depth" +msgstr "" + +#: awards.lua:254 +msgid "Operate a Digtron 8,000m underground" +msgstr "" + +#: awards.lua:260 +msgid "Halfway to the Core" +msgstr "" + +#: awards.lua:261 +msgid "Operate a Digtron 16,000m underground" +msgstr "" + +#: awards.lua:267 +msgid "Nowhere To Go But Up" +msgstr "" + +#: awards.lua:268 +msgid "Operate a Digtron 30,000m underground" +msgstr "" + +#: awards.lua:274 +msgid "Mese Master" +msgstr "" + +#: awards.lua:275 +msgid "Mine 100 Mese crystals with a Digtron" +msgstr "" + +#: awards.lua:281 +msgid "Diamond Vs. Diamond" +msgstr "" + +#: awards.lua:282 +msgid "Mine 100 diamonds with a Digtron" +msgstr "" + +#: awards.lua:288 +msgid "Strip Mining" +msgstr "" + +#: awards.lua:289 +msgid "Excavate 1000 units of dirt with a Digtron" +msgstr "" + +#: awards.lua:295 +msgid "Digtron Miner" +msgstr "" + +#: awards.lua:296 +msgid "Excavate 1000 blocks using a Digtron" +msgstr "" + +#: awards.lua:302 +msgid "Digtron Expert Miner" +msgstr "" + +#: awards.lua:303 +msgid "Excavate 10,000 blocks using a Digtron" +msgstr "" + +#: awards.lua:309 +msgid "Digtron Master Miner" +msgstr "" + +#: awards.lua:310 +msgid "Excavate 100,000 blocks using a Digtron" +msgstr "" + +#: awards.lua:316 +msgid "DIGTRON MEGAMINER" +msgstr "" + +#: awards.lua:317 +msgid "Excavate over a million blocks using a Digtron!" +msgstr "" + +#: awards.lua:323 +msgid "Clear Cutting" +msgstr "" + +#: awards.lua:324 +msgid "Chop down 1000 units of tree with a Digtron" +msgstr "" + +#: awards.lua:330 +msgid "Digtron Deforestation" +msgstr "" + +#: awards.lua:331 +msgid "Chop down 10,000 units of tree with a Digtron" +msgstr "" + +#: awards.lua:337 +msgid "Lawnmower" +msgstr "" + +#: awards.lua:338 +msgid "Harvest 1000 units of grass with a Digtron" +msgstr "" + +#: awards.lua:344 +msgid "Iron Digtron" +msgstr "" + +#: awards.lua:345 +msgid "Excavate 1000 units of iron ore with a Digtron" +msgstr "" + +#: awards.lua:351 +msgid "Copper Digtron" +msgstr "" + +#: awards.lua:352 +msgid "Excavate 1000 units of copper ore with a Digtron" +msgstr "" + +#: awards.lua:358 +msgid "Coal Digtron" +msgstr "" + +#: awards.lua:359 +msgid "Excavate 1,000 units if coal with a Digtron" +msgstr "" + +#: awards.lua:365 +msgid "Bagger 288" +msgstr "" + +#: awards.lua:366 +msgid "Excavate 10,000 units of coal with a Digtron" +msgstr "" + +#: awards.lua:372 +msgid "Digtron 49er" +msgstr "" + +#: awards.lua:373 +msgid "Excavate 100 units of gold with a Digtron" +msgstr "" + +#: awards.lua:379 +msgid "Constructive Digging" +msgstr "" + +#: awards.lua:380 +msgid "Build 1,000 blocks with a Digtron" +msgstr "" + +#: awards.lua:386 +msgid "Highly Constructive Digging" +msgstr "" + +#: awards.lua:387 +msgid "Build 10,000 blocks with a Digtron" +msgstr "" + +#: awards.lua:393 +msgid "Digtron Packrat" +msgstr "" + +#: awards.lua:394 +msgid "Stored 10 or more Digtron blocks in one crate." +msgstr "" + +#: awards.lua:400 +msgid "Digtron Hoarder" +msgstr "" + +#: awards.lua:401 +msgid "Stored 100 or more Digtron blocks in one crate." +msgstr "" + +#: node_axle.lua:6 +msgid "Digtron Rotation Axle" +msgstr "" + +#: node_axle.lua:57 util_execute_cycle.lua:172 util_execute_cycle.lua:365 +#: util_execute_cycle.lua:454 +msgid "Digtron is obstructed." +msgstr "" + +#: node_builders.lua:13 +msgid "Block to build" +msgstr "" + +#: node_builders.lua:14 node_diggers.lua:32 +msgid "Periodicity" +msgstr "" + +#: node_builders.lua:15 +msgid "" +"Builder will build once every n steps.\n" +"These steps are globally aligned, so all builders with the\n" +"same period and offset will build on the same location." +msgstr "" + +#: node_builders.lua:16 node_controllers.lua:91 node_diggers.lua:34 +msgid "Offset" +msgstr "" + +#: node_builders.lua:17 +msgid "" +"Offsets the start of periodicity counting by this amount.\n" +"For example, a builder with period 2 and offset 0 builds\n" +"every even-numbered block and one with period 2 and\n" +"offset 1 builds every odd-numbered block." +msgstr "" + +#: node_builders.lua:18 +msgid "" +"Save &\n" +"Show" +msgstr "" + +#: node_builders.lua:19 node_diggers.lua:37 +msgid "Saves settings" +msgstr "" + +#: node_builders.lua:20 +msgid "Facing" +msgstr "" + +#: node_builders.lua:21 +msgid "" +"Value from 0-23. Not all block types make use of this.\n" +"Use the 'Read & Save' button to copy the facing of the block\n" +"currently in the builder output location." +msgstr "" + +#: node_builders.lua:22 +msgid "" +"Read &\n" +"Save" +msgstr "" + +#: node_builders.lua:23 +msgid "" +"Reads the facing of the block currently in the build location,\n" +"then saves all settings." +msgstr "" + +#: node_builders.lua:32 node_controllers.lua:106 node_crate.lua:62 +#: node_diggers.lua:43 +msgid "Help" +msgstr "" + +#: node_builders.lua:33 node_controllers.lua:107 node_crate.lua:63 +#: node_diggers.lua:44 +msgid "Show documentation about this block" +msgstr "" + +#: node_builders.lua:38 +msgid "Digtron Builder Module" +msgstr "" + +#: node_builders.lua:241 node_builders.lua:255 +#, c-format +msgid "%s uses Digtron to build %s at (%d, %d, %d), displacing %s" +msgstr "" + +#: node_controllers.lua:20 +msgid "Digtron Control Module" +msgstr "" + +#: node_controllers.lua:48 node_controllers.lua:200 util_execute_cycle.lua:110 +#: util_execute_cycle.lua:315 util_execute_cycle.lua:392 +#: util_execute_cycle.lua:503 +#, c-format +msgid "Heat remaining in controller furnace: %d" +msgstr "" + +#: node_controllers.lua:83 +msgid "Cycles" +msgstr "" + +#: node_controllers.lua:84 +msgid "" +"When triggered, this controller will try to run for the given number of " +"cycles.\n" +"The cycle count will decrement as it runs, so if it gets halted by a " +"problem\n" +"you can fix the problem and restart." +msgstr "" + +#: node_controllers.lua:85 +msgid "Set" +msgstr "" + +#: node_controllers.lua:86 +msgid "Saves the cycle setting without starting the controller running" +msgstr "" + +#: node_controllers.lua:87 +msgid "" +"Set &\n" +"Execute" +msgstr "" + +#: node_controllers.lua:88 +msgid "Begins executing the given number of cycles" +msgstr "" + +#: node_controllers.lua:89 +msgid "Slope" +msgstr "" + +#: node_controllers.lua:90 +msgid "" +"For diagonal digging. After every X nodes the auto controller moves " +"forward,\n" +"the controller will add an additional cycle moving the digtron laterally in " +"the\n" +"direction of the arrows on the side of this controller.\n" +"Set to 0 for no lateral digging." +msgstr "" + +#: node_controllers.lua:92 +msgid "" +"Sets the offset of the lateral motion defined in the Slope field.\n" +"Note: this offset is relative to the controller's location.\n" +"The controller will move down when it reaches the indicated point." +msgstr "" + +#: node_controllers.lua:93 +msgid "Delay" +msgstr "" + +#: node_controllers.lua:94 +msgid "Number of seconds to wait between each cycle" +msgstr "" + +#: node_controllers.lua:96 +msgid "Stop block" +msgstr "" + +#: node_controllers.lua:128 node_controllers.lua:147 node_controllers.lua:160 +#, c-format +msgid "Cycles remaining: %d" +msgstr "" + +#: node_controllers.lua:128 node_controllers.lua:147 +msgid "Halted!" +msgstr "" + +#: node_controllers.lua:172 +msgid "Digtron Automatic Control Module" +msgstr "" + +#: node_controllers.lua:284 +msgid "Interrupted!" +msgstr "" + +#: node_controllers.lua:300 +msgid "Digtron Pusher Module" +msgstr "" + +#: node_crate.lua:6 +msgid "Digtron Crate (Empty)" +msgstr "" + +#: node_crate.lua:22 +msgid "Digtron can't be packaged, it contains protected blocks" +msgstr "" + +#: node_crate.lua:42 node_crate.lua:43 +msgid "Crated Digtron" +msgstr "" + +#: node_crate.lua:55 node_crate.lua:70 +msgid "Digtron Name" +msgstr "" + +#: node_crate.lua:56 node_crate.lua:71 +msgid "" +"Save\n" +"Title" +msgstr "" + +#: node_crate.lua:57 node_crate.lua:72 +msgid "Saves the title of this Digtron" +msgstr "" + +#: node_crate.lua:58 node_crate.lua:73 +msgid "" +"Show\n" +"Blocks" +msgstr "" + +#: node_crate.lua:59 node_crate.lua:74 +msgid "Shows which blocks the packed Digtron will occupy if unpacked" +msgstr "" + +#: node_crate.lua:60 node_crate.lua:75 +msgid "Unpack" +msgstr "" + +#: node_crate.lua:61 node_crate.lua:76 +msgid "Attempts to unpack the Digtron on this location" +msgstr "" + +#: node_crate.lua:80 +msgid "Digtron Crate (Loaded)" +msgstr "" + +#: node_crate.lua:114 +msgid "" +"Unable to read layout from crate metadata, regrettably this Digtron may be " +"corrupted or lost." +msgstr "" + +#: node_crate.lua:145 +msgid "Unable to deploy Digtron due to protected blocks in target area" +msgstr "" + +#: node_crate.lua:151 +msgid "Unable to deploy Digtron due to obstruction in target area" +msgstr "" + +#: node_diggers.lua:33 +msgid "" +"Digger will dig once every n steps.\n" +"These steps are globally aligned, all diggers with\n" +"the same period and offset will dig on the same location." +msgstr "" + +#: node_diggers.lua:35 +msgid "" +"Offsets the start of periodicity counting by this amount.\n" +"For example, a digger with period 2 and offset 0 digs\n" +"every even-numbered block and one with period 2 and\n" +"offset 1 digs every odd-numbered block." +msgstr "" + +#: node_diggers.lua:36 +msgid "Save" +msgstr "" + +#: node_diggers.lua:72 +msgid "Digtron Digger Head" +msgstr "" + +#: node_diggers.lua:125 +msgid "Digtron Intermittent Digger Head" +msgstr "" + +#: node_diggers.lua:195 +msgid "Digtron Soft Material Digger Head" +msgstr "" + +#: node_diggers.lua:250 +msgid "Digtron Intermittent Soft Material Digger Head" +msgstr "" + +#: node_diggers.lua:323 +msgid "Digtron Dual Digger Head" +msgstr "" + +#: node_diggers.lua:400 +msgid "Digtron Dual Soft Material Digger Head" +msgstr "" + +#: node_misc.lua:7 +msgid "Digtron Structure" +msgstr "" + +#: node_misc.lua:40 +msgid "Digtron Light" +msgstr "" + +#: node_misc.lua:62 +msgid "Digtron Panel" +msgstr "" + +#: node_misc.lua:85 +msgid "Digtron Edge Panel" +msgstr "" + +#: node_misc.lua:114 +msgid "Digtron Corner Panel" +msgstr "" + +#: node_storage.lua:8 +msgid "Digtron Inventory Storage" +msgstr "" + +#: node_storage.lua:34 node_storage.lua:190 +msgid "Inventory items" +msgstr "" + +#: node_storage.lua:77 +msgid "Digtron Fuel Storage" +msgstr "" + +#: node_storage.lua:103 node_storage.lua:192 +msgid "Fuel items" +msgstr "" + +#: node_storage.lua:166 +msgid "Digtron Combined Storage" +msgstr "" + +#: recipes.lua:6 +msgid "Digtron Core" +msgstr "" + +#: util_execute_cycle.lua:51 +msgid "Digtron is adjacent to unloaded nodes." +msgstr "" + +#: util_execute_cycle.lua:219 +msgid "Digtron needs more fuel." +msgstr "" + +#: util_execute_cycle.lua:229 +msgid "" +"Digtron connected to at least one builder with no output material assigned." +msgstr "" + +#: util_execute_cycle.lua:233 +#, c-format +msgid "Digtron has insufficient building materials. Needed: %s" +msgstr "" + +#: util_execute_cycle.lua:302 +msgid "" +"Digtron unexpectedly failed to execute one or more build operations, likely " +"due to an inventory error." +msgstr "" + +#: util_execute_cycle.lua:327 util_execute_cycle.lua:515 +#, c-format +msgid "%s uses Digtron to dig %s at (%d, %d, %d)" +msgstr "" diff --git a/node_axle.lua b/node_axle.lua index 7294fc9..8726ab8 100644 --- a/node_axle.lua +++ b/node_axle.lua @@ -1,5 +1,9 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + minetest.register_node("digtron:axle", { - description = "Digtron Rotation Axle", + description = S("Digtron Rotation Axle"), _doc_items_longdesc = digtron.doc.axle_longdesc, _doc_items_usagehelp = digtron.doc.axle_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, @@ -50,7 +54,7 @@ minetest.register_node("digtron:axle", { minetest.get_node_timer(pos):start(digtron.cycle_time*2) else minetest.sound_play("buzzer", {gain=1.0, pos=pos}) - meta:set_string("infotext", "Digtron is obstructed.") + meta:set_string("infotext", S("Digtron is obstructed.")) end end, diff --git a/node_builders.lua b/node_builders.lua index e7faf0c..d7910c0 100644 --- a/node_builders.lua +++ b/node_builders.lua @@ -1,3 +1,7 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + -- Note: builders go in group 4 and have both test_build and execute_build methods. local builder_formspec = @@ -6,17 +10,17 @@ local builder_formspec = default.gui_bg_img .. default.gui_slots .. "list[current_name;main;0.5,0;1,1;]" .. - "label[0.5,0.8;Block to build]" .. - "field[2.3,0.8;1,0.1;period;Periodicity;${period}]" .. - "tooltip[period;Builder will build once every n steps.\nThese steps are globally aligned, so all builders with the\nsame period and offset will build on the same location.]" .. - "field[3.3,0.8;1,0.1;offset;Offset;${offset}]" .. - "tooltip[offset;Offsets the start of periodicity counting by this amount.\nFor example, a builder with period 2 and offset 0 builds\nevery even-numbered block and one with period 2 and\noffset 1 builds every odd-numbered block.]" .. - "button_exit[4.0,0.5;1,0.1;set;Save &\nShow]" .. - "tooltip[set;Saves settings]" .. - "field[5.3,0.8;1,0.1;build_facing;Facing;${build_facing}]" .. - "tooltip[build_facing;Value from 0-23. Not all block types make use of this.\nUse the 'Read & Save' button to copy the facing of the block\ncurrently in the builder output location]" .. - "button_exit[6.0,0.5;1,0.1;read;Read &\nSave]" .. - "tooltip[read;Reads the facing of the block currently in the build location,\nthen saves all settings]" .. + "label[0.5,0.8;" .. S("Block to build") .. "]" .. + "field[2.3,0.8;1,0.1;period;" .. S("Periodicity") .. ";${period}]" .. + "tooltip[period;" .. S("Builder will build once every n steps.\nThese steps are globally aligned, so all builders with the\nsame period and offset will build on the same location.") .. "]" .. + "field[3.3,0.8;1,0.1;offset;" .. S("Offset") .. ";${offset}]" .. + "tooltip[offset;" .. S("Offsets the start of periodicity counting by this amount.\nFor example, a builder with period 2 and offset 0 builds\nevery even-numbered block and one with period 2 and\noffset 1 builds every odd-numbered block.") .. "]" .. + "button_exit[4.0,0.5;1,0.1;set;" .. S("Save &\nShow") .. "]" .. + "tooltip[set;" .. S("Saves settings") .. "]" .. + "field[5.3,0.8;1,0.1;build_facing;" .. S("Facing") .. ";${build_facing}]" .. + "tooltip[build_facing;" .. S("Value from 0-23. Not all block types make use of this.\nUse the 'Read & Save' button to copy the facing of the block\ncurrently in the builder output location.") .. "]" .. + "button_exit[6.0,0.5;1,0.1;read;" .. S("Read &\nSave") .. "]" .. + "tooltip[read;" .. S("Reads the facing of the block currently in the build location,\nthen saves all settings.") .. "]" .. "list[current_player;main;0,1.3;8,1;]" .. default.get_hotbar_bg(0,1.3) .. "list[current_player;main;0,2.5;8,3;8]" .. @@ -25,13 +29,13 @@ local builder_formspec = if minetest.get_modpath("doc") then builder_formspec = builder_formspec .. - "button_exit[7.0,0.5;1,0.1;help;Help]" .. - "tooltip[help;Show documentation about this block]" + "button_exit[7.0,0.5;1,0.1;help;" .. S("Help") .. "]" .. + "tooltip[help;" .. S("Show documentation about this block") .. "]" end -- Builds objects in the targeted node. This is a complicated beastie. minetest.register_node("digtron:builder", { - description = "Digtron Builder Module", + description = S("Digtron Builder Module"), _doc_items_longdesc = digtron.doc.builder_longdesc, _doc_items_usagehelp = digtron.doc.builder_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 4}, @@ -234,7 +238,7 @@ minetest.register_node("digtron:builder", { if digtron.creative_mode then local returned_stack, success = digtron.item_place_node(item_stack, player, buildpos, tonumber(build_facing)) if success == true then - minetest.log("action", string.format("%s uses Digtron to build %s at (%d, %d, %d), displacing %s", player:get_player_name(), item_stack:get_name(), buildpos.x, buildpos.y, buildpos.z, oldnode.name)) + minetest.log("action", string.format(S("%s uses Digtron to build %s at (%d, %d, %d), displacing %s"), player:get_player_name(), item_stack:get_name(), buildpos.x, buildpos.y, buildpos.z, oldnode.name)) nodes_dug:set(buildpos.x, buildpos.y, buildpos.z, false) return true end @@ -248,7 +252,7 @@ minetest.register_node("digtron:builder", { end local returned_stack, success = digtron.item_place_node(item_stack, player, buildpos, tonumber(build_facing)) if success == true then - minetest.log("action", string.format("%s uses Digtron to build %s at (%d, %d, %d), displacing %s", player:get_player_name(), item_stack:get_name(), buildpos.x, buildpos.y, buildpos.z, oldnode.name)) + minetest.log("action", string.format(S("%s uses Digtron to build %s at (%d, %d, %d), displacing %s"), player:get_player_name(), item_stack:get_name(), buildpos.x, buildpos.y, buildpos.z, oldnode.name)) --flag this node as *not* to be dug. nodes_dug:set(buildpos.x, buildpos.y, buildpos.z, false) digtron.award_item_built(item_stack:get_name(), player:get_player_name()) diff --git a/node_controllers.lua b/node_controllers.lua index 2a3c629..e818881 100644 --- a/node_controllers.lua +++ b/node_controllers.lua @@ -1,3 +1,7 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + local controller_nodebox ={ {-0.3125, -0.3125, -0.3125, 0.3125, 0.3125, 0.3125}, -- Core {-0.1875, 0.3125, -0.1875, 0.1875, 0.5, 0.1875}, -- +y_connector @@ -13,7 +17,7 @@ local controller_nodebox ={ -- Master controller. Most complicated part of the whole system. Determines which direction a digtron moves and triggers all of its component parts. minetest.register_node("digtron:controller", { - description = "Digtron Control Module", + description = S("Digtron Control Module"), _doc_items_longdesc = digtron.doc.controller_longdesc, _doc_items_usagehelp = digtron.doc.controller_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand = 3, digtron = 1}, @@ -41,7 +45,7 @@ minetest.register_node("digtron:controller", { on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_float("fuel_burning", 0.0) - meta:set_string("infotext", "Heat remaining in controller furnace: 0") + meta:set_string("infotext", string.format(S("Heat remaining in controller furnace: %d"), 0)) end, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) @@ -76,20 +80,20 @@ local auto_formspec = "size[8,6.2]" .. default.gui_bg_img .. default.gui_slots .. "container[2.0,0]" .. - "field[0.0,0.8;1,0.1;cycles;Cycles;${cycles}]" .. - "tooltip[cycles;When triggered, this controller will try to run for the given number of cycles.\nThe cycle count will decrement as it runs, so if it gets halted by a problem\nyou can fix the problem and restart.]" .. - "button_exit[0.7,0.5;1,0.1;set;Set]" .. - "tooltip[set;Saves the cycle setting without starting the controller running]" .. - "button_exit[1.7,0.5;1,0.1;execute;Set &\nExecute]" .. - "tooltip[execute;Begins executing the given number of cycles]" .. - "field[0.0,2.0;1,0.1;slope;Slope;${slope}]" .. - "tooltip[slope;For diagonal digging. After every X nodes the auto controller moves forward,\nthe controller will add an additional cycle moving the digtron laterally in the\ndirection of the arrows on the side of this controller.\nSet to 0 for no lateral digging.]" .. - "field[1.0,2.0;1,0.1;offset;Offset;${offset}]" .. - "tooltip[offset;Sets the offset of the lateral motion defined in the Slope field.\nNote: this offset is relative to the controller's location.\nThe controller will move down when it reaches the indicated point.]" .. - "field[2.0,2.0;1,0.1;period;Delay;${period}]" .. - "tooltip[period;Number of seconds to wait between each cycle]" .. + "field[0.0,0.8;1,0.1;cycles;" .. S("Cycles").. ";${cycles}]" .. + "tooltip[cycles;" .. S("When triggered, this controller will try to run for the given number of cycles.\nThe cycle count will decrement as it runs, so if it gets halted by a problem\nyou can fix the problem and restart.").. "]" .. + "button_exit[0.7,0.5;1,0.1;set;" .. S("Set").. "]" .. + "tooltip[set;" .. S("Saves the cycle setting without starting the controller running").. "]" .. + "button_exit[1.7,0.5;1,0.1;execute;" .. S("Set &\nExecute").. "]" .. + "tooltip[execute;" .. S("Begins executing the given number of cycles").. "]" .. + "field[0.0,2.0;1,0.1;slope;" .. S("Slope").. ";${slope}]" .. + "tooltip[slope;" .. S("For diagonal digging. After every X nodes the auto controller moves forward,\nthe controller will add an additional cycle moving the digtron laterally in the\ndirection of the arrows on the side of this controller.\nSet to 0 for no lateral digging.").. "]" .. + "field[1.0,2.0;1,0.1;offset;" .. S("Offset").. ";${offset}]" .. + "tooltip[offset;" .. S("Sets the offset of the lateral motion defined in the Slope field.\nNote: this offset is relative to the controller's location.\nThe controller will move down when it reaches the indicated point.").. "]" .. + "field[2.0,2.0;1,0.1;period;" .. S("Delay").. ";${period}]" .. + "tooltip[period;" .. S("Number of seconds to wait between each cycle").. "]" .. "list[current_name;stop;3.0,0.7;1,1;]" .. - "label[3.0,1.5;Stop block]" .. + "label[3.0,1.5;" .. S("Stop block").. "]" .. "container_end[]" .. "list[current_player;main;0,2.3;8,1;]" .. default.get_hotbar_bg(0,2.3) .. @@ -99,8 +103,8 @@ local auto_formspec = "size[8,6.2]" .. if minetest.get_modpath("doc") then auto_formspec = auto_formspec .. - "button_exit[7.0,0.5;1,0.1;help;Help]" .. - "tooltip[help;Show documentation about this block]" + "button_exit[7.0,0.5;1,0.1;help;" .. S("Help") .. "]" .. + "tooltip[help;" .. S("Show documentation about this block").. "]" end -- Needed to make this global so that it could recurse into minetest.after @@ -121,7 +125,7 @@ digtron.auto_cycle = function(pos) local newpos, status, return_code = digtron.execute_downward_dig_cycle(pos, player) if vector.equals(pos, newpos) then - status = status .. string.format("\nCycles remaining: %d\nHalted!", cycle) + status = status .. string.format("\n" .. S("Cycles remaining: %d") .. "\n" .. S("Halted!"), cycle) meta:set_string("infotext", status) if return_code == 1 then --return code 1 happens when there's unloaded nodes adjacent, just keep trying. minetest.after(meta:get_int("period"), digtron.auto_cycle, newpos) @@ -140,7 +144,7 @@ digtron.auto_cycle = function(pos) local newpos, status, return_code = digtron.execute_dig_cycle(pos, player) if vector.equals(pos, newpos) then - status = status .. string.format("\nCycles remaining: %d\nHalted!", cycle) + status = status .. string.format("\n" .. S("Cycles remaining: %d") .. "\n" .. S("Halted!"), cycle) meta:set_string("infotext", status) if return_code == 1 then --return code 1 happens when there's unloaded nodes adjacent, just keep trying. minetest.after(meta:get_int("period"), digtron.auto_cycle, newpos) @@ -153,7 +157,7 @@ digtron.auto_cycle = function(pos) meta = minetest.get_meta(newpos) cycle = meta:get_int("cycles") - 1 meta:set_int("cycles", cycle) - status = status .. string.format("\nCycles remaining: %d", cycle) + status = status .. string.format("\n" .. S("Cycles remaining: %d"), cycle) meta:set_string("infotext", status) meta:set_string("lateral_done", nil) @@ -165,7 +169,7 @@ digtron.auto_cycle = function(pos) end minetest.register_node("digtron:auto_controller", { - description = "Digtron Automatic Control Module", + description = S("Digtron Automatic Control Module"), _doc_items_longdesc = digtron.doc.auto_controller_longdesc, _doc_items_usagehelp = digtron.doc.auto_controller_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand = 3, digtron = 1}, @@ -193,7 +197,7 @@ minetest.register_node("digtron:auto_controller", { on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_float("fuel_burning", 0.0) - meta:set_string("infotext", "Heat remaining in controller furnace: 0") + meta:set_string("infotext", string.format(S("Heat remaining in controller furnace: %d"), 0)) meta:set_string("formspec", auto_formspec) -- Reusing offset and period to keep the digtron node-moving code simple, and the names still fit well meta:set_int("period", digtron.cycle_time) @@ -277,7 +281,7 @@ minetest.register_node("digtron:auto_controller", { on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local meta = minetest.get_meta(pos) - meta:set_string("infotext", meta:get_string("infotext") .. "\nInterrupted!") + meta:set_string("infotext", meta:get_string("infotext") .. "\n" .. S("Interrupted!")) meta:set_string("waiting", "true") meta:set_string("formspec", auto_formspec) end, @@ -293,7 +297,7 @@ minetest.register_node("digtron:auto_controller", { -- A much simplified control unit that only moves the digtron, and doesn't trigger the diggers or builders. -- Handy for shoving a digtron to the side if it's been built a bit off. minetest.register_node("digtron:pusher", { - description = "Digtron Pusher Module", + description = S("Digtron Pusher Module"), _doc_items_longdesc = digtron.doc.pusher_longdesc, _doc_items_usagehelp = digtron.doc.pusher_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, diff --git a/node_crate.lua b/node_crate.lua index 21c056a..7e41a8e 100644 --- a/node_crate.lua +++ b/node_crate.lua @@ -1,5 +1,9 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + minetest.register_node("digtron:empty_crate", { - description = "Digtron Crate (Empty)", + description = S("Digtron Crate (Empty)"), _doc_items_longdesc = digtron.doc.empty_crate_longdesc, _doc_items_usagehelp = digtron.doc.empty_crate_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3}, @@ -15,7 +19,7 @@ minetest.register_node("digtron:empty_crate", { if layout.contains_protected_node then local meta = minetest.get_meta(pos) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) - meta:set_string("infotext", "Digtron can't be packaged, it contains protected blocks") + meta:set_string("infotext", S("Digtron can't be packaged, it contains protected blocks")) -- no stealing other peoples' digtrons return end @@ -35,8 +39,8 @@ minetest.register_node("digtron:empty_crate", { local meta = minetest.get_meta(pos) meta:set_string("crated_layout", layout_string) - meta:set_string("title", "Crated Digtron") - meta:set_string("infotext", "Crated Digtron") + meta:set_string("title", S("Crated Digtron")) + meta:set_string("infotext", S("Crated Digtron")) end, }) @@ -48,32 +52,32 @@ if minetest.get_modpath("doc") then default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "field[0.3,0.5;4,0.5;title;Digtron Name;${title}]" .. - "button_exit[0.0,1.2;1,0.1;save;Save\nTitle]" .. - "tooltip[save;Saves the title of this Digtron]" .. - "button_exit[1.0,1.2;1,0.1;show;Show\nBlocks]" .. - "tooltip[show;Shows which blocks the packed Digtron will occupy if unpacked]" .. - "button_exit[2.0,1.2;1,0.1;unpack;Unpack]" .. - "tooltip[unpack;Attempts to unpack the Digtron on this location]" .. - "button_exit[3.0,1.2;1,0.1;help;Help]" .. - "tooltip[help;Show documentation about this block]" + "field[0.3,0.5;4,0.5;title;" .. S("Digtron Name") .. ";${title}]" .. + "button_exit[0.0,1.2;1,0.1;save;" .. S("Save\nTitle") .. "]" .. + "tooltip[save;" .. S("Saves the title of this Digtron") .. "]" .. + "button_exit[1.0,1.2;1,0.1;show;" .. S("Show\nBlocks") .. "]" .. + "tooltip[show;" .. S("Shows which blocks the packed Digtron will occupy if unpacked") .. "]" .. + "button_exit[2.0,1.2;1,0.1;unpack;" .. S("Unpack") .. "]" .. + "tooltip[unpack;" .. S("Attempts to unpack the Digtron on this location") .. "]" .. + "button_exit[3.0,1.2;1,0.1;help;" .. S("Help") .. "]" .. + "tooltip[help;" .. S("Show documentation about this block") .. "]" else loaded_formspec = "size[4,1.5]" .. default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "field[0.3,0.5;4,0.5;title;Digtron Name;${title}]" .. - "button_exit[0.5,1.2;1,0.1;save;Save\nTitle]" .. - "tooltip[show;Saves the title of this Digtron]" .. - "button_exit[1.5,1.2;1,0.1;show;Show\nBlocks]" .. - "tooltip[save;Shows which blocks the packed Digtron will occupy if unpacked]" .. - "button_exit[2.5,1.2;1,0.1;unpack;Unpack]" .. - "tooltip[unpack;Attempts to unpack the Digtron on this location]" + "field[0.3,0.5;4,0.5;title;" .. S("Digtron Name") .. ";${title}]" .. + "button_exit[0.5,1.2;1,0.1;save;" .. S("Save\nTitle") .. "]" .. + "tooltip[show;" .. S("Saves the title of this Digtron") .. "]" .. + "button_exit[1.5,1.2;1,0.1;show;" .. S("Show\nBlocks") .. "]" .. + "tooltip[save;" .. S("Shows which blocks the packed Digtron will occupy if unpacked") .. "]" .. + "button_exit[2.5,1.2;1,0.1;unpack;" .. S("Unpack") .. "]" .. + "tooltip[unpack;" .. S("Attempts to unpack the Digtron on this location") .. "]" end minetest.register_node("digtron:loaded_crate", { - description = "Digtron Crate (Loaded)", + description = S("Digtron Crate (Loaded)"), _doc_items_longdesc = digtron.doc.loaded_crate_longdesc, _doc_items_usagehelp = digtron.doc.loaded_crate_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, not_in_creative_inventory=1, digtron_protected=1}, @@ -107,7 +111,7 @@ minetest.register_node("digtron:loaded_crate", { local layout = DigtronLayout.deserialize(layout_string) if layout == nil then - meta:set_string("infotext", meta:get_string("title") .. "\nUnable to read layout from crate metadata, regrettably this Digtron may be corrupted or lost.") + meta:set_string("infotext", meta:get_string("title") .. "\n" .. S("Unable to read layout from crate metadata, regrettably this Digtron may be corrupted or lost.")) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) -- Something went horribly wrong return @@ -138,13 +142,13 @@ minetest.register_node("digtron:loaded_crate", { end if protected_node then - meta:set_string("infotext", meta:get_string("title") .. "\nUnable to deploy Digtron due to protected blocks in target area") + meta:set_string("infotext", meta:get_string("title") .. "\n" .. S("Unable to deploy Digtron due to protected blocks in target area")) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) return end if obstructed_node then - meta:set_string("infotext", meta:get_string("title") .. "\nUnable to deploy Digtron due to obstruction in target area") + meta:set_string("infotext", meta:get_string("title") .. "\n" .. S("Unable to deploy Digtron due to obstruction in target area")) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) return end diff --git a/node_diggers.lua b/node_diggers.lua index 7505606..dc8ddfc 100644 --- a/node_diggers.lua +++ b/node_diggers.lua @@ -1,3 +1,7 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + -- Note: diggers go in group 3 and have an execute_dig method. local digger_nodebox = { @@ -25,19 +29,19 @@ local intermittent_formspec = default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "field[0.5,0.8;1,0.1;period;Periodicity;${period}]" .. - "tooltip[period;Digger will dig once every n steps.\nThese steps are globally aligned, all diggers with\nthe same period and offset will dig on the same location.]" .. - "field[1.5,0.8;1,0.1;offset;Offset;${offset}]" .. - "tooltip[offset;Offsets the start of periodicity counting by this amount.\nFor example, a digger with period 2 and offset 0 digs\nevery even-numbered block and one with period 2 and\noffset 1 digs every odd-numbered block.]" .. - "button_exit[2.2,0.5;1,0.1;set;Save]" .. - "tooltip[set;Saves settings]" + "field[0.5,0.8;1,0.1;period;" .. S("Periodicity") .. ";${period}]" .. + "tooltip[period;" .. S("Digger will dig once every n steps.\nThese steps are globally aligned, all diggers with\nthe same period and offset will dig on the same location.") .. "]" .. + "field[1.5,0.8;1,0.1;offset;" .. S("Offset") .. ";${offset}]" .. + "tooltip[offset;" .. S("Offsets the start of periodicity counting by this amount.\nFor example, a digger with period 2 and offset 0 digs\nevery even-numbered block and one with period 2 and\noffset 1 digs every odd-numbered block.") .. "]" .. + "button_exit[2.2,0.5;1,0.1;set;" .. S("Save") .. "]" .. + "tooltip[set;" .. S("Saves settings") .. "]" local intermittent_on_construct = function(pos) local formspec = intermittent_formspec if minetest.get_modpath("doc") then formspec = "size[4.5,1]" .. formspec .. - "button_exit[3.2,0.5;1,0.1;help;Help]" .. - "tooltip[help;Show documentation about this block]" + "button_exit[3.2,0.5;1,0.1;help;" .. S("Help") .. "]" .. + "tooltip[help;" .. S("Show documentation about this block") .. "]" else formspec = "size[3.5,1]" .. formspec end @@ -65,7 +69,7 @@ end, -- Digs out nodes that are "in front" of the digger head. minetest.register_node("digtron:digger", { - description = "Digtron Digger Head", + description = S("Digtron Digger Head"), _doc_items_longdesc = digtron.doc.digger_longdesc, _doc_items_usagehelp = digtron.doc.digger_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 3}, @@ -118,7 +122,7 @@ minetest.register_node("digtron:digger", { -- Digs out nodes that are "in front" of the digger head. minetest.register_node("digtron:intermittent_digger", { - description = "Digtron Intermittent Digger Head", + description = S("Digtron Intermittent Digger Head"), _doc_items_longdesc = digtron.doc.intermittent_digger_longdesc, _doc_items_usagehelp = digtron.doc.intermittent_digger_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 3}, @@ -188,7 +192,7 @@ minetest.register_node("digtron:intermittent_digger", { -- A special-purpose digger to deal with stuff like sand and gravel in the ceiling. It always digs (no periodicity or offset), but it only digs falling_block nodes minetest.register_node("digtron:soft_digger", { - description = "Digtron Soft Material Digger Head", + description = S("Digtron Soft Material Digger Head"), _doc_items_longdesc = digtron.doc.soft_digger_longdesc, _doc_items_usagehelp = digtron.doc.soft_digger_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 3}, @@ -243,7 +247,7 @@ minetest.register_node("digtron:soft_digger", { }) minetest.register_node("digtron:intermittent_soft_digger", { - description = "Digtron Intermittent Soft Material Digger Head", + description = S("Digtron Intermittent Soft Material Digger Head"), _doc_items_longdesc = digtron.doc.intermittent_soft_digger_longdesc, _doc_items_usagehelp = digtron.doc.intermittent_soft_digger_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 3}, @@ -316,7 +320,7 @@ minetest.register_node("digtron:intermittent_soft_digger", { -- Digs out nodes that are "in front" of the digger head and "below" the digger head (can be rotated). minetest.register_node("digtron:dual_digger", { - description = "Digtron Dual Digger Head", + description = S("Digtron Dual Digger Head"), _doc_items_longdesc = digtron.doc.dual_digger_longdesc, _doc_items_usagehelp = digtron.doc.dual_digger_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 3}, @@ -393,7 +397,7 @@ minetest.register_node("digtron:dual_digger", { -- Digs out soft nodes that are "in front" of the digger head and "below" the digger head (can be rotated). minetest.register_node("digtron:dual_soft_digger", { - description = "Digtron Dual Soft Material Digger Head", + description = S("Digtron Dual Soft Material Digger Head"), _doc_items_longdesc = digtron.doc.dual_soft_digger_longdesc, _doc_items_usagehelp = digtron.doc.dual_soft_digger_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 3}, diff --git a/node_misc.lua b/node_misc.lua index d4b71d3..e847045 100644 --- a/node_misc.lua +++ b/node_misc.lua @@ -1,6 +1,10 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + -- A do-nothing "structural" node, to ensure all digtron nodes that are supposed to be connected to each other can be connected to each other. minetest.register_node("digtron:structure", { - description = "Digtron Structure", + description = S("Digtron Structure"), _doc_items_longdesc = digtron.doc.structure_longdesc, _doc_items_usagehelp = digtron.doc.structure_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, @@ -33,7 +37,7 @@ minetest.register_node("digtron:structure", { -- A modest light source that will move with the digtron, handy for working in a tunnel you aren't bothering to install permanent lights in. minetest.register_node("digtron:light", { - description = "Digtron Light", + description = S("Digtron Light"), _doc_items_longdesc = digtron.doc.light_longdesc, _doc_items_usagehelp = digtron.doc.light_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, @@ -55,7 +59,7 @@ minetest.register_node("digtron:light", { -- A simple structural panel minetest.register_node("digtron:panel", { - description = "Digtron Panel", + description = S("Digtron Panel"), _doc_items_longdesc = digtron.doc.panel_longdesc, _doc_items_usagehelp = digtron.doc.panel_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, @@ -78,7 +82,7 @@ minetest.register_node("digtron:panel", { -- A simple structural panel minetest.register_node("digtron:edge_panel", { - description = "Digtron Edge Panel", + description = S("Digtron Edge Panel"), _doc_items_longdesc = digtron.doc.edge_panel_longdesc, _doc_items_usagehelp = digtron.doc.edge_panel_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, @@ -107,7 +111,7 @@ minetest.register_node("digtron:edge_panel", { }) minetest.register_node("digtron:corner_panel", { - description = "Digtron Corner Panel", + description = S("Digtron Corner Panel"), _doc_items_longdesc = digtron.doc.corner_panel_longdesc, _doc_items_usagehelp = digtron.doc.corner_panel_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 1}, diff --git a/node_storage.lua b/node_storage.lua index 51575ad..a85d35f 100644 --- a/node_storage.lua +++ b/node_storage.lua @@ -1,7 +1,11 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + -- Storage buffer. Builder nodes draw from this inventory and digger nodes deposit into it. -- Note that inventories are digtron group 2. minetest.register_node("digtron:inventory", { - description = "Digtron Inventory Storage", + description = S("Digtron Inventory Storage"), _doc_items_longdesc = digtron.doc.inventory_longdesc, _doc_items_usagehelp = digtron.doc.inventory_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 2, tubedevice = 1, tubedevice_receiver = 1}, @@ -27,7 +31,7 @@ minetest.register_node("digtron:inventory", { default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "label[0,0;Inventory items]" .. + "label[0,0;" .. S("Inventory items") .. "]" .. "list[current_name;main;0,0.6;8,4;]" .. "list[current_player;main;0,5.15;8,1;]" .. "list[current_player;main;0,6.38;8,3;8]" .. @@ -70,7 +74,7 @@ minetest.register_node("digtron:inventory", { -- Fuel storage. Controller node draws fuel from here. -- Note that fuel stores are digtron group 5. minetest.register_node("digtron:fuelstore", { - description = "Digtron Fuel Storage", + description = S("Digtron Fuel Storage"), _doc_items_longdesc = digtron.doc.fuelstore_longdesc, _doc_items_usagehelp = digtron.doc.fuelstore_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 5, tubedevice = 1, tubedevice_receiver = 1}, @@ -96,7 +100,7 @@ minetest.register_node("digtron:fuelstore", { default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "label[0,0;Fuel items]" .. + "label[0,0;" .. S("Fuel items") .. "]" .. "list[current_name;fuel;0,0.6;8,4;]" .. "list[current_player;main;0,5.15;8,1;]" .. "list[current_player;main;0,6.38;8,3;8]" .. @@ -159,7 +163,7 @@ minetest.register_node("digtron:fuelstore", { -- Combined storage. Group 6 has both an inventory and a fuel store minetest.register_node("digtron:combined_storage", { - description = "Digtron Combined Storage", + description = S("Digtron Combined Storage"), _doc_items_longdesc = digtron.doc.combined_storage_longdesc, _doc_items_usagehelp = digtron.doc.combined_storage_usagehelp, groups = {cracky = 3, oddly_breakable_by_hand=3, digtron = 6, tubedevice = 1, tubedevice_receiver = 1}, @@ -183,9 +187,9 @@ minetest.register_node("digtron:combined_storage", { default.gui_bg .. default.gui_bg_img .. default.gui_slots .. - "label[0,0;Inventory items]" .. + "label[0,0;" .. S("Inventory items") .. "]" .. "list[current_name;main;0,0.6;8,3;]" .. - "label[0,3.5;Fuel items]" .. + "label[0,3.5;" .. S("Fuel items") .. "]" .. "list[current_name;fuel;0,4.1;8,1;]" .. "list[current_player;main;0,5.75;8,1;]" .. "list[current_player;main;0,6.98;8,3;8]" .. diff --git a/recipes.lua b/recipes.lua index 5df3119..9895971 100644 --- a/recipes.lua +++ b/recipes.lua @@ -1,5 +1,9 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + minetest.register_craftitem("digtron:digtron_core", { - description = "Digtron Core", + description = S("Digtron Core"), inventory_image = "digtron_core.png", _doc_items_longdesc = digtron.doc.core_longdesc, _doc_items_usagehelp = digtron.doc.core_usagehelp, diff --git a/util_execute_cycle.lua b/util_execute_cycle.lua index dde9e2d..1dc47fa 100644 --- a/util_execute_cycle.lua +++ b/util_execute_cycle.lua @@ -1,3 +1,7 @@ +-- internationalization boilerplate +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + local dig_dust = function(pos, facing) local direction = minetest.facedir_to_dir(facing) return { @@ -44,7 +48,7 @@ local function neighbour_test(layout, status_text, dir) if layout.all == nil then -- get_all_digtron_neighbours returns nil if the digtron array touches unloaded nodes, too dangerous to do anything in that situation. Abort. minetest.sound_play("buzzer", {gain=0.25, pos=layout.controller}) - return "Digtron is adjacent to unloaded nodes.\n" .. status_text, 1 + return S("Digtron is adjacent to unloaded nodes.") .. "\n" .. status_text, 1 end if layout.water_touching == true then @@ -103,7 +107,7 @@ digtron.execute_dig_cycle = function(pos, clicker) local facing = minetest.get_node(pos).param2 local dir = minetest.facedir_to_dir(facing) local fuel_burning = meta:get_float("fuel_burning") -- get amount of burned fuel left over from last cycle - local status_text = string.format("Heat remaining in controller furnace: %d", math.max(0, fuel_burning)) + local status_text = string.format(S("Heat remaining in controller furnace: %d"), math.max(0, fuel_burning)) local layout = DigtronLayout.create(pos, clicker) @@ -165,7 +169,7 @@ digtron.execute_dig_cycle = function(pos, clicker) minetest.get_node_timer(pos):start(digtron.cycle_time) minetest.sound_play("squeal", {gain=1.0, pos=pos}) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) - return pos, "Digtron is obstructed.\n" .. status_text, 3 --Abort, don't dig and don't build. + return pos, S("Digtron is obstructed.") .. "\n" .. status_text, 3 --Abort, don't dig and don't build. end ---------------------------------------------------------------------------------------------------------------------- @@ -212,7 +216,7 @@ digtron.execute_dig_cycle = function(pos, clicker) if test_fuel_needed > fuel_burning + test_fuel_burned then minetest.sound_play("buzzer", {gain=0.5, pos=pos}) - return pos, "Digtron needs more fuel.", 4 -- abort, don't dig and don't build. + return pos, S("Digtron needs more fuel."), 4 -- abort, don't dig and don't build. end if not can_build then @@ -222,11 +226,11 @@ digtron.execute_dig_cycle = function(pos, clicker) local return_code = 5 if test_build_return_code == 3 then minetest.sound_play("honk", {gain=0.5, pos=pos}) -- A builder is not configured - return_string = "Digtron connected to at least one builder with no output material assigned.\n" + return_string = S("Digtron connected to at least one builder with no output material assigned.") .. "\n" return_code = 6 elseif test_build_return_code == 2 then minetest.sound_play("dingding", {gain=1.0, pos=pos}) -- Insufficient inventory - return_string = string.format("Digtron has insufficient building materials. Needed: %s\n", + return_string = string.format(S("Digtron has insufficient building materials. Needed: %s") .. "\n", test_build_return_item:get_name()) return_code = 7 end @@ -295,7 +299,7 @@ digtron.execute_dig_cycle = function(pos, clicker) -- We weren't able to detect this build failure ahead of time, so make a big noise now. This is strange, shouldn't happen. minetest.sound_play("dingding", {gain=1.0, pos=pos}) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) - status_text = "Digtron unexpectedly failed to execute one or more build operations, likely due to an inventory error.\n" + status_text = S("Digtron unexpectedly failed to execute one or more build operations, likely due to an inventory error.") .. "\n" end -- acutally burn the fuel needed @@ -308,7 +312,7 @@ digtron.execute_dig_cycle = function(pos, clicker) fuel_burning = fuel_burning + digtron.burn(layout.fuelstores, -fuel_burning, false) end meta:set_float("fuel_burning", fuel_burning) - status_text = status_text .. string.format("Heat remaining in controller furnace: %d", math.max(0, fuel_burning)) + status_text = status_text .. string.format(S("Heat remaining in controller furnace: %d"), math.max(0, fuel_burning)) -- Eyecandy for _, particles in pairs(particle_systems) do @@ -320,7 +324,7 @@ digtron.execute_dig_cycle = function(pos, clicker) local node_to_dig, whether_to_dig = layout.nodes_dug:pop() while node_to_dig ~= nil do if whether_to_dig == true then - minetest.log("action", string.format("%s uses Digtron to dig %s at (%d, %d, %d)", clicker:get_player_name(), minetest.get_node(node_to_dig).name, node_to_dig.x, node_to_dig.y, node_to_dig.z)) + minetest.log("action", string.format(S("%s uses Digtron to dig %s at (%d, %d, %d)"), clicker:get_player_name(), minetest.get_node(node_to_dig).name, node_to_dig.x, node_to_dig.y, node_to_dig.z)) minetest.remove_node(node_to_dig) end -- all of the digtron's nodes wind up in nodes_dug, so this is an ideal place to stick @@ -358,7 +362,7 @@ digtron.execute_move_cycle = function(pos, clicker) minetest.get_node_timer(pos):start(digtron.cycle_time) minetest.sound_play("squeal", {gain=1.0, pos=pos}) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) - return pos, "Digtron is obstructed.\n" .. status_text, 3 --Abort, don't dig and don't build. + return pos, S("Digtron is obstructed.") .. "\n" .. status_text, 3 --Abort, don't dig and don't build. end minetest.sound_play("truck", {gain=1.0, pos=pos}) @@ -385,7 +389,7 @@ digtron.execute_downward_dig_cycle = function(pos, clicker) local facing = minetest.get_node(pos).param2 local dir = digtron.facedir_to_down_dir(facing) local fuel_burning = meta:get_float("fuel_burning") -- get amount of burned fuel left over from last cycle - local status_text = string.format("Heat remaining in controller furnace: %d", math.max(0, fuel_burning)) + local status_text = string.format(S("Heat remaining in controller furnace: %d"), math.max(0, fuel_burning)) local layout = DigtronLayout.create(pos, clicker) @@ -447,7 +451,7 @@ digtron.execute_downward_dig_cycle = function(pos, clicker) minetest.get_node_timer(pos):start(digtron.cycle_time) minetest.sound_play("squeal", {gain=1.0, pos=pos}) minetest.sound_play("buzzer", {gain=0.5, pos=pos}) - return pos, "Digtron is obstructed.\n" .. status_text, 3 --Abort, don't dig and don't build. + return pos, S("Digtron is obstructed.") .. "\n" .. status_text, 3 --Abort, don't dig and don't build. end ---------------------------------------------------------------------------------------------------------------------- @@ -496,7 +500,7 @@ digtron.execute_downward_dig_cycle = function(pos, clicker) fuel_burning = fuel_burning + digtron.burn(layout.fuelstores, -fuel_burning, false) end meta:set_float("fuel_burning", fuel_burning) - status_text = status_text .. string.format("Heat remaining in controller furnace: %d", math.max(0, fuel_burning)) + status_text = status_text .. string.format(S("Heat remaining in controller furnace: %d"), math.max(0, fuel_burning)) -- Eyecandy for _, particles in pairs(particle_systems) do @@ -508,7 +512,7 @@ digtron.execute_downward_dig_cycle = function(pos, clicker) local node_to_dig, whether_to_dig = layout.nodes_dug:pop() while node_to_dig ~= nil do if whether_to_dig == true then - minetest.log("action", string.format("%s uses Digtron to dig %s at (%d, %d, %d)", clicker:get_player_name(), minetest.get_node(node_to_dig).name, node_to_dig.x, node_to_dig.y, node_to_dig.z)) + minetest.log("action", string.format(S("%s uses Digtron to dig %s at (%d, %d, %d)"), clicker:get_player_name(), minetest.get_node(node_to_dig).name, node_to_dig.x, node_to_dig.y, node_to_dig.z)) minetest.remove_node(node_to_dig) end -- all of the digtron's nodes wind up in nodes_dug, so this is an ideal place to stick