From bb9279ccb843937bc8001ce333e3ccb71b0dba2d Mon Sep 17 00:00:00 2001 From: Yves Quemener Date: Wed, 11 Sep 2019 02:09:51 +0900 Subject: [PATCH] Add support for MT 5 game translation (rebasing ) (#2466) rebased #2368 --- mods/beds/beds.lua | 9 +- mods/beds/init.lua | 9 +- mods/binoculars/init.lua | 7 +- mods/boats/init.lua | 11 +- mods/bones/init.lua | 23 +-- mods/bucket/init.lua | 12 +- mods/butterflies/init.lua | 15 +- mods/carts/cart_entity.lua | 7 +- mods/carts/init.lua | 5 + mods/carts/rails.lua | 11 +- mods/creative/init.lua | 8 +- mods/creative/inventory.lua | 21 ++- mods/default/chests.lua | 18 +- mods/default/craftitems.lua | 55 +++--- mods/default/furnace.lua | 25 +-- mods/default/init.lua | 4 + mods/default/nodes.lua | 287 +++++++++++++++---------------- mods/default/tools.lua | 53 +++--- mods/default/torch.lua | 7 +- mods/default/trees.lua | 12 +- mods/doors/init.lua | 42 +++-- mods/dye/init.lua | 37 ++-- mods/farming/api.lua | 8 +- mods/farming/hoes.lua | 17 +- mods/farming/init.lua | 17 +- mods/farming/nodes.lua | 19 +- mods/fire/init.lua | 10 +- mods/fireflies/init.lua | 15 +- mods/flowers/init.lua | 27 +-- mods/game_commands/init.lua | 12 +- mods/give_initial_stuff/init.lua | 2 + mods/map/init.lua | 8 +- mods/player_api/init.lua | 2 + mods/screwdriver/init.lua | 8 +- mods/sethome/init.lua | 19 +- mods/sfinv/init.lua | 2 + mods/spawn/init.lua | 2 + mods/stairs/init.lua | 161 ++++++++--------- mods/tnt/init.lua | 12 +- mods/vessels/init.lua | 16 +- mods/walls/init.lua | 12 +- mods/wool/init.lua | 7 +- mods/xpanes/init.lua | 11 +- 43 files changed, 632 insertions(+), 433 deletions(-) diff --git a/mods/beds/beds.lua b/mods/beds/beds.lua index 0bdde9ca..276c05e5 100644 --- a/mods/beds/beds.lua +++ b/mods/beds/beds.lua @@ -1,7 +1,12 @@ +-- beds/beds.lua + +-- support for MT game translation. +local S = beds.get_translator + -- Fancy shaped bed beds.register_bed("beds:fancy_bed", { - description = "Fancy Bed", + description = S("Fancy Bed"), inventory_image = "beds_bed_fancy.png", wield_image = "beds_bed_fancy.png", tiles = { @@ -52,7 +57,7 @@ beds.register_bed("beds:fancy_bed", { -- Simple shaped bed beds.register_bed("beds:bed", { - description = "Simple Bed", + description = S("Simple Bed"), inventory_image = "beds_bed.png", wield_image = "beds_bed.png", tiles = { diff --git a/mods/beds/init.lua b/mods/beds/init.lua index 5a3959cb..869ff0ff 100644 --- a/mods/beds/init.lua +++ b/mods/beds/init.lua @@ -1,13 +1,20 @@ +-- beds/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("beds") + + beds = {} beds.player = {} beds.bed_position = {} beds.pos = {} beds.spawn = {} +beds.get_translator = S beds.formspec = "size[8,11;true]" .. "no_prepend[]" .. "bgcolor[#080808BB;true]" .. - "button_exit[2,10;4,0.75;leave;Leave Bed]" + "button_exit[2,10;4,0.75;leave;" .. S("Leave Bed") .. "]" local modpath = minetest.get_modpath("beds") diff --git a/mods/binoculars/init.lua b/mods/binoculars/init.lua index 0b43a061..4a977b8f 100644 --- a/mods/binoculars/init.lua +++ b/mods/binoculars/init.lua @@ -1,7 +1,12 @@ +-- binoculars/init.lua + -- Mod global namespace binoculars = {} +-- Load support for MT game translation. +local S = minetest.get_translator("binoculars") + -- Detect creative mod local creative_mod = minetest.get_modpath("creative") @@ -54,7 +59,7 @@ minetest.after(4.7, cyclic_update) -- Binoculars item minetest.register_craftitem("binoculars:binoculars", { - description = "Binoculars\nUse with 'Zoom' key", + description = S("Binoculars\nUse with 'Zoom' key"), inventory_image = "binoculars_binoculars.png", stack_max = 1, diff --git a/mods/boats/init.lua b/mods/boats/init.lua index 00cf7918..906a0979 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -1,3 +1,8 @@ +-- boats/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("boats") + -- -- Helper functions -- @@ -149,13 +154,13 @@ function boat.on_step(self, dtime) if ctrl.up and ctrl.down then if not self.auto then self.auto = true - minetest.chat_send_player(self.driver, "[boats] Cruise on") + minetest.chat_send_player(self.driver, S("[boats] Cruise on")) end elseif ctrl.down then self.v = self.v - dtime * 1.8 if self.auto then self.auto = false - minetest.chat_send_player(self.driver, "[boats] Cruise off") + minetest.chat_send_player(self.driver, S("[boats] Cruise off")) end elseif ctrl.up or self.auto then self.v = self.v + dtime * 1.8 @@ -242,7 +247,7 @@ minetest.register_entity("boats:boat", boat) minetest.register_craftitem("boats:boat", { - description = "Boat", + description = S("Boat"), inventory_image = "boats_inventory.png", wield_image = "boats_wield.png", wield_scale = {x = 2, y = 2, z = 1}, diff --git a/mods/bones/init.lua b/mods/bones/init.lua index 5fcae411..6e93062d 100644 --- a/mods/bones/init.lua +++ b/mods/bones/init.lua @@ -1,6 +1,11 @@ +-- bones/init.lua + -- Minetest 0.4 mod: bones -- See README.txt for licensing and other information. +-- Load support for MT game translation. +local S = minetest.get_translator("bones") + bones = {} local function is_owner(pos, name) @@ -24,7 +29,7 @@ local share_bones_time = tonumber(minetest.settings:get("share_bones_time")) or local share_bones_time_early = tonumber(minetest.settings:get("share_bones_time_early")) or share_bones_time / 4 minetest.register_node("bones:bones", { - description = "Bones", + description = S("Bones"), tiles = { "bones_top.png^[transform2", "bones_bottom.png", @@ -116,7 +121,7 @@ minetest.register_node("bones:bones", { local meta = minetest.get_meta(pos) local time = meta:get_int("time") + elapsed if time >= share_bones_time then - meta:set_string("infotext", meta:get_string("owner") .. "'s old bones") + meta:set_string("infotext", S("@1's old bones", meta:get_string("owner"))) meta:set_string("owner", "") else meta:set_int("time", time) @@ -194,7 +199,7 @@ minetest.register_on_dieplayer(function(player) minetest.log("action", player_name .. " dies at " .. pos_string .. ". No bones placed") if bones_position_message then - minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. ".") + minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string)) end return end @@ -204,7 +209,7 @@ minetest.register_on_dieplayer(function(player) minetest.log("action", player_name .. " dies at " .. pos_string .. ". No bones placed") if bones_position_message then - minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. ".") + minetest.chat_send_player(player_name, S("@1 died at @2.", player_name, pos_string)) end return end @@ -230,8 +235,7 @@ minetest.register_on_dieplayer(function(player) minetest.log("action", player_name .. " dies at " .. pos_string .. ". Inventory dropped") if bones_position_message then - minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. - ", and dropped their inventory.") + minetest.chat_send_player(player_name, S("@1 died at @2, and dropped their inventory.", player_name, pos_string)) end return end @@ -242,8 +246,7 @@ minetest.register_on_dieplayer(function(player) minetest.log("action", player_name .. " dies at " .. pos_string .. ". Bones placed") if bones_position_message then - minetest.chat_send_player(player_name, player_name .. " died at " .. pos_string .. - ", and bones were placed.") + minetest.chat_send_player(player_name, S("@1 died at @2, and bones were placed.", player_name, pos_string)) end local meta = minetest.get_meta(pos) @@ -266,7 +269,7 @@ minetest.register_on_dieplayer(function(player) meta:set_string("owner", player_name) if share_bones_time ~= 0 then - meta:set_string("infotext", player_name .. "'s fresh bones") + meta:set_string("infotext", S("@1's fresh bones.", player_name)) if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then meta:set_int("time", 0) @@ -276,6 +279,6 @@ minetest.register_on_dieplayer(function(player) minetest.get_node_timer(pos):start(10) else - meta:set_string("infotext", player_name.."'s bones") + meta:set_string("infotext", S("@1's bones.", player_name)) end end) diff --git a/mods/bucket/init.lua b/mods/bucket/init.lua index ab3ee71f..2cf431ca 100644 --- a/mods/bucket/init.lua +++ b/mods/bucket/init.lua @@ -1,6 +1,10 @@ -- Minetest 0.4 mod: bucket -- See README.txt for licensing and other information. +-- Load support for MT game translation. +local S = minetest.get_translator("bucket") + + minetest.register_alias("bucket", "bucket:bucket_empty") minetest.register_alias("bucket_water", "bucket:bucket_water") minetest.register_alias("bucket_lava", "bucket:bucket_lava") @@ -111,7 +115,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name end minetest.register_craftitem("bucket:bucket_empty", { - description = "Empty Bucket", + description = S("Empty Bucket"), inventory_image = "bucket.png", groups = {tool = 1}, liquids_pointable = true, @@ -185,7 +189,7 @@ bucket.register_liquid( "default:water_flowing", "bucket:bucket_water", "bucket_water.png", - "Water Bucket", + S("Water Bucket"), {tool = 1, water_bucket = 1} ) @@ -200,7 +204,7 @@ bucket.register_liquid( "default:river_water_flowing", "bucket:bucket_river_water", "bucket_river_water.png", - "River Water Bucket", + S("River Water Bucket"), {tool = 1, water_bucket = 1}, true ) @@ -210,7 +214,7 @@ bucket.register_liquid( "default:lava_flowing", "bucket:bucket_lava", "bucket_lava.png", - "Lava Bucket", + S("Lava Bucket"), {tool = 1} ) diff --git a/mods/butterflies/init.lua b/mods/butterflies/init.lua index 008211ee..1263fa6c 100644 --- a/mods/butterflies/init.lua +++ b/mods/butterflies/init.lua @@ -1,8 +1,13 @@ +-- butrerflies/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("butterflies") + -- register butterflies local butter_list = { - {"white", "White"}, - {"red", "Red"}, - {"violet", "Violet"} + {"white", S("White")}, + {"red", S("Red")}, + {"violet", S("Violet")} } for i in ipairs (butter_list) do @@ -10,7 +15,7 @@ for i in ipairs (butter_list) do local desc = butter_list[i][2] minetest.register_node("butterflies:butterfly_"..name, { - description = desc.." Butterfly", + description = S("@1 Butterfly", desc), drawtype = "plantlike", tiles = {{ name = "butterflies_butterfly_"..name.."_animated.png", @@ -56,7 +61,7 @@ for i in ipairs (butter_list) do }) minetest.register_node("butterflies:hidden_butterfly_"..name, { - description = "Hidden "..desc.." Butterfly", + description = S("Hidden @1 Butterfly", desc), drawtype = "airlike", inventory_image = "insects_butterfly_"..name..".png", wield_image = "insects_butterfly_"..name..".png", diff --git a/mods/carts/cart_entity.lua b/mods/carts/cart_entity.lua index 855450da..97084ace 100644 --- a/mods/carts/cart_entity.lua +++ b/mods/carts/cart_entity.lua @@ -1,3 +1,8 @@ +-- carts/cart_entity.lua + +-- support for MT game translation. +local S = carts.get_translator + local cart_entity = { initial_properties = { physical = false, -- otherwise going uphill breaks @@ -383,7 +388,7 @@ end minetest.register_entity("carts:cart", cart_entity) minetest.register_craftitem("carts:cart", { - description = "Cart (Sneak+Click to pick up)", + description = S("Cart (Sneak+Click to pick up)"), inventory_image = minetest.inventorycube("carts_cart_top.png", "carts_cart_side.png", "carts_cart_side.png"), wield_image = "carts_cart_side.png", on_place = function(itemstack, placer, pointed_thing) diff --git a/mods/carts/init.lua b/mods/carts/init.lua index fe45303a..a5aa9cb5 100644 --- a/mods/carts/init.lua +++ b/mods/carts/init.lua @@ -1,7 +1,12 @@ +-- carts/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("carts") carts = {} carts.modpath = minetest.get_modpath("carts") carts.railparams = {} +carts.get_translator = S -- Maximal speed of the cart in m/s (min = -1) carts.speed_max = 7 diff --git a/mods/carts/rails.lua b/mods/carts/rails.lua index a5fff8a4..8bd2ba1e 100644 --- a/mods/carts/rails.lua +++ b/mods/carts/rails.lua @@ -1,5 +1,10 @@ +-- carts/rails.lua + +-- support for MT game translation. +local S = carts.get_translator + carts:register_rail("carts:rail", { - description = "Rail", + description = S("Rail"), tiles = { "carts_rail_straight.png", "carts_rail_curved.png", "carts_rail_t_junction.png", "carts_rail_crossing.png" @@ -22,7 +27,7 @@ minetest.register_alias("default:rail", "carts:rail") carts:register_rail("carts:powerrail", { - description = "Powered Rail", + description = S("Powered Rail"), tiles = { "carts_rail_straight_pwr.png", "carts_rail_curved_pwr.png", "carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png" @@ -41,7 +46,7 @@ minetest.register_craft({ carts:register_rail("carts:brakerail", { - description = "Brake Rail", + description = S("Brake Rail"), tiles = { "carts_rail_straight_brk.png", "carts_rail_curved_brk.png", "carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png" diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 7b7903d1..a1d57c88 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -1,4 +1,10 @@ +-- creative/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("creative") + creative = {} +creative.get_translator = S local function update_sfinv(name) minetest.after(0, function() @@ -14,7 +20,7 @@ local function update_sfinv(name) end minetest.register_privilege("creative", { - description = "Allow player to use creative inventory", + description = S("Allow player to use creative inventory"), give_to_singleplayer = false, give_to_admin = false, on_grant = update_sfinv, diff --git a/mods/creative/inventory.lua b/mods/creative/inventory.lua index 3b95e735..08402046 100644 --- a/mods/creative/inventory.lua +++ b/mods/creative/inventory.lua @@ -1,3 +1,8 @@ +-- creative/inventory.lua + +-- support for MT game translation. +local S = creative.get_translator + local player_inventory = {} local inventory_cache = {} @@ -114,10 +119,10 @@ function creative.register_tab(name, title, items) image_button[7.2,3.25;0.8,0.8;creative_next_icon.png;creative_next;] image_button[2.1,3.25;0.8,0.8;creative_search_icon.png;creative_search;] image_button[2.75,3.25;0.8,0.8;creative_clear_icon.png;creative_clear;] - tooltip[creative_search;Search] - tooltip[creative_clear;Reset] - tooltip[creative_prev;Previous page] - tooltip[creative_next;Next page] + tooltip[creative_search;S("Search")] + tooltip[creative_clear;S("Reset")] + tooltip[creative_prev;S("Previous page")] + tooltip[creative_next;S("Next page")] listring[current_player;main] field_close_on_enter[creative_filter;false] ]] .. @@ -174,10 +179,10 @@ function creative.register_tab(name, title, items) }) end -creative.register_tab("all", "All", minetest.registered_items) -creative.register_tab("nodes", "Nodes", minetest.registered_nodes) -creative.register_tab("tools", "Tools", minetest.registered_tools) -creative.register_tab("craftitems", "Items", minetest.registered_craftitems) +creative.register_tab("all", S("All"), minetest.registered_items) +creative.register_tab("nodes", S("Nodes"), minetest.registered_nodes) +creative.register_tab("tools", S("Tools"), minetest.registered_tools) +creative.register_tab("craftitems", S("Items"), minetest.registered_craftitems) local old_homepage_name = sfinv.get_homepage_name function sfinv.get_homepage_name(player) diff --git a/mods/default/chests.lua b/mods/default/chests.lua index b70e5ad2..8dbf9d89 100644 --- a/mods/default/chests.lua +++ b/mods/default/chests.lua @@ -1,5 +1,8 @@ default.chest = {} +-- support for MT game translation. +local S = default.get_translator + function default.chest.get_chest_formspec(pos) local spos = pos.x .. "," .. pos.y .. "," .. pos.z local formspec = @@ -84,7 +87,7 @@ function default.chest.register_chest(name, d) if def.protected then def.on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Locked Chest") + meta:set_string("infotext", S("Locked Chest")) meta:set_string("owner", "") local inv = meta:get_inventory() inv:set_size("main", 8*4) @@ -92,8 +95,7 @@ function default.chest.register_chest(name, d) def.after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name() or "") - meta:set_string("infotext", "Locked Chest (owned by " .. - meta:get_string("owner") .. ")") + meta:set_string("infotext", S("Locked Chest (owned by @1)", meta:get_string("owner"))) end def.can_dig = function(pos,player) local meta = minetest.get_meta(pos); @@ -171,7 +173,7 @@ function default.chest.register_chest(name, d) -- verify placer is owner of lockable chest if owner ~= pn then minetest.record_protection_violation(pos, pn) - minetest.chat_send_player(pn, "You do not own this chest.") + minetest.chat_send_player(pn, S("You do not own this chest.")) return nil end @@ -181,12 +183,12 @@ function default.chest.register_chest(name, d) meta:set_string("key_lock_secret", secret) end - return secret, "a locked chest", owner + return secret, S("a locked chest"), owner end else def.on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Chest") + meta:set_string("infotext", S("Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end @@ -285,7 +287,7 @@ function default.chest.register_chest(name, d) end default.chest.register_chest("chest", { - description = "Chest", + description = S("Chest"), tiles = { "default_chest_top.png", "default_chest_top.png", @@ -301,7 +303,7 @@ default.chest.register_chest("chest", { }) default.chest.register_chest("chest_locked", { - description = "Locked Chest", + description = S("Locked Chest"), tiles = { "default_chest_top.png", "default_chest_top.png", diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index 53f4decc..fe226765 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -1,13 +1,16 @@ -- mods/default/craftitems.lua +-- support for MT game translation. +local S = default.get_translator + minetest.register_craftitem("default:stick", { - description = "Stick", + description = S("Stick"), inventory_image = "default_stick.png", groups = {stick = 1, flammable = 2}, }) minetest.register_craftitem("default:paper", { - description = "Paper", + description = S("Paper"), inventory_image = "default_paper.png", groups = {flammable = 3}, }) @@ -108,7 +111,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if #short_title > short_title_size + 3 then short_title = short_title:sub(1, short_title_size) .. "..." end - data.description = "\""..short_title.."\" by "..data.owner + data.description = S("\"@1\" by @2", short_title, data.owner) data.text = fields.text:sub(1, max_text_size) data.text = data.text:gsub("\r\n", "\n"):gsub("\r", "\n") data.page = 1 @@ -155,14 +158,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end) minetest.register_craftitem("default:book", { - description = "Book", + description = S("Book"), inventory_image = "default_book.png", groups = {book = 1, flammable = 3}, on_use = book_on_use, }) minetest.register_craftitem("default:book_written", { - description = "Book With Text", + description = S("Book With Text"), inventory_image = "default_book_written.png", groups = {book = 1, not_in_creative_inventory = 1, flammable = 3}, stack_max = 1, @@ -199,7 +202,7 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv end) minetest.register_craftitem("default:skeleton_key", { - description = "Skeleton Key", + description = S("Skeleton Key"), inventory_image = "default_key_skeleton.png", groups = {key = 1}, on_use = function(itemstack, user, pointed_thing) @@ -238,8 +241,8 @@ minetest.register_craftitem("default:skeleton_key", { local new_stack = ItemStack("default:key") local meta = new_stack:get_meta() meta:set_string("secret", secret) - meta:set_string("description", "Key to "..user:get_player_name().."'s " - ..minetest.registered_nodes[node.name].description) + meta:set_string("description", S("Key to @1's @2", user:get_player_name(), + minetest.registered_nodes[node.name].description)) if itemstack:get_count() == 0 then itemstack = new_stack @@ -255,93 +258,93 @@ minetest.register_craftitem("default:skeleton_key", { }) minetest.register_craftitem("default:coal_lump", { - description = "Coal Lump", + description = S("Coal Lump"), inventory_image = "default_coal_lump.png", groups = {coal = 1, flammable = 1} }) minetest.register_craftitem("default:iron_lump", { - description = "Iron Lump", + description = S("Iron Lump"), inventory_image = "default_iron_lump.png" }) minetest.register_craftitem("default:copper_lump", { - description = "Copper Lump", + description = S("Copper Lump"), inventory_image = "default_copper_lump.png" }) minetest.register_craftitem("default:tin_lump", { - description = "Tin Lump", + description = S("Tin Lump"), inventory_image = "default_tin_lump.png" }) minetest.register_craftitem("default:mese_crystal", { - description = "Mese Crystal", + description = S("Mese Crystal"), inventory_image = "default_mese_crystal.png", }) minetest.register_craftitem("default:gold_lump", { - description = "Gold Lump", + description = S("Gold Lump"), inventory_image = "default_gold_lump.png" }) minetest.register_craftitem("default:diamond", { - description = "Diamond", + description = S("Diamond"), inventory_image = "default_diamond.png", }) minetest.register_craftitem("default:clay_lump", { - description = "Clay Lump", + description = S("Clay Lump"), inventory_image = "default_clay_lump.png", }) minetest.register_craftitem("default:steel_ingot", { - description = "Steel Ingot", + description = S("Steel Ingot"), inventory_image = "default_steel_ingot.png" }) minetest.register_craftitem("default:copper_ingot", { - description = "Copper Ingot", + description = S("Copper Ingot"), inventory_image = "default_copper_ingot.png" }) minetest.register_craftitem("default:tin_ingot", { - description = "Tin Ingot", + description = S("Tin Ingot"), inventory_image = "default_tin_ingot.png" }) minetest.register_craftitem("default:bronze_ingot", { - description = "Bronze Ingot", + description = S("Bronze Ingot"), inventory_image = "default_bronze_ingot.png" }) minetest.register_craftitem("default:gold_ingot", { - description = "Gold Ingot", + description = S("Gold Ingot"), inventory_image = "default_gold_ingot.png" }) minetest.register_craftitem("default:mese_crystal_fragment", { - description = "Mese Crystal Fragment", + description = S("Mese Crystal Fragment"), inventory_image = "default_mese_crystal_fragment.png", }) minetest.register_craftitem("default:clay_brick", { - description = "Clay Brick", + description = S("Clay Brick"), inventory_image = "default_clay_brick.png", }) minetest.register_craftitem("default:obsidian_shard", { - description = "Obsidian Shard", + description = S("Obsidian Shard"), inventory_image = "default_obsidian_shard.png", }) minetest.register_craftitem("default:flint", { - description = "Flint", + description = S("Flint"), inventory_image = "default_flint.png" }) minetest.register_craftitem("default:blueberries", { - description = "Blueberries", + description = S("Blueberries"), inventory_image = "default_blueberries.png", groups = {food_blueberries = 1, food_berry = 1}, on_use = minetest.item_eat(2), diff --git a/mods/default/furnace.lua b/mods/default/furnace.lua index cd48923c..2c9f8645 100644 --- a/mods/default/furnace.lua +++ b/mods/default/furnace.lua @@ -1,3 +1,7 @@ +-- default/furnace.lua + +-- support for MT game translation. +local S = default.get_translator -- -- Formspecs @@ -60,7 +64,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) if listname == "fuel" then if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then if inv:is_empty("src") then - meta:set_string("infotext", "Furnace is empty") + meta:set_string("infotext", S("Furnace is empty")) end return stack:get_count() else @@ -209,19 +213,19 @@ local function furnace_node_timer(pos, elapsed) if cookable then item_percent = math.floor(src_time / cooked.time * 100) if dst_full then - item_state = "100% (output full)" + item_state = S("100% (output full)") else - item_state = item_percent .. "%" + item_state = S("@1%", item_percent) end else if srclist[1]:is_empty() then - item_state = "Empty" + item_state = S("Empty") else - item_state = "Not cookable" + item_state = S("Not cookable") end end - local fuel_state = "Empty" + local fuel_state = S("Empty") local active = "inactive" local result = false @@ -243,8 +247,9 @@ local function furnace_node_timer(pos, elapsed) minetest.get_node_timer(pos):stop() end - local infotext = "Furnace " .. active .. "\n(Item: " .. item_state .. - "; Fuel: " .. fuel_state .. ")" +-- local infotext = "Furnace " .. active .. "\n(Item: " .. item_state .. +-- "; Fuel: " .. fuel_state .. ")" + local infotext = S("Furnace @1 \n(Item: @2; Fuel: @3)", active, item_state, fuel_state) -- -- Set meta values @@ -263,7 +268,7 @@ end -- minetest.register_node("default:furnace", { - description = "Furnace", + description = S("Furnace"), tiles = { "default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png", "default_furnace_side.png", @@ -311,7 +316,7 @@ minetest.register_node("default:furnace", { }) minetest.register_node("default:furnace_active", { - description = "Furnace", + description = S("Furnace"), tiles = { "default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png", "default_furnace_side.png", diff --git a/mods/default/init.lua b/mods/default/init.lua index 47827528..015d3dcf 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -3,10 +3,14 @@ -- The API documentation in here was moved into game_api.txt +-- Load support for MT game translation. +local S = minetest.get_translator("default") + -- Definitions made by this mod that other mods can use too default = {} default.LIGHT_MAX = 14 +default.get_translator = S -- GUI related stuff minetest.register_on_joinplayer(function(player) diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index b29f6797..da01e938 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -1,5 +1,7 @@ -- mods/default/nodes.lua +-- support for MT game translation. +local S = default.get_translator --[[ Node name convention: @@ -242,7 +244,7 @@ end -- minetest.register_node("default:stone", { - description = "Stone", + description = S("Stone"), tiles = {"default_stone.png"}, groups = {cracky = 3, stone = 1}, drop = "default:cobble", @@ -251,7 +253,7 @@ minetest.register_node("default:stone", { }) minetest.register_node("default:cobble", { - description = "Cobblestone", + description = S("Cobblestone"), tiles = {"default_cobble.png"}, is_ground_content = false, groups = {cracky = 3, stone = 2}, @@ -259,7 +261,7 @@ minetest.register_node("default:cobble", { }) minetest.register_node("default:stonebrick", { - description = "Stone Brick", + description = S("Stone Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_stone_brick.png"}, @@ -269,7 +271,7 @@ minetest.register_node("default:stonebrick", { }) minetest.register_node("default:stone_block", { - description = "Stone Block", + description = S("Stone Block"), tiles = {"default_stone_block.png"}, is_ground_content = false, groups = {cracky = 2, stone = 1}, @@ -277,7 +279,7 @@ minetest.register_node("default:stone_block", { }) minetest.register_node("default:mossycobble", { - description = "Mossy Cobblestone", + description = S("Mossy Cobblestone"), tiles = {"default_mossycobble.png"}, is_ground_content = false, groups = {cracky = 3, stone = 1}, @@ -286,7 +288,7 @@ minetest.register_node("default:mossycobble", { minetest.register_node("default:desert_stone", { - description = "Desert Stone", + description = S("Desert Stone"), tiles = {"default_desert_stone.png"}, groups = {cracky = 3, stone = 1}, drop = "default:desert_cobble", @@ -295,7 +297,7 @@ minetest.register_node("default:desert_stone", { }) minetest.register_node("default:desert_cobble", { - description = "Desert Cobblestone", + description = S("Desert Cobblestone"), tiles = {"default_desert_cobble.png"}, is_ground_content = false, groups = {cracky = 3, stone = 2}, @@ -303,7 +305,7 @@ minetest.register_node("default:desert_cobble", { }) minetest.register_node("default:desert_stonebrick", { - description = "Desert Stone Brick", + description = S("Desert Stone Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_desert_stone_brick.png"}, @@ -313,7 +315,7 @@ minetest.register_node("default:desert_stonebrick", { }) minetest.register_node("default:desert_stone_block", { - description = "Desert Stone Block", + description = S("Desert Stone Block"), tiles = {"default_desert_stone_block.png"}, is_ground_content = false, groups = {cracky = 2, stone = 1}, @@ -321,14 +323,14 @@ minetest.register_node("default:desert_stone_block", { }) minetest.register_node("default:sandstone", { - description = "Sandstone", + description = S("Sandstone"), tiles = {"default_sandstone.png"}, groups = {crumbly = 1, cracky = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node("default:sandstonebrick", { - description = "Sandstone Brick", + description = S("Sandstone Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_sandstone_brick.png"}, @@ -338,7 +340,7 @@ minetest.register_node("default:sandstonebrick", { }) minetest.register_node("default:sandstone_block", { - description = "Sandstone Block", + description = S("Sandstone Block"), tiles = {"default_sandstone_block.png"}, is_ground_content = false, groups = {cracky = 2}, @@ -346,14 +348,14 @@ minetest.register_node("default:sandstone_block", { }) minetest.register_node("default:desert_sandstone", { - description = "Desert Sandstone", + description = S("Desert Sandstone"), tiles = {"default_desert_sandstone.png"}, groups = {crumbly = 1, cracky = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node("default:desert_sandstone_brick", { - description = "Desert Sandstone Brick", + description = S("Desert Sandstone Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_desert_sandstone_brick.png"}, @@ -363,7 +365,7 @@ minetest.register_node("default:desert_sandstone_brick", { }) minetest.register_node("default:desert_sandstone_block", { - description = "Desert Sandstone Block", + description = S("Desert Sandstone Block"), tiles = {"default_desert_sandstone_block.png"}, is_ground_content = false, groups = {cracky = 2}, @@ -371,14 +373,14 @@ minetest.register_node("default:desert_sandstone_block", { }) minetest.register_node("default:silver_sandstone", { - description = "Silver Sandstone", + description = S("Silver Sandstone"), tiles = {"default_silver_sandstone.png"}, groups = {crumbly = 1, cracky = 3}, sounds = default.node_sound_stone_defaults(), }) minetest.register_node("default:silver_sandstone_brick", { - description = "Silver Sandstone Brick", + description = S("Silver Sandstone Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_silver_sandstone_brick.png"}, @@ -388,7 +390,7 @@ minetest.register_node("default:silver_sandstone_brick", { }) minetest.register_node("default:silver_sandstone_block", { - description = "Silver Sandstone Block", + description = S("Silver Sandstone Block"), tiles = {"default_silver_sandstone_block.png"}, is_ground_content = false, groups = {cracky = 2}, @@ -396,14 +398,14 @@ minetest.register_node("default:silver_sandstone_block", { }) minetest.register_node("default:obsidian", { - description = "Obsidian", + description = S("Obsidian"), tiles = {"default_obsidian.png"}, sounds = default.node_sound_stone_defaults(), groups = {cracky = 1, level = 2}, }) minetest.register_node("default:obsidianbrick", { - description = "Obsidian Brick", + description = S("Obsidian Brick"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_obsidian_brick.png"}, @@ -413,7 +415,7 @@ minetest.register_node("default:obsidianbrick", { }) minetest.register_node("default:obsidian_block", { - description = "Obsidian Block", + description = S("Obsidian Block"), tiles = {"default_obsidian_block.png"}, is_ground_content = false, sounds = default.node_sound_stone_defaults(), @@ -425,14 +427,14 @@ minetest.register_node("default:obsidian_block", { -- minetest.register_node("default:dirt", { - description = "Dirt", + description = S("Dirt"), tiles = {"default_dirt.png"}, groups = {crumbly = 3, soil = 1}, sounds = default.node_sound_dirt_defaults(), }) minetest.register_node("default:dirt_with_grass", { - description = "Dirt with Grass", + description = S("Dirt with Grass"), tiles = {"default_grass.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, @@ -444,7 +446,7 @@ minetest.register_node("default:dirt_with_grass", { }) minetest.register_node("default:dirt_with_grass_footsteps", { - description = "Dirt with Grass and Footsteps", + description = S("Dirt with Grass and Footsteps"), tiles = {"default_grass.png^default_footprint.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, @@ -456,7 +458,7 @@ minetest.register_node("default:dirt_with_grass_footsteps", { }) minetest.register_node("default:dirt_with_dry_grass", { - description = "Dirt with Dry Grass", + description = S("Dirt with Dry Grass"), tiles = {"default_dry_grass.png", "default_dirt.png", {name = "default_dirt.png^default_dry_grass_side.png", @@ -469,7 +471,7 @@ minetest.register_node("default:dirt_with_dry_grass", { }) minetest.register_node("default:dirt_with_snow", { - description = "Dirt with Snow", + description = S("Dirt with Snow"), tiles = {"default_snow.png", "default_dirt.png", {name = "default_dirt.png^default_snow_side.png", tileable_vertical = false}}, @@ -481,7 +483,7 @@ minetest.register_node("default:dirt_with_snow", { }) minetest.register_node("default:dirt_with_rainforest_litter", { - description = "Dirt with Rainforest Litter", + description = S("Dirt with Rainforest Litter"), tiles = { "default_rainforest_litter.png", "default_dirt.png", @@ -496,7 +498,7 @@ minetest.register_node("default:dirt_with_rainforest_litter", { }) minetest.register_node("default:dirt_with_coniferous_litter", { - description = "Dirt with Coniferous Litter", + description = S("Dirt with Coniferous Litter"), tiles = { "default_coniferous_litter.png", "default_dirt.png", @@ -530,14 +532,14 @@ minetest.register_node("default:dry_dirt_with_dry_grass", { }) minetest.register_node("default:permafrost", { - description = "Permafrost", + description = S("Permafrost"), tiles = {"default_permafrost.png"}, groups = {cracky = 3}, sounds = default.node_sound_dirt_defaults(), }) minetest.register_node("default:permafrost_with_stones", { - description = "Permafrost with Stones", + description = S("Permafrost with Stones"), tiles = {"default_permafrost.png^default_stones.png", "default_permafrost.png", "default_permafrost.png^default_stones_side.png"}, @@ -546,7 +548,7 @@ minetest.register_node("default:permafrost_with_stones", { }) minetest.register_node("default:permafrost_with_moss", { - description = "Permafrost with Moss", + description = S("Permafrost with Moss"), tiles = {"default_moss.png", "default_permafrost.png", {name = "default_permafrost.png^default_moss_side.png", tileable_vertical = false}}, @@ -557,21 +559,21 @@ minetest.register_node("default:permafrost_with_moss", { }) minetest.register_node("default:sand", { - description = "Sand", + description = S("Sand"), tiles = {"default_sand.png"}, groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) minetest.register_node("default:desert_sand", { - description = "Desert Sand", + description = S("Desert Sand"), tiles = {"default_desert_sand.png"}, groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) minetest.register_node("default:silver_sand", { - description = "Silver Sand", + description = S("Silver Sand"), tiles = {"default_silver_sand.png"}, groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), @@ -579,7 +581,7 @@ minetest.register_node("default:silver_sand", { minetest.register_node("default:gravel", { - description = "Gravel", + description = S("Gravel"), tiles = {"default_gravel.png"}, groups = {crumbly = 2, falling_node = 1}, sounds = default.node_sound_gravel_defaults(), @@ -593,7 +595,7 @@ minetest.register_node("default:gravel", { }) minetest.register_node("default:clay", { - description = "Clay", + description = S("Clay"), tiles = {"default_clay.png"}, groups = {crumbly = 3}, drop = "default:clay_lump 4", @@ -602,7 +604,7 @@ minetest.register_node("default:clay", { minetest.register_node("default:snow", { - description = "Snow", + description = S("Snow"), tiles = {"default_snow.png"}, inventory_image = "default_snowball.png", wield_image = "default_snowball.png", @@ -634,7 +636,7 @@ minetest.register_node("default:snow", { }) minetest.register_node("default:snowblock", { - description = "Snow Block", + description = S("Snow Block"), tiles = {"default_snow.png"}, groups = {crumbly = 3, cools_lava = 1, snowy = 1}, sounds = default.node_sound_snow_defaults(), @@ -649,7 +651,7 @@ minetest.register_node("default:snowblock", { -- 'is ground content = false' to avoid tunnels in sea ice or ice rivers minetest.register_node("default:ice", { - description = "Ice", + description = S("Ice"), tiles = {"default_ice.png"}, is_ground_content = false, paramtype = "light", @@ -659,7 +661,7 @@ minetest.register_node("default:ice", { -- Mapgen-placed ice with 'is ground content = true' to contain tunnels minetest.register_node("default:cave_ice", { - description = "Cave Ice", + description = S("Cave Ice"), tiles = {"default_ice.png"}, paramtype = "light", groups = {cracky = 3, cools_lava = 1, slippery = 3, @@ -673,7 +675,7 @@ minetest.register_node("default:cave_ice", { -- minetest.register_node("default:tree", { - description = "Apple Tree", + description = S("Apple Tree"), tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -684,7 +686,7 @@ minetest.register_node("default:tree", { }) minetest.register_node("default:wood", { - description = "Apple Wood Planks", + description = S("Apple Wood Planks"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_wood.png"}, @@ -694,7 +696,7 @@ minetest.register_node("default:wood", { }) minetest.register_node("default:sapling", { - description = "Apple Tree Sapling", + description = S("Apple Tree Sapling"), drawtype = "plantlike", tiles = {"default_sapling.png"}, inventory_image = "default_sapling.png", @@ -730,7 +732,7 @@ minetest.register_node("default:sapling", { }) minetest.register_node("default:leaves", { - description = "Apple Tree Leaves", + description = S("Apple Tree Leaves"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_leaves.png"}, @@ -759,7 +761,7 @@ minetest.register_node("default:leaves", { }) minetest.register_node("default:apple", { - description = "Apple", + description = S("Apple"), drawtype = "plantlike", tiles = {"default_apple.png"}, inventory_image = "default_apple.png", @@ -789,7 +791,7 @@ minetest.register_node("default:apple", { }) minetest.register_node("default:apple_mark", { - description = "Apple Marker", + description = S("Apple Marker"), drawtype = "airlike", paramtype = "light", sunlight_propagates = true, @@ -812,7 +814,7 @@ minetest.register_node("default:apple_mark", { minetest.register_node("default:jungletree", { - description = "Jungle Tree", + description = S("Jungle Tree"), tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, paramtype2 = "facedir", @@ -824,7 +826,7 @@ minetest.register_node("default:jungletree", { }) minetest.register_node("default:junglewood", { - description = "Jungle Wood Planks", + description = S("Jungle Wood Planks"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_junglewood.png"}, @@ -834,7 +836,7 @@ minetest.register_node("default:junglewood", { }) minetest.register_node("default:jungleleaves", { - description = "Jungle Tree Leaves", + description = S("Jungle Tree Leaves"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_jungleleaves.png"}, @@ -855,7 +857,7 @@ minetest.register_node("default:jungleleaves", { }) minetest.register_node("default:junglesapling", { - description = "Jungle Tree Sapling", + description = S("Jungle Tree Sapling"), drawtype = "plantlike", tiles = {"default_junglesapling.png"}, inventory_image = "default_junglesapling.png", @@ -891,7 +893,7 @@ minetest.register_node("default:junglesapling", { }) minetest.register_node("default:emergent_jungle_sapling", { - description = "Emergent Jungle Tree Sapling", + description = S("Emergent Jungle Tree Sapling"), drawtype = "plantlike", tiles = {"default_emergent_jungle_sapling.png"}, inventory_image = "default_emergent_jungle_sapling.png", @@ -927,7 +929,7 @@ minetest.register_node("default:emergent_jungle_sapling", { minetest.register_node("default:pine_tree", { - description = "Pine Tree", + description = S("Pine Tree"), tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png", "default_pine_tree.png"}, paramtype2 = "facedir", @@ -939,7 +941,7 @@ minetest.register_node("default:pine_tree", { }) minetest.register_node("default:pine_wood", { - description = "Pine Wood Planks", + description = S("Pine Wood Planks"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_pine_wood.png"}, @@ -949,7 +951,7 @@ minetest.register_node("default:pine_wood", { }) minetest.register_node("default:pine_needles",{ - description = "Pine Needles", + description = S("Pine Needles"), drawtype = "allfaces_optional", tiles = {"default_pine_needles.png"}, waving = 1, @@ -969,7 +971,7 @@ minetest.register_node("default:pine_needles",{ }) minetest.register_node("default:pine_sapling", { - description = "Pine Tree Sapling", + description = S("Pine Tree Sapling"), drawtype = "plantlike", tiles = {"default_pine_sapling.png"}, inventory_image = "default_pine_sapling.png", @@ -1006,7 +1008,7 @@ minetest.register_node("default:pine_sapling", { minetest.register_node("default:acacia_tree", { - description = "Acacia Tree", + description = S("Acacia Tree"), tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png", "default_acacia_tree.png"}, paramtype2 = "facedir", @@ -1018,7 +1020,7 @@ minetest.register_node("default:acacia_tree", { }) minetest.register_node("default:acacia_wood", { - description = "Acacia Wood Planks", + description = S("Acacia Wood Planks"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_acacia_wood.png"}, @@ -1028,7 +1030,7 @@ minetest.register_node("default:acacia_wood", { }) minetest.register_node("default:acacia_leaves", { - description = "Acacia Tree Leaves", + description = S("Acacia Tree Leaves"), drawtype = "allfaces_optional", tiles = {"default_acacia_leaves.png"}, special_tiles = {"default_acacia_leaves_simple.png"}, @@ -1049,7 +1051,7 @@ minetest.register_node("default:acacia_leaves", { }) minetest.register_node("default:acacia_sapling", { - description = "Acacia Tree Sapling", + description = S("Acacia Tree Sapling"), drawtype = "plantlike", tiles = {"default_acacia_sapling.png"}, inventory_image = "default_acacia_sapling.png", @@ -1085,7 +1087,7 @@ minetest.register_node("default:acacia_sapling", { }) minetest.register_node("default:aspen_tree", { - description = "Aspen Tree", + description = S("Aspen Tree"), tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png", "default_aspen_tree.png"}, paramtype2 = "facedir", @@ -1097,7 +1099,7 @@ minetest.register_node("default:aspen_tree", { }) minetest.register_node("default:aspen_wood", { - description = "Aspen Wood Planks", + description = S("Aspen Wood Planks"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_aspen_wood.png"}, @@ -1107,7 +1109,7 @@ minetest.register_node("default:aspen_wood", { }) minetest.register_node("default:aspen_leaves", { - description = "Aspen Tree Leaves", + description = S("Aspen Tree Leaves"), drawtype = "allfaces_optional", tiles = {"default_aspen_leaves.png"}, waving = 1, @@ -1127,7 +1129,7 @@ minetest.register_node("default:aspen_leaves", { }) minetest.register_node("default:aspen_sapling", { - description = "Aspen Tree Sapling", + description = S("Aspen Tree Sapling"), drawtype = "plantlike", tiles = {"default_aspen_sapling.png"}, inventory_image = "default_aspen_sapling.png", @@ -1167,7 +1169,7 @@ minetest.register_node("default:aspen_sapling", { -- minetest.register_node("default:stone_with_coal", { - description = "Coal Ore", + description = S("Coal Ore"), tiles = {"default_stone.png^default_mineral_coal.png"}, groups = {cracky = 3}, drop = "default:coal_lump", @@ -1175,7 +1177,7 @@ minetest.register_node("default:stone_with_coal", { }) minetest.register_node("default:coalblock", { - description = "Coal Block", + description = S("Coal Block"), tiles = {"default_coal_block.png"}, is_ground_content = false, groups = {cracky = 3}, @@ -1184,7 +1186,7 @@ minetest.register_node("default:coalblock", { minetest.register_node("default:stone_with_iron", { - description = "Iron Ore", + description = S("Iron Ore"), tiles = {"default_stone.png^default_mineral_iron.png"}, groups = {cracky = 2}, drop = "default:iron_lump", @@ -1192,7 +1194,7 @@ minetest.register_node("default:stone_with_iron", { }) minetest.register_node("default:steelblock", { - description = "Steel Block", + description = S("Steel Block"), tiles = {"default_steel_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, @@ -1201,7 +1203,7 @@ minetest.register_node("default:steelblock", { minetest.register_node("default:stone_with_copper", { - description = "Copper Ore", + description = S("Copper Ore"), tiles = {"default_stone.png^default_mineral_copper.png"}, groups = {cracky = 2}, drop = "default:copper_lump", @@ -1209,7 +1211,7 @@ minetest.register_node("default:stone_with_copper", { }) minetest.register_node("default:copperblock", { - description = "Copper Block", + description = S("Copper Block"), tiles = {"default_copper_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, @@ -1218,7 +1220,7 @@ minetest.register_node("default:copperblock", { minetest.register_node("default:stone_with_tin", { - description = "Tin Ore", + description = S("Tin Ore"), tiles = {"default_stone.png^default_mineral_tin.png"}, groups = {cracky = 2}, drop = "default:tin_lump", @@ -1226,7 +1228,7 @@ minetest.register_node("default:stone_with_tin", { }) minetest.register_node("default:tinblock", { - description = "Tin Block", + description = S("Tin Block"), tiles = {"default_tin_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, @@ -1235,7 +1237,7 @@ minetest.register_node("default:tinblock", { minetest.register_node("default:bronzeblock", { - description = "Bronze Block", + description = S("Bronze Block"), tiles = {"default_bronze_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, @@ -1244,7 +1246,7 @@ minetest.register_node("default:bronzeblock", { minetest.register_node("default:stone_with_mese", { - description = "Mese Ore", + description = S("Mese Ore"), tiles = {"default_stone.png^default_mineral_mese.png"}, groups = {cracky = 1}, drop = "default:mese_crystal", @@ -1252,7 +1254,7 @@ minetest.register_node("default:stone_with_mese", { }) minetest.register_node("default:mese", { - description = "Mese Block", + description = S("Mese Block"), tiles = {"default_mese_block.png"}, paramtype = "light", groups = {cracky = 1, level = 2}, @@ -1262,7 +1264,7 @@ minetest.register_node("default:mese", { minetest.register_node("default:stone_with_gold", { - description = "Gold Ore", + description = S("Gold Ore"), tiles = {"default_stone.png^default_mineral_gold.png"}, groups = {cracky = 2}, drop = "default:gold_lump", @@ -1270,7 +1272,7 @@ minetest.register_node("default:stone_with_gold", { }) minetest.register_node("default:goldblock", { - description = "Gold Block", + description = S("Gold Block"), tiles = {"default_gold_block.png"}, is_ground_content = false, groups = {cracky = 1}, @@ -1279,7 +1281,7 @@ minetest.register_node("default:goldblock", { minetest.register_node("default:stone_with_diamond", { - description = "Diamond Ore", + description = S("Diamond Ore"), tiles = {"default_stone.png^default_mineral_diamond.png"}, groups = {cracky = 1}, drop = "default:diamond", @@ -1287,7 +1289,7 @@ minetest.register_node("default:stone_with_diamond", { }) minetest.register_node("default:diamondblock", { - description = "Diamond Block", + description = S("Diamond Block"), tiles = {"default_diamond_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 3}, @@ -1299,7 +1301,7 @@ minetest.register_node("default:diamondblock", { -- minetest.register_node("default:cactus", { - description = "Cactus", + description = S("Cactus"), tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, paramtype2 = "facedir", @@ -1309,7 +1311,7 @@ minetest.register_node("default:cactus", { }) minetest.register_node("default:large_cactus_seedling", { - description = "Large Cactus Seedling", + description = S("Large Cactus Seedling"), drawtype = "plantlike", tiles = {"default_large_cactus_seedling.png"}, inventory_image = "default_large_cactus_seedling.png", @@ -1380,7 +1382,7 @@ minetest.register_node("default:large_cactus_seedling", { }) minetest.register_node("default:papyrus", { - description = "Papyrus", + description = S("Papyrus"), drawtype = "plantlike", tiles = {"default_papyrus.png"}, inventory_image = "default_papyrus.png", @@ -1401,7 +1403,7 @@ minetest.register_node("default:papyrus", { }) minetest.register_node("default:dry_shrub", { - description = "Dry Shrub", + description = S("Dry Shrub"), drawtype = "plantlike", waving = 1, tiles = {"default_dry_shrub.png"}, @@ -1422,7 +1424,7 @@ minetest.register_node("default:dry_shrub", { }) minetest.register_node("default:junglegrass", { - description = "Jungle Grass", + description = S("Jungle Grass"), drawtype = "plantlike", waving = 1, visual_scale = 1.69, @@ -1443,7 +1445,7 @@ minetest.register_node("default:junglegrass", { minetest.register_node("default:grass_1", { - description = "Grass", + description = S("Grass"), drawtype = "plantlike", waving = 1, tiles = {"default_grass_1.png"}, @@ -1472,7 +1474,7 @@ minetest.register_node("default:grass_1", { for i = 2, 5 do minetest.register_node("default:grass_" .. i, { - description = "Grass", + description = S("Grass"), drawtype = "plantlike", waving = 1, tiles = {"default_grass_" .. i .. ".png"}, @@ -1495,7 +1497,7 @@ end minetest.register_node("default:dry_grass_1", { - description = "Dry Grass", + description = S("Dry Grass"), drawtype = "plantlike", waving = 1, tiles = {"default_dry_grass_1.png"}, @@ -1524,7 +1526,7 @@ minetest.register_node("default:dry_grass_1", { for i = 2, 5 do minetest.register_node("default:dry_grass_" .. i, { - description = "Dry Grass", + description = S("Dry Grass"), drawtype = "plantlike", waving = 1, tiles = {"default_dry_grass_" .. i .. ".png"}, @@ -1547,7 +1549,7 @@ end minetest.register_node("default:fern_1", { - description = "Fern", + description = S("Fern"), drawtype = "plantlike", waving = 1, tiles = {"default_fern_1.png"}, @@ -1575,7 +1577,7 @@ minetest.register_node("default:fern_1", { for i = 2, 3 do minetest.register_node("default:fern_" .. i, { - description = "Fern", + description = S("Fern"), drawtype = "plantlike", waving = 1, visual_scale = 2, @@ -1599,7 +1601,7 @@ end minetest.register_node("default:marram_grass_1", { - description = "Marram Grass", + description = S("Marram Grass"), drawtype = "plantlike", waving = 1, tiles = {"default_marram_grass_1.png"}, @@ -1627,7 +1629,7 @@ minetest.register_node("default:marram_grass_1", { for i = 2, 3 do minetest.register_node("default:marram_grass_" .. i, { - description = "Marram Grass", + description = S("Marram Grass"), drawtype = "plantlike", waving = 1, tiles = {"default_marram_grass_" .. i .. ".png"}, @@ -1650,7 +1652,7 @@ end minetest.register_node("default:bush_stem", { - description = "Bush Stem", + description = S("Bush Stem"), drawtype = "plantlike", visual_scale = 1.41, tiles = {"default_bush_stem.png"}, @@ -1667,7 +1669,7 @@ minetest.register_node("default:bush_stem", { }) minetest.register_node("default:bush_leaves", { - description = "Bush Leaves", + description = S("Bush Leaves"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_leaves_simple.png"}, @@ -1686,7 +1688,7 @@ minetest.register_node("default:bush_leaves", { }) minetest.register_node("default:bush_sapling", { - description = "Bush Sapling", + description = S("Bush Sapling"), drawtype = "plantlike", tiles = {"default_bush_sapling.png"}, inventory_image = "default_bush_sapling.png", @@ -1721,7 +1723,7 @@ minetest.register_node("default:bush_sapling", { }) minetest.register_node("default:blueberry_bush_leaves_with_berries", { - description = "Blueberry Bush Leaves with Berries", + description = S("Blueberry Bush Leaves with Berries"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_blueberry_bush_leaves.png^default_blueberry_overlay.png"}, @@ -1738,7 +1740,7 @@ minetest.register_node("default:blueberry_bush_leaves_with_berries", { }) minetest.register_node("default:blueberry_bush_leaves", { - description = "Blueberry Bush Leaves", + description = S("Blueberry Bush Leaves"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_blueberry_bush_leaves.png"}, @@ -1765,7 +1767,7 @@ minetest.register_node("default:blueberry_bush_leaves", { }) minetest.register_node("default:blueberry_bush_sapling", { - description = "Blueberry Bush Sapling", + description = S("Blueberry Bush Sapling"), drawtype = "plantlike", tiles = {"default_blueberry_bush_sapling.png"}, inventory_image = "default_blueberry_bush_sapling.png", @@ -1800,7 +1802,7 @@ minetest.register_node("default:blueberry_bush_sapling", { }) minetest.register_node("default:acacia_bush_stem", { - description = "Acacia Bush Stem", + description = S("Acacia Bush Stem"), drawtype = "plantlike", visual_scale = 1.41, tiles = {"default_acacia_bush_stem.png"}, @@ -1817,7 +1819,7 @@ minetest.register_node("default:acacia_bush_stem", { }) minetest.register_node("default:acacia_bush_leaves", { - description = "Acacia Bush Leaves", + description = S("Acacia Bush Leaves"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_acacia_leaves_simple.png"}, @@ -1836,7 +1838,7 @@ minetest.register_node("default:acacia_bush_leaves", { }) minetest.register_node("default:acacia_bush_sapling", { - description = "Acacia Bush Sapling", + description = S("Acacia Bush Sapling"), drawtype = "plantlike", tiles = {"default_acacia_bush_sapling.png"}, inventory_image = "default_acacia_bush_sapling.png", @@ -1871,7 +1873,7 @@ minetest.register_node("default:acacia_bush_sapling", { }) minetest.register_node("default:pine_bush_stem", { - description = "Pine Bush Stem", + description = S("Pine Bush Stem"), drawtype = "plantlike", visual_scale = 1.41, tiles = {"default_pine_bush_stem.png"}, @@ -1888,7 +1890,7 @@ minetest.register_node("default:pine_bush_stem", { }) minetest.register_node("default:pine_bush_needles", { - description = "Pine Bush Needles", + description = S("Pine Bush Needles"), drawtype = "allfaces_optional", waving = 1, tiles = {"default_pine_needles.png"}, @@ -1907,7 +1909,7 @@ minetest.register_node("default:pine_bush_needles", { }) minetest.register_node("default:pine_bush_sapling", { - description = "Pine Bush Sapling", + description = S("Pine Bush Sapling"), drawtype = "plantlike", tiles = {"default_pine_bush_sapling.png"}, inventory_image = "default_pine_bush_sapling.png", @@ -1942,7 +1944,7 @@ minetest.register_node("default:pine_bush_sapling", { }) minetest.register_node("default:sand_with_kelp", { - description = "Kelp", + description = S("Kelp"), drawtype = "plantlike_rooted", waving = 1, tiles = {"default_sand.png"}, @@ -2058,7 +2060,7 @@ local function coral_on_place(itemstack, placer, pointed_thing) end minetest.register_node("default:coral_green", { - description = "Green Coral", + description = S("Green Coral"), drawtype = "plantlike_rooted", waving = 1, paramtype = "light", @@ -2088,7 +2090,7 @@ minetest.register_node("default:coral_green", { }) minetest.register_node("default:coral_pink", { - description = "Pink Coral", + description = S("Pink Coral"), drawtype = "plantlike_rooted", waving = 1, paramtype = "light", @@ -2118,7 +2120,7 @@ minetest.register_node("default:coral_pink", { }) minetest.register_node("default:coral_cyan", { - description = "Cyan Coral", + description = S("Cyan Coral"), drawtype = "plantlike_rooted", waving = 1, paramtype = "light", @@ -2148,7 +2150,7 @@ minetest.register_node("default:coral_cyan", { }) minetest.register_node("default:coral_brown", { - description = "Brown Coral", + description = S("Brown Coral"), tiles = {"default_coral_brown.png"}, groups = {cracky = 3}, drop = "default:coral_skeleton", @@ -2156,7 +2158,7 @@ minetest.register_node("default:coral_brown", { }) minetest.register_node("default:coral_orange", { - description = "Orange Coral", + description = S("Orange Coral"), tiles = {"default_coral_orange.png"}, groups = {cracky = 3}, drop = "default:coral_skeleton", @@ -2164,7 +2166,7 @@ minetest.register_node("default:coral_orange", { }) minetest.register_node("default:coral_skeleton", { - description = "Coral Skeleton", + description = S("Coral Skeleton"), tiles = {"default_coral_skeleton.png"}, groups = {cracky = 3}, sounds = default.node_sound_stone_defaults(), @@ -2176,9 +2178,8 @@ minetest.register_node("default:coral_skeleton", { -- minetest.register_node("default:water_source", { - description = "Water Source", + description = S("Water Source"), drawtype = "liquid", - waving = 3, tiles = { { name = "default_water_source_animated.png", @@ -2220,9 +2221,8 @@ minetest.register_node("default:water_source", { }) minetest.register_node("default:water_flowing", { - description = "Flowing Water", + description = S("Flowing Water"), drawtype = "flowingliquid", - waving = 3, tiles = {"default_water.png"}, special_tiles = { { @@ -2268,7 +2268,7 @@ minetest.register_node("default:water_flowing", { minetest.register_node("default:river_water_source", { - description = "River Water Source", + description = S("River Water Source"), drawtype = "liquid", tiles = { { @@ -2317,7 +2317,7 @@ minetest.register_node("default:river_water_source", { }) minetest.register_node("default:river_water_flowing", { - description = "Flowing River Water", + description = S("Flowing River Water"), drawtype = "flowingliquid", tiles = {"default_river_water.png"}, special_tiles = { @@ -2366,7 +2366,7 @@ minetest.register_node("default:river_water_flowing", { minetest.register_node("default:lava_source", { - description = "Lava Source", + description = S("Lava Source"), drawtype = "liquid", tiles = { { @@ -2410,7 +2410,7 @@ minetest.register_node("default:lava_source", { }) minetest.register_node("default:lava_flowing", { - description = "Flowing Lava", + description = S("Flowing Lava"), drawtype = "flowingliquid", tiles = {"default_lava.png"}, special_tiles = { @@ -2499,15 +2499,14 @@ local function update_bookshelf(pos) end meta:set_string("formspec", formspec) if n_written + n_empty == 0 then - meta:set_string("infotext", "Empty Bookshelf") + meta:set_string("infotext", S("Empty Bookshelf")) else - meta:set_string("infotext", "Bookshelf (" .. n_written .. - " written, " .. n_empty .. " empty books)") + meta:set_string("infotext", S("Bookshelf (@1 written, @2 empty books)", n_written, n_empty)) end end minetest.register_node("default:bookshelf", { - description = "Bookshelf", + description = S("Bookshelf"), tiles = {"default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"}, paramtype2 = "facedir", @@ -2557,7 +2556,7 @@ minetest.register_node("default:bookshelf", { local function register_sign(material, desc, def) minetest.register_node("default:sign_wall_" .. material, { - description = desc .. " Sign", + description = S("@1 Sign", desc), drawtype = "nodebox", tiles = {"default_sign_wall_" .. material .. ".png"}, inventory_image = "default_sign_" .. material .. ".png", @@ -2594,7 +2593,7 @@ local function register_sign(material, desc, def) return end if string.len(text) > 512 then - minetest.chat_send_player(player_name, "Text too long") + minetest.chat_send_player(player_name, S("Text too long")) return end minetest.log("action", (player_name or "") .. " wrote \"" .. @@ -2606,18 +2605,18 @@ local function register_sign(material, desc, def) }) end -register_sign("wood", "Wooden", { +register_sign("wood", S("Wooden"), { sounds = default.node_sound_wood_defaults(), groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3} }) -register_sign("steel", "Steel", { +register_sign("steel", S("Steel"), { sounds = default.node_sound_metal_defaults(), groups = {cracky = 2, attached_node = 1} }) minetest.register_node("default:ladder_wood", { - description = "Wooden Ladder", + description = S("Wooden Ladder"), drawtype = "signlike", tiles = {"default_ladder_wood.png"}, inventory_image = "default_ladder_wood.png", @@ -2640,7 +2639,7 @@ minetest.register_node("default:ladder_wood", { }) minetest.register_node("default:ladder_steel", { - description = "Steel Ladder", + description = S("Steel Ladder"), drawtype = "signlike", tiles = {"default_ladder_steel.png"}, inventory_image = "default_ladder_steel.png", @@ -2662,7 +2661,7 @@ minetest.register_node("default:ladder_steel", { }) default.register_fence("default:fence_wood", { - description = "Apple Wood Fence", + description = S("Apple Wood Fence"), texture = "default_fence_wood.png", inventory_image = "default_fence_overlay.png^default_wood.png^" .. "default_fence_overlay.png^[makealpha:255,126,126", @@ -2674,7 +2673,7 @@ default.register_fence("default:fence_wood", { }) default.register_fence("default:fence_acacia_wood", { - description = "Acacia Wood Fence", + description = S("Acacia Wood Fence"), texture = "default_fence_acacia_wood.png", inventory_image = "default_fence_overlay.png^default_acacia_wood.png^" .. "default_fence_overlay.png^[makealpha:255,126,126", @@ -2686,7 +2685,7 @@ default.register_fence("default:fence_acacia_wood", { }) default.register_fence("default:fence_junglewood", { - description = "Jungle Wood Fence", + description = S("Jungle Wood Fence"), texture = "default_fence_junglewood.png", inventory_image = "default_fence_overlay.png^default_junglewood.png^" .. "default_fence_overlay.png^[makealpha:255,126,126", @@ -2698,7 +2697,7 @@ default.register_fence("default:fence_junglewood", { }) default.register_fence("default:fence_pine_wood", { - description = "Pine Wood Fence", + description = S("Pine Wood Fence"), texture = "default_fence_pine_wood.png", inventory_image = "default_fence_overlay.png^default_pine_wood.png^" .. "default_fence_overlay.png^[makealpha:255,126,126", @@ -2710,7 +2709,7 @@ default.register_fence("default:fence_pine_wood", { }) default.register_fence("default:fence_aspen_wood", { - description = "Aspen Wood Fence", + description = S("Aspen Wood Fence"), texture = "default_fence_aspen_wood.png", inventory_image = "default_fence_overlay.png^default_aspen_wood.png^" .. "default_fence_overlay.png^[makealpha:255,126,126", @@ -2722,7 +2721,7 @@ default.register_fence("default:fence_aspen_wood", { }) default.register_fence_rail("default:fence_rail_wood", { - description = "Apple Wood Fence Rail", + description = S("Apple Wood Fence Rail"), texture = "default_fence_rail_wood.png", inventory_image = "default_fence_rail_overlay.png^default_wood.png^" .. "default_fence_rail_overlay.png^[makealpha:255,126,126", @@ -2734,7 +2733,7 @@ default.register_fence_rail("default:fence_rail_wood", { }) default.register_fence_rail("default:fence_rail_acacia_wood", { - description = "Acacia Wood Fence Rail", + description = S("Acacia Wood Fence Rail"), texture = "default_fence_rail_acacia_wood.png", inventory_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" .. "default_fence_rail_overlay.png^[makealpha:255,126,126", @@ -2746,7 +2745,7 @@ default.register_fence_rail("default:fence_rail_acacia_wood", { }) default.register_fence_rail("default:fence_rail_junglewood", { - description = "Jungle Wood Fence Rail", + description = S("Jungle Wood Fence Rail"), texture = "default_fence_rail_junglewood.png", inventory_image = "default_fence_rail_overlay.png^default_junglewood.png^" .. "default_fence_rail_overlay.png^[makealpha:255,126,126", @@ -2758,7 +2757,7 @@ default.register_fence_rail("default:fence_rail_junglewood", { }) default.register_fence_rail("default:fence_rail_pine_wood", { - description = "Pine Wood Fence Rail", + description = S("Pine Wood Fence Rail"), texture = "default_fence_rail_pine_wood.png", inventory_image = "default_fence_rail_overlay.png^default_pine_wood.png^" .. "default_fence_rail_overlay.png^[makealpha:255,126,126", @@ -2770,7 +2769,7 @@ default.register_fence_rail("default:fence_rail_pine_wood", { }) default.register_fence_rail("default:fence_rail_aspen_wood", { - description = "Aspen Wood Fence Rail", + description = S("Aspen Wood Fence Rail"), texture = "default_fence_rail_aspen_wood.png", inventory_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" .. "default_fence_rail_overlay.png^[makealpha:255,126,126", @@ -2782,7 +2781,7 @@ default.register_fence_rail("default:fence_rail_aspen_wood", { }) minetest.register_node("default:glass", { - description = "Glass", + description = S("Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_glass.png", "default_glass_detail.png"}, paramtype = "light", @@ -2794,7 +2793,7 @@ minetest.register_node("default:glass", { }) minetest.register_node("default:obsidian_glass", { - description = "Obsidian Glass", + description = S("Obsidian Glass"), drawtype = "glasslike_framed_optional", tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"}, paramtype = "light", @@ -2807,7 +2806,7 @@ minetest.register_node("default:obsidian_glass", { minetest.register_node("default:brick", { - description = "Brick Block", + description = S("Brick Block"), paramtype2 = "facedir", place_param2 = 0, tiles = {"default_brick.png"}, @@ -2818,7 +2817,7 @@ minetest.register_node("default:brick", { minetest.register_node("default:meselamp", { - description = "Mese Lamp", + description = S("Mese Lamp"), drawtype = "glasslike", tiles = {"default_meselamp.png"}, paramtype = "light", @@ -2830,7 +2829,7 @@ minetest.register_node("default:meselamp", { }) minetest.register_node("default:mese_post_light", { - description = "Mese Post Light", + description = S("Mese Post Light"), tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png", "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png", "default_mese_post_light_side.png", "default_mese_post_light_side.png"}, @@ -2855,7 +2854,7 @@ minetest.register_node("default:mese_post_light", { -- minetest.register_node("default:cloud", { - description = "Cloud", + description = S("Cloud"), tiles = {"default_cloud.png"}, is_ground_content = false, sounds = default.node_sound_defaults(), diff --git a/mods/default/tools.lua b/mods/default/tools.lua index f7981157..d792d14a 100644 --- a/mods/default/tools.lua +++ b/mods/default/tools.lua @@ -1,5 +1,8 @@ -- mods/default/tools.lua +-- support for MT game translation. +local S = default.get_translator + -- The hand minetest.register_item(":", { type = "none", @@ -22,7 +25,7 @@ minetest.register_item(":", { -- minetest.register_tool("default:pick_wood", { - description = "Wooden Pickaxe", + description = S("Wooden Pickaxe"), inventory_image = "default_tool_woodpick.png", tool_capabilities = { full_punch_interval = 1.2, @@ -37,7 +40,7 @@ minetest.register_tool("default:pick_wood", { }) minetest.register_tool("default:pick_stone", { - description = "Stone Pickaxe", + description = S("Stone Pickaxe"), inventory_image = "default_tool_stonepick.png", tool_capabilities = { full_punch_interval = 1.3, @@ -52,7 +55,7 @@ minetest.register_tool("default:pick_stone", { }) minetest.register_tool("default:pick_bronze", { - description = "Bronze Pickaxe", + description = S("Bronze Pickaxe"), inventory_image = "default_tool_bronzepick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -67,7 +70,7 @@ minetest.register_tool("default:pick_bronze", { }) minetest.register_tool("default:pick_steel", { - description = "Steel Pickaxe", + description = S("Steel Pickaxe"), inventory_image = "default_tool_steelpick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -82,7 +85,7 @@ minetest.register_tool("default:pick_steel", { }) minetest.register_tool("default:pick_mese", { - description = "Mese Pickaxe", + description = S("Mese Pickaxe"), inventory_image = "default_tool_mesepick.png", tool_capabilities = { full_punch_interval = 0.9, @@ -97,7 +100,7 @@ minetest.register_tool("default:pick_mese", { }) minetest.register_tool("default:pick_diamond", { - description = "Diamond Pickaxe", + description = S("Diamond Pickaxe"), inventory_image = "default_tool_diamondpick.png", tool_capabilities = { full_punch_interval = 0.9, @@ -116,7 +119,7 @@ minetest.register_tool("default:pick_diamond", { -- minetest.register_tool("default:shovel_wood", { - description = "Wooden Shovel", + description = S("Wooden Shovel"), inventory_image = "default_tool_woodshovel.png", wield_image = "default_tool_woodshovel.png^[transformR90", tool_capabilities = { @@ -132,7 +135,7 @@ minetest.register_tool("default:shovel_wood", { }) minetest.register_tool("default:shovel_stone", { - description = "Stone Shovel", + description = S("Stone Shovel"), inventory_image = "default_tool_stoneshovel.png", wield_image = "default_tool_stoneshovel.png^[transformR90", tool_capabilities = { @@ -148,7 +151,7 @@ minetest.register_tool("default:shovel_stone", { }) minetest.register_tool("default:shovel_bronze", { - description = "Bronze Shovel", + description = S("Bronze Shovel"), inventory_image = "default_tool_bronzeshovel.png", wield_image = "default_tool_bronzeshovel.png^[transformR90", tool_capabilities = { @@ -164,7 +167,7 @@ minetest.register_tool("default:shovel_bronze", { }) minetest.register_tool("default:shovel_steel", { - description = "Steel Shovel", + description = S("Steel Shovel"), inventory_image = "default_tool_steelshovel.png", wield_image = "default_tool_steelshovel.png^[transformR90", tool_capabilities = { @@ -180,7 +183,7 @@ minetest.register_tool("default:shovel_steel", { }) minetest.register_tool("default:shovel_mese", { - description = "Mese Shovel", + description = S("Mese Shovel"), inventory_image = "default_tool_meseshovel.png", wield_image = "default_tool_meseshovel.png^[transformR90", tool_capabilities = { @@ -196,7 +199,7 @@ minetest.register_tool("default:shovel_mese", { }) minetest.register_tool("default:shovel_diamond", { - description = "Diamond Shovel", + description = S("Diamond Shovel"), inventory_image = "default_tool_diamondshovel.png", wield_image = "default_tool_diamondshovel.png^[transformR90", tool_capabilities = { @@ -216,7 +219,7 @@ minetest.register_tool("default:shovel_diamond", { -- minetest.register_tool("default:axe_wood", { - description = "Wooden Axe", + description = S("Wooden Axe"), inventory_image = "default_tool_woodaxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -231,7 +234,7 @@ minetest.register_tool("default:axe_wood", { }) minetest.register_tool("default:axe_stone", { - description = "Stone Axe", + description = S("Stone Axe"), inventory_image = "default_tool_stoneaxe.png", tool_capabilities = { full_punch_interval = 1.2, @@ -246,7 +249,7 @@ minetest.register_tool("default:axe_stone", { }) minetest.register_tool("default:axe_bronze", { - description = "Bronze Axe", + description = S("Bronze Axe"), inventory_image = "default_tool_bronzeaxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -261,7 +264,7 @@ minetest.register_tool("default:axe_bronze", { }) minetest.register_tool("default:axe_steel", { - description = "Steel Axe", + description = S("Steel Axe"), inventory_image = "default_tool_steelaxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -276,7 +279,7 @@ minetest.register_tool("default:axe_steel", { }) minetest.register_tool("default:axe_mese", { - description = "Mese Axe", + description = S("Mese Axe"), inventory_image = "default_tool_meseaxe.png", tool_capabilities = { full_punch_interval = 0.9, @@ -291,7 +294,7 @@ minetest.register_tool("default:axe_mese", { }) minetest.register_tool("default:axe_diamond", { - description = "Diamond Axe", + description = S("Diamond Axe"), inventory_image = "default_tool_diamondaxe.png", tool_capabilities = { full_punch_interval = 0.9, @@ -310,7 +313,7 @@ minetest.register_tool("default:axe_diamond", { -- minetest.register_tool("default:sword_wood", { - description = "Wooden Sword", + description = S("Wooden Sword"), inventory_image = "default_tool_woodsword.png", tool_capabilities = { full_punch_interval = 1, @@ -325,7 +328,7 @@ minetest.register_tool("default:sword_wood", { }) minetest.register_tool("default:sword_stone", { - description = "Stone Sword", + description = S("Stone Sword"), inventory_image = "default_tool_stonesword.png", tool_capabilities = { full_punch_interval = 1.2, @@ -340,7 +343,7 @@ minetest.register_tool("default:sword_stone", { }) minetest.register_tool("default:sword_bronze", { - description = "Bronze Sword", + description = S("Bronze Sword"), inventory_image = "default_tool_bronzesword.png", tool_capabilities = { full_punch_interval = 0.8, @@ -355,7 +358,7 @@ minetest.register_tool("default:sword_bronze", { }) minetest.register_tool("default:sword_steel", { - description = "Steel Sword", + description = S("Steel Sword"), inventory_image = "default_tool_steelsword.png", tool_capabilities = { full_punch_interval = 0.8, @@ -370,7 +373,7 @@ minetest.register_tool("default:sword_steel", { }) minetest.register_tool("default:sword_mese", { - description = "Mese Sword", + description = S("Mese Sword"), inventory_image = "default_tool_mesesword.png", tool_capabilities = { full_punch_interval = 0.7, @@ -385,7 +388,7 @@ minetest.register_tool("default:sword_mese", { }) minetest.register_tool("default:sword_diamond", { - description = "Diamond Sword", + description = S("Diamond Sword"), inventory_image = "default_tool_diamondsword.png", tool_capabilities = { full_punch_interval = 0.7, @@ -400,7 +403,7 @@ minetest.register_tool("default:sword_diamond", { }) minetest.register_tool("default:key", { - description = "Key", + description = S("Key"), inventory_image = "default_key.png", groups = {key = 1, not_in_creative_inventory = 1}, stack_max = 1, diff --git a/mods/default/torch.lua b/mods/default/torch.lua index 5de5f89f..fcdc1fec 100644 --- a/mods/default/torch.lua +++ b/mods/default/torch.lua @@ -1,3 +1,8 @@ +-- default/torch.lua + +-- support for MT game translation. +local S = default.get_translator + local function on_flood(pos, oldnode, newnode) minetest.add_item(pos, ItemStack("default:torch 1")) -- Play flame-extinguish sound if liquid is not an 'igniter' @@ -14,7 +19,7 @@ local function on_flood(pos, oldnode, newnode) end minetest.register_node("default:torch", { - description = "Torch", + description = S("Torch"), drawtype = "mesh", mesh = "torch_floor.obj", inventory_image = "default_torch_on_floor.png", diff --git a/mods/default/trees.lua b/mods/default/trees.lua index 564b7141..ad3e3f4c 100644 --- a/mods/default/trees.lua +++ b/mods/default/trees.lua @@ -1,3 +1,8 @@ +-- default/trees.lua + +-- support for MT game translation. +local S = default.get_translator + local random = math.random -- @@ -560,9 +565,12 @@ function default.sapling_on_place(itemstack, placer, pointed_thing, interval) then minetest.record_protection_violation(pos, player_name) -- Print extra information to explain +-- minetest.chat_send_player(player_name, +-- itemstack:get_definition().description .. " will intersect protection " .. +-- "on growth") minetest.chat_send_player(player_name, - itemstack:get_definition().description .. " will intersect protection " .. - "on growth") + S("@1 will intersect protection on growth.", + itemstack:get_definition().description)) return itemstack end diff --git a/mods/doors/init.lua b/mods/doors/init.lua index 9a5c9b43..eb5dd6ba 100644 --- a/mods/doors/init.lua +++ b/mods/doors/init.lua @@ -1,9 +1,15 @@ +-- doors/init.lua + -- our API object doors = {} doors.registered_doors = {} doors.registered_trapdoors = {} +-- Load support for MT game translation. +local S = minetest.get_translator("doors") + + local function replace_old_owner_information(pos) local meta = minetest.get_meta(pos) local owner = meta:get_string("doors_owner") @@ -71,7 +77,7 @@ end -- this hidden node is placed on top of the bottom, and prevents -- nodes from being placed in the top half of the door. minetest.register_node("doors:hidden", { - description = "Hidden Door Segment", + description = S("Hidden Door Segment"), -- can't use airlike otherwise falling nodes will turn to entities -- and will be forever stuck until door is removed. drawtype = "nodebox", @@ -327,7 +333,7 @@ function doors.register(name, def) if def.protected then meta:set_string("owner", pn) - meta:set_string("infotext", "Owned by " .. pn) + meta:set_string("infotext", S("Owned by @1", pn)) end if not (creative and creative.is_enabled_for and creative.is_enabled_for(pn)) then @@ -401,7 +407,7 @@ function doors.register(name, def) -- verify placer is owner of lockable door if owner ~= pname then minetest.record_protection_violation(pos, pname) - minetest.chat_send_player(pname, "You do not own this locked door.") + minetest.chat_send_player(pname, S("You do not own this locked door.")) return nil end @@ -411,7 +417,7 @@ function doors.register(name, def) meta:set_string("key_lock_secret", secret) end - return secret, "a locked door", owner + return secret, S("a locked door"), owner end def.node_dig_prediction = "" else @@ -449,7 +455,7 @@ end doors.register("door_wood", { tiles = {{ name = "doors_door_wood.png", backface_culling = true }}, - description = "Wooden Door", + description = S("Wooden Door"), inventory_image = "doors_item_wood.png", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, recipe = { @@ -461,7 +467,7 @@ doors.register("door_wood", { doors.register("door_steel", { tiles = {{name = "doors_door_steel.png", backface_culling = true}}, - description = "Steel Door", + description = S("Steel Door"), inventory_image = "doors_item_steel.png", protected = true, groups = {cracky = 1, level = 2}, @@ -477,7 +483,7 @@ doors.register("door_steel", { doors.register("door_glass", { tiles = {"doors_door_glass.png"}, - description = "Glass Door", + description = S("Glass Door"), inventory_image = "doors_item_glass.png", groups = {cracky=3, oddly_breakable_by_hand=3}, sounds = default.node_sound_glass_defaults(), @@ -492,7 +498,7 @@ doors.register("door_glass", { doors.register("door_obsidian_glass", { tiles = {"doors_door_obsidian_glass.png"}, - description = "Obsidian Glass Door", + description = S("Obsidian Glass Door"), inventory_image = "doors_item_obsidian_glass.png", groups = {cracky=3}, sounds = default.node_sound_glass_defaults(), @@ -580,7 +586,7 @@ function doors.register_trapdoor(name, def) local pn = placer:get_player_name() local meta = minetest.get_meta(pos) meta:set_string("owner", pn) - meta:set_string("infotext", "Owned by "..pn) + meta:set_string("infotext", S("Owned by @1", pn)) return (creative and creative.is_enabled_for and creative.is_enabled_for(pn)) end @@ -599,7 +605,7 @@ function doors.register_trapdoor(name, def) -- verify placer is owner of lockable door if owner ~= pname then minetest.record_protection_violation(pos, pname) - minetest.chat_send_player(pname, "You do not own this trapdoor.") + minetest.chat_send_player(pname, S("You do not own this trapdoor.")) return nil end @@ -609,7 +615,7 @@ function doors.register_trapdoor(name, def) meta:set_string("key_lock_secret", secret) end - return secret, "a locked trapdoor", owner + return secret, S("a locked trapdoor"), owner end def.node_dig_prediction = "" else @@ -679,7 +685,7 @@ function doors.register_trapdoor(name, def) end doors.register_trapdoor("doors:trapdoor", { - description = "Wooden Trapdoor", + description = S("Wooden Trapdoor"), inventory_image = "doors_trapdoor.png", wield_image = "doors_trapdoor.png", tile_front = "doors_trapdoor.png", @@ -688,7 +694,7 @@ doors.register_trapdoor("doors:trapdoor", { }) doors.register_trapdoor("doors:trapdoor_steel", { - description = "Steel Trapdoor", + description = S("Steel Trapdoor"), inventory_image = "doors_trapdoor_steel.png", wield_image = "doors_trapdoor_steel.png", tile_front = "doors_trapdoor_steel.png", @@ -795,35 +801,35 @@ function doors.register_fencegate(name, def) end doors.register_fencegate("doors:gate_wood", { - description = "Apple Wood Fence Gate", + description = S("Apple Wood Fence Gate"), texture = "default_wood.png", material = "default:wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_acacia_wood", { - description = "Acacia Wood Fence Gate", + description = S("Acacia Wood Fence Gate"), texture = "default_acacia_wood.png", material = "default:acacia_wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_junglewood", { - description = "Jungle Wood Fence Gate", + description = S("Jungle Wood Fence Gate"), texture = "default_junglewood.png", material = "default:junglewood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_pine_wood", { - description = "Pine Wood Fence Gate", + description = S("Pine Wood Fence Gate"), texture = "default_pine_wood.png", material = "default:pine_wood", groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3} }) doors.register_fencegate("doors:gate_aspen_wood", { - description = "Aspen Wood Fence Gate", + description = S("Aspen Wood Fence Gate"), texture = "default_aspen_wood.png", material = "default:aspen_wood", groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3} diff --git a/mods/dye/init.lua b/mods/dye/init.lua index ed9da085..240ba418 100644 --- a/mods/dye/init.lua +++ b/mods/dye/init.lua @@ -1,23 +1,28 @@ +-- dye/init.lua + dye = {} +-- Load support for MT game translation. +local S = minetest.get_translator("dye") + -- Make dye names and descriptions available globally dye.dyes = { - {"white", "White"}, - {"grey", "Grey"}, - {"dark_grey", "Dark grey"}, - {"black", "Black"}, - {"violet", "Violet"}, - {"blue", "Blue"}, - {"cyan", "Cyan"}, - {"dark_green", "Dark green"}, - {"green", "Green"}, - {"yellow", "Yellow"}, - {"brown", "Brown"}, - {"orange", "Orange"}, - {"red", "Red"}, - {"magenta", "Magenta"}, - {"pink", "Pink"}, + {"white", S("White")}, + {"grey", S("Grey")}, + {"dark_grey", S("Dark Grey")}, + {"black", S("Black")}, + {"violet", S("Violet")}, + {"blue", S("Blue")}, + {"cyan", S("Cyan")}, + {"dark_green", S("Dark Green")}, + {"green", S("Green")}, + {"yellow", S("Yellow")}, + {"brown", S("Brown")}, + {"orange", S("Orange")}, + {"red", S("Red")}, + {"magenta", S("Magenta")}, + {"pink", S("Pink")}, } -- Define items @@ -30,7 +35,7 @@ for _, row in ipairs(dye.dyes) do minetest.register_craftitem("dye:" .. name, { inventory_image = "dye_" .. name .. ".png", - description = description .. " Dye", + description = S("@1 Dye", description), groups = groups }) diff --git a/mods/farming/api.lua b/mods/farming/api.lua index 4a7b93df..6c13b11b 100644 --- a/mods/farming/api.lua +++ b/mods/farming/api.lua @@ -1,3 +1,7 @@ +-- farming/api.lua + +-- support for MT game translation. +local S = farming.get_translator -- Wear out hoes, place soil -- TODO Ignore group:flower @@ -78,7 +82,7 @@ farming.register_hoe = function(name, def) end -- Check def table if def.description == nil then - def.description = "Hoe" + def.description = S("Hoe") end if def.inventory_image == nil then def.inventory_image = "unknown_item.png" @@ -251,7 +255,7 @@ farming.register_plant = function(name, def) -- Check def table if not def.description then - def.description = "Seed" + def.description = S("Seed") end if not def.inventory_image then def.inventory_image = "unknown_item.png" diff --git a/mods/farming/hoes.lua b/mods/farming/hoes.lua index 2f47ec07..d005f6d0 100644 --- a/mods/farming/hoes.lua +++ b/mods/farming/hoes.lua @@ -1,5 +1,10 @@ +-- farming/hoes.lua + +-- support for MT game translation. +local S = farming.get_translator + farming.register_hoe(":farming:hoe_wood", { - description = "Wooden Hoe", + description = S("Wooden Hoe"), inventory_image = "farming_tool_woodhoe.png", max_uses = 30, material = "group:wood", @@ -7,7 +12,7 @@ farming.register_hoe(":farming:hoe_wood", { }) farming.register_hoe(":farming:hoe_stone", { - description = "Stone Hoe", + description = S("Stone Hoe"), inventory_image = "farming_tool_stonehoe.png", max_uses = 90, material = "group:stone", @@ -15,7 +20,7 @@ farming.register_hoe(":farming:hoe_stone", { }) farming.register_hoe(":farming:hoe_steel", { - description = "Steel Hoe", + description = S("Steel Hoe"), inventory_image = "farming_tool_steelhoe.png", max_uses = 500, material = "default:steel_ingot", @@ -28,21 +33,21 @@ farming.register_hoe(":farming:hoe_steel", { -- release. farming.register_hoe(":farming:hoe_bronze", { - description = "Bronze Hoe", + description = S("Bronze Hoe"), inventory_image = "farming_tool_bronzehoe.png", max_uses = 220, groups = {hoe = 1, not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_mese", { - description = "Mese Hoe", + description = S("Mese Hoe"), inventory_image = "farming_tool_mesehoe.png", max_uses = 350, groups = {hoe = 1, not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_diamond", { - description = "Diamond Hoe", + description = S("Diamond Hoe"), inventory_image = "farming_tool_diamondhoe.png", max_uses = 500, groups = {hoe = 1, not_in_creative_inventory = 1}, diff --git a/mods/farming/init.lua b/mods/farming/init.lua index 723201de..2344d45e 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -1,8 +1,13 @@ +-- farming/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("farming") + -- Global farming namespace farming = {} farming.path = minetest.get_modpath("farming") - +farming.get_translator = S -- Load files @@ -14,7 +19,7 @@ dofile(farming.path .. "/hoes.lua") -- WHEAT farming.register_plant("farming:wheat", { - description = "Wheat Seed", + description = S("Wheat Seed"), paramtype2 = "meshoptions", inventory_image = "farming_wheat_seed.png", steps = 8, @@ -26,13 +31,13 @@ farming.register_plant("farming:wheat", { }) minetest.register_craftitem("farming:flour", { - description = "Flour", + description = S("Flour"), inventory_image = "farming_flour.png", groups = {food_flour = 1, flammable = 1}, }) minetest.register_craftitem("farming:bread", { - description = "Bread", + description = S("Bread"), inventory_image = "farming_bread.png", on_use = minetest.item_eat(5), groups = {food_bread = 1, flammable = 2}, @@ -55,7 +60,7 @@ minetest.register_craft({ -- Cotton farming.register_plant("farming:cotton", { - description = "Cotton Seed", + description = S("Cotton Seed"), inventory_image = "farming_cotton_seed.png", steps = 8, minlight = 13, @@ -65,7 +70,7 @@ farming.register_plant("farming:cotton", { }) minetest.register_craftitem("farming:string", { - description = "String", + description = S("String"), inventory_image = "farming_string.png", groups = {flammable = 2}, }) diff --git a/mods/farming/nodes.lua b/mods/farming/nodes.lua index 8e33966e..8cc76471 100644 --- a/mods/farming/nodes.lua +++ b/mods/farming/nodes.lua @@ -1,3 +1,8 @@ +-- farming/nodes.lua + +-- support for MT game translation. +local S = farming.get_translator + minetest.override_item("default:dirt", { soil = { base = "default:dirt", @@ -55,7 +60,7 @@ minetest.override_item("default:dry_dirt_with_dry_grass", { }) minetest.register_node("farming:soil", { - description = "Soil", + description = S("Soil"), tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"}, drop = "default:dirt", groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, @@ -68,7 +73,7 @@ minetest.register_node("farming:soil", { }) minetest.register_node("farming:soil_wet", { - description = "Wet Soil", + description = S("Wet Soil"), tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"}, drop = "default:dirt", groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, @@ -115,7 +120,7 @@ minetest.override_item("default:desert_sand", { } }) minetest.register_node("farming:desert_sand_soil", { - description = "Desert Sand Soil", + description = S("Desert Sand Soil"), drop = "default:desert_sand", tiles = {"farming_desert_sand_soil.png", "default_desert_sand.png"}, groups = {crumbly=3, not_in_creative_inventory = 1, falling_node=1, sand=1, soil = 2, desert = 1, field = 1}, @@ -128,7 +133,7 @@ minetest.register_node("farming:desert_sand_soil", { }) minetest.register_node("farming:desert_sand_soil_wet", { - description = "Wet Desert Sand Soil", + description = S("Wet Desert Sand Soil"), drop = "default:desert_sand", tiles = {"farming_desert_sand_soil_wet.png", "farming_desert_sand_soil_wet_side.png"}, groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1, soil=3, wet = 1, desert = 1, field = 1}, @@ -141,7 +146,7 @@ minetest.register_node("farming:desert_sand_soil_wet", { }) minetest.register_node("farming:straw", { - description = "Straw", + description = S("Straw"), tiles = {"farming_straw.png"}, is_ground_content = false, groups = {snappy=3, flammable=4, fall_damage_add_percent=-30}, @@ -153,8 +158,8 @@ stairs.register_stair_and_slab( "farming:straw", {snappy = 3, flammable = 4}, {"farming_straw.png"}, - "Straw Stair", - "Straw Slab", + S("Straw Stair"), + S("Straw Slab"), default.node_sound_leaves_defaults(), true ) diff --git a/mods/fire/init.lua b/mods/fire/init.lua index 9c36720a..3c8a8fcf 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -1,7 +1,13 @@ +-- fire/init.lua + -- Global namespace for functions fire = {} +-- Load support for MT game translation. +local S = minetest.get_translator("fire") + + -- 'Enable fire' setting local fire_enabled = minetest.settings:get_bool("enable_fire") @@ -82,7 +88,7 @@ minetest.register_node("fire:basic_flame", { }) minetest.register_node("fire:permanent_flame", { - description = "Permanent Flame", + description = S("Permanent Flame"), drawtype = "firelike", tiles = { { @@ -113,7 +119,7 @@ minetest.register_node("fire:permanent_flame", { -- Flint and steel minetest.register_tool("fire:flint_and_steel", { - description = "Flint and Steel", + description = S("Flint and Steel"), inventory_image = "fire_flint_steel.png", sound = {breaks = "default_tool_breaks"}, diff --git a/mods/fireflies/init.lua b/mods/fireflies/init.lua index 066bfb4c..866a116a 100644 --- a/mods/fireflies/init.lua +++ b/mods/fireflies/init.lua @@ -1,6 +1,11 @@ --- firefly +-- firefly/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("fireflies") + + minetest.register_node("fireflies:firefly", { - description = "Firefly", + description = S("Firefly"), drawtype = "plantlike", tiles = {{ name = "fireflies_firefly_animated.png", @@ -47,7 +52,7 @@ minetest.register_node("fireflies:firefly", { }) minetest.register_node("fireflies:hidden_firefly", { - description = "Hidden Firefly", + description = S("Hidden Firefly"), drawtype = "airlike", inventory_image = "fireflies_firefly.png", wield_image = "fireflies_firefly.png", @@ -84,7 +89,7 @@ minetest.register_node("fireflies:hidden_firefly", { -- bug net minetest.register_tool("fireflies:bug_net", { - description = "Bug Net", + description = S("Bug Net"), inventory_image = "fireflies_bugnet.png", on_use = function(itemstack, player, pointed_thing) if not pointed_thing or pointed_thing.type ~= "node" or @@ -120,7 +125,7 @@ minetest.register_craft( { -- firefly in a bottle minetest.register_node("fireflies:firefly_bottle", { - description = "Firefly in a Bottle", + description = S("Firefly in a Bottle"), inventory_image = "fireflies_bottle.png", wield_image = "fireflies_bottle.png", tiles = {{ diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 9da78ed8..97317501 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -1,3 +1,5 @@ +-- flowers/init.lua + -- Minetest 0.4 mod: default -- See README.txt for licensing and other information. @@ -6,6 +8,9 @@ flowers = {} +-- Load support for MT game translation. +local S = minetest.get_translator("flowers") + -- Map Generation @@ -58,49 +63,49 @@ end flowers.datas = { { "rose", - "Red Rose", + S("Red Rose"), {-2 / 16, -0.5, -2 / 16, 2 / 16, 5 / 16, 2 / 16}, {color_red = 1, flammable = 1} }, { "tulip", - "Orange Tulip", + S("Orange Tulip"), {-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16}, {color_orange = 1, flammable = 1} }, { "dandelion_yellow", - "Yellow Dandelion", + S("Yellow Dandelion"), {-4 / 16, -0.5, -4 / 16, 4 / 16, -2 / 16, 4 / 16}, {color_yellow = 1, flammable = 1} }, { "chrysanthemum_green", - "Green Chrysanthemum", + S("Green Chrysanthemum"), {-4 / 16, -0.5, -4 / 16, 4 / 16, -1 / 16, 4 / 16}, {color_green = 1, flammable = 1} }, { "geranium", - "Blue Geranium", + S("Blue Geranium"), {-2 / 16, -0.5, -2 / 16, 2 / 16, 2 / 16, 2 / 16}, {color_blue = 1, flammable = 1} }, { "viola", - "Viola", + S("Viola"), {-5 / 16, -0.5, -5 / 16, 5 / 16, -1 / 16, 5 / 16}, {color_violet = 1, flammable = 1} }, { "dandelion_white", - "White Dandelion", + S("White Dandelion"), {-5 / 16, -0.5, -5 / 16, 5 / 16, -2 / 16, 5 / 16}, {color_white = 1, flammable = 1} }, { "tulip_black", - "Black Tulip", + S("Black Tulip"), {-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16}, {color_black = 1, flammable = 1} }, @@ -180,7 +185,7 @@ minetest.register_abm({ -- minetest.register_node("flowers:mushroom_red", { - description = "Red Mushroom", + description = S("Red Mushroom"), tiles = {"flowers_mushroom_red.png"}, inventory_image = "flowers_mushroom_red.png", wield_image = "flowers_mushroom_red.png", @@ -199,7 +204,7 @@ minetest.register_node("flowers:mushroom_red", { }) minetest.register_node("flowers:mushroom_brown", { - description = "Brown Mushroom", + description = S("Brown Mushroom"), tiles = {"flowers_mushroom_brown.png"}, inventory_image = "flowers_mushroom_brown.png", wield_image = "flowers_mushroom_brown.png", @@ -267,7 +272,7 @@ minetest.register_alias("mushroom:red_natural", "flowers:mushroom_red") -- local waterlily_def = { - description = "Waterlily", + description = S("Waterlily"), drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", diff --git a/mods/game_commands/init.lua b/mods/game_commands/init.lua index 609c4a75..139a879c 100644 --- a/mods/game_commands/init.lua +++ b/mods/game_commands/init.lua @@ -1,5 +1,11 @@ +-- game_commands/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("game_commands") + + minetest.register_chatcommand("killme", { - description = "Kill yourself to respawn", + description = S("Kill yourself to respawn"), func = function(name) local player = minetest.get_player_by_name(name) if player then @@ -15,11 +21,11 @@ minetest.register_chatcommand("killme", { -- There doesn't seem to be a way to get a default spawn pos -- from the lua API - return false, "No static_spawnpoint defined" + return false, S("No static_spawnpoint defined") end else -- Show error message if used when not logged in, eg: from IRC mod - return false, "You need to be online to be killed!" + return false, S("You need to be online to be killed!") end end }) diff --git a/mods/give_initial_stuff/init.lua b/mods/give_initial_stuff/init.lua index 4815bd84..74421dc6 100644 --- a/mods/give_initial_stuff/init.lua +++ b/mods/give_initial_stuff/init.lua @@ -1,3 +1,5 @@ +-- gave_initial_stuff/init.lua + local stuff_string = minetest.settings:get("initial_stuff") or "default:pick_steel,default:axe_steel,default:shovel_steel," .. "default:torch 99,default:cobble 99" diff --git a/mods/map/init.lua b/mods/map/init.lua index e769e77d..c858e141 100644 --- a/mods/map/init.lua +++ b/mods/map/init.lua @@ -1,8 +1,14 @@ +-- map/init.lua + -- Mod global namespace map = {} +-- Load support for MT game translation. +local S = minetest.get_translator("map") + + -- Cache creative mode setting local creative_mode_cache = minetest.settings:get_bool("creative_mode") @@ -49,7 +55,7 @@ minetest.after(5.3, cyclic_update) -- Mapping kit item minetest.register_craftitem("map:mapping_kit", { - description = "Mapping Kit\nUse with 'Minimap' key", + description = S("Mapping Kit\nUse with 'Minimap' key"), inventory_image = "map_mapping_kit.png", stack_max = 1, groups = {flammable = 3}, diff --git a/mods/player_api/init.lua b/mods/player_api/init.lua index 7a1f353e..783ff7e2 100644 --- a/mods/player_api/init.lua +++ b/mods/player_api/init.lua @@ -1,3 +1,5 @@ +-- player/init.lua + dofile(minetest.get_modpath("player_api") .. "/api.lua") -- Default player appearance diff --git a/mods/screwdriver/init.lua b/mods/screwdriver/init.lua index 7fe64a60..59d7b527 100644 --- a/mods/screwdriver/init.lua +++ b/mods/screwdriver/init.lua @@ -1,5 +1,11 @@ +-- screwdriver/init.lua + screwdriver = {} +-- Load support for MT game translation. +local S = minetest.get_translator("screwdriver") + + screwdriver.ROTATE_FACE = 1 screwdriver.ROTATE_AXIS = 2 screwdriver.disallow = function(pos, node, user, mode, new_param2) @@ -144,7 +150,7 @@ end -- Screwdriver minetest.register_tool("screwdriver:screwdriver", { - description = "Screwdriver (left-click rotates face, right-click rotates axis)", + description = S("Screwdriver (left-click rotates face, right-click rotates axis)"), inventory_image = "screwdriver.png", groups = {tool = 1}, on_use = function(itemstack, user, pointed_thing) diff --git a/mods/sethome/init.lua b/mods/sethome/init.lua index 4563381d..bad7806d 100644 --- a/mods/sethome/init.lua +++ b/mods/sethome/init.lua @@ -1,6 +1,11 @@ +-- sethome/init.lua sethome = {} +-- Load support for MT game translation. +local S = minetest.get_translator("sethome") + + local homes_file = minetest.get_worldpath() .. "/homes" local homepos = {} @@ -68,30 +73,30 @@ sethome.go = function(name) end minetest.register_privilege("home", { - description = "Can use /sethome and /home", + description = S("Can use /sethome and /home"), give_to_singleplayer = false }) minetest.register_chatcommand("home", { - description = "Teleport you to your home point", + description = S("Teleport you to your home point"), privs = {home = true}, func = function(name) if sethome.go(name) then - return true, "Teleported to home!" + return true, S("Teleported to home!") end - return false, "Set a home using /sethome" + return false, S("Set a home using /sethome") end, }) minetest.register_chatcommand("sethome", { - description = "Set your home point", + description = S("Set your home point"), privs = {home = true}, func = function(name) name = name or "" -- fallback to blank name if nil local player = minetest.get_player_by_name(name) if player and sethome.set(name, player:get_pos()) then - return true, "Home set!" + return true, S("Home set!") end - return false, "Player not found!" + return false, S("Player not found!") end, }) diff --git a/mods/sfinv/init.lua b/mods/sfinv/init.lua index 056047f3..e9021396 100644 --- a/mods/sfinv/init.lua +++ b/mods/sfinv/init.lua @@ -1,3 +1,5 @@ +-- sfinv/init.lua + dofile(minetest.get_modpath("sfinv") .. "/api.lua") sfinv.register_page("sfinv:crafting", { diff --git a/mods/spawn/init.lua b/mods/spawn/init.lua index 7bbec86e..0e1261e6 100644 --- a/mods/spawn/init.lua +++ b/mods/spawn/init.lua @@ -1,3 +1,5 @@ +-- spawn/init.lua + -- Disable by mapgen, setting or if 'static_spawnpoint' is set -------------------------------------------------------------- diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua index 8f9c316b..86146576 100644 --- a/mods/stairs/init.lua +++ b/mods/stairs/init.lua @@ -1,3 +1,5 @@ +-- stairs/init.lua + -- Minetest 0.4 mod: stairs -- See README.txt for licensing and other information. @@ -6,6 +8,9 @@ stairs = {} +-- Load support for MT game translation. +local S = minetest.get_translator("stairs") + -- Register aliases for new pine node names @@ -317,7 +322,7 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images, new_groups.stair = 1 warn_if_exists("stairs:stair_inner_" .. subname) minetest.register_node(":stairs:stair_inner_" .. subname, { - description = "Inner " .. description, + description = S("Inner @1", description), drawtype = "nodebox", tiles = stair_images, paramtype = "light", @@ -399,7 +404,7 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images, new_groups.stair = 1 warn_if_exists("stairs:stair_outer_" .. subname) minetest.register_node(":stairs:stair_outer_" .. subname, { - description = "Outer " .. description, + description = S("Outer @1", description), drawtype = "nodebox", tiles = stair_images, paramtype = "light", @@ -472,8 +477,8 @@ stairs.register_stair_and_slab( "default:wood", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, {"default_wood.png"}, - "Wooden Stair", - "Wooden Slab", + S("Wooden Stair"), + S("Wooden Slab"), default.node_sound_wood_defaults(), false ) @@ -483,8 +488,8 @@ stairs.register_stair_and_slab( "default:junglewood", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, {"default_junglewood.png"}, - "Jungle Wood Stair", - "Jungle Wood Slab", + S("Jungle Wood Stair"), + S("Jungle Wood Slab"), default.node_sound_wood_defaults(), false ) @@ -494,8 +499,8 @@ stairs.register_stair_and_slab( "default:pine_wood", {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, {"default_pine_wood.png"}, - "Pine Wood Stair", - "Pine Wood Slab", + S("Pine Wood Stair"), + S("Pine Wood Slab"), default.node_sound_wood_defaults(), false ) @@ -505,8 +510,8 @@ stairs.register_stair_and_slab( "default:acacia_wood", {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, {"default_acacia_wood.png"}, - "Acacia Wood Stair", - "Acacia Wood Slab", + S("Acacia Wood Stair"), + S("Acacia Wood Slab"), default.node_sound_wood_defaults(), false ) @@ -516,8 +521,8 @@ stairs.register_stair_and_slab( "default:aspen_wood", {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, {"default_aspen_wood.png"}, - "Aspen Wood Stair", - "Aspen Wood Slab", + S("Aspen Wood Stair"), + S("Aspen Wood Slab"), default.node_sound_wood_defaults(), false ) @@ -527,8 +532,8 @@ stairs.register_stair_and_slab( "default:stone", {cracky = 3}, {"default_stone.png"}, - "Stone Stair", - "Stone Slab", + S("Stone Stair"), + S("Stone Slab"), default.node_sound_stone_defaults(), true ) @@ -538,8 +543,8 @@ stairs.register_stair_and_slab( "default:cobble", {cracky = 3}, {"default_cobble.png"}, - "Cobblestone Stair", - "Cobblestone Slab", + S("Cobblestone Stair"), + S("Cobblestone Slab"), default.node_sound_stone_defaults(), true ) @@ -549,8 +554,8 @@ stairs.register_stair_and_slab( "default:mossycobble", {cracky = 3}, {"default_mossycobble.png"}, - "Mossy Cobblestone Stair", - "Mossy Cobblestone Slab", + S("Mossy Cobblestone Stair"), + S("Mossy Cobblestone Slab"), default.node_sound_stone_defaults(), true ) @@ -560,8 +565,8 @@ stairs.register_stair_and_slab( "default:stonebrick", {cracky = 2}, {"default_stone_brick.png"}, - "Stone Brick Stair", - "Stone Brick Slab", + S("Stone Brick Stair"), + S("Stone Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -571,8 +576,8 @@ stairs.register_stair_and_slab( "default:stone_block", {cracky = 2}, {"default_stone_block.png"}, - "Stone Block Stair", - "Stone Block Slab", + S("Stone Block Stair"), + S("Stone Block Slab"), default.node_sound_stone_defaults(), true ) @@ -582,8 +587,8 @@ stairs.register_stair_and_slab( "default:desert_stone", {cracky = 3}, {"default_desert_stone.png"}, - "Desert Stone Stair", - "Desert Stone Slab", + S("Desert Stone Stair"), + S("Desert Stone Slab"), default.node_sound_stone_defaults(), true ) @@ -593,8 +598,8 @@ stairs.register_stair_and_slab( "default:desert_cobble", {cracky = 3}, {"default_desert_cobble.png"}, - "Desert Cobblestone Stair", - "Desert Cobblestone Slab", + S("Desert Cobblestone Stair"), + S("Desert Cobblestone Slab"), default.node_sound_stone_defaults(), true ) @@ -604,8 +609,8 @@ stairs.register_stair_and_slab( "default:desert_stonebrick", {cracky = 2}, {"default_desert_stone_brick.png"}, - "Desert Stone Brick Stair", - "Desert Stone Brick Slab", + S("Desert Stone Brick Stair"), + S("Desert Stone Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -615,8 +620,8 @@ stairs.register_stair_and_slab( "default:desert_stone_block", {cracky = 2}, {"default_desert_stone_block.png"}, - "Desert Stone Block Stair", - "Desert Stone Block Slab", + S("Desert Stone Block Stair"), + S("Desert Stone Block Slab"), default.node_sound_stone_defaults(), true ) @@ -626,8 +631,8 @@ stairs.register_stair_and_slab( "default:sandstone", {crumbly = 1, cracky = 3}, {"default_sandstone.png"}, - "Sandstone Stair", - "Sandstone Slab", + S("Sandstone Stair"), + S("Sandstone Slab"), default.node_sound_stone_defaults(), true ) @@ -637,8 +642,8 @@ stairs.register_stair_and_slab( "default:sandstonebrick", {cracky = 2}, {"default_sandstone_brick.png"}, - "Sandstone Brick Stair", - "Sandstone Brick Slab", + S("Sandstone Brick Stair"), + S("Sandstone Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -648,8 +653,8 @@ stairs.register_stair_and_slab( "default:sandstone_block", {cracky = 2}, {"default_sandstone_block.png"}, - "Sandstone Block Stair", - "Sandstone Block Slab", + S("Sandstone Block Stair"), + S("Sandstone Block Slab"), default.node_sound_stone_defaults(), true ) @@ -659,8 +664,8 @@ stairs.register_stair_and_slab( "default:desert_sandstone", {crumbly = 1, cracky = 3}, {"default_desert_sandstone.png"}, - "Desert Sandstone Stair", - "Desert Sandstone Slab", + S("Desert Sandstone Stair"), + S("Desert Sandstone Slab"), default.node_sound_stone_defaults(), true ) @@ -670,8 +675,8 @@ stairs.register_stair_and_slab( "default:desert_sandstone_brick", {cracky = 2}, {"default_desert_sandstone_brick.png"}, - "Desert Sandstone Brick Stair", - "Desert Sandstone Brick Slab", + S("Desert Sandstone Brick Stair"), + S("Desert Sandstone Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -681,8 +686,8 @@ stairs.register_stair_and_slab( "default:desert_sandstone_block", {cracky = 2}, {"default_desert_sandstone_block.png"}, - "Desert Sandstone Block Stair", - "Desert Sandstone Block Slab", + S("Desert Sandstone Block Stair"), + S("Desert Sandstone Block Slab"), default.node_sound_stone_defaults(), true ) @@ -692,8 +697,8 @@ stairs.register_stair_and_slab( "default:silver_sandstone", {crumbly = 1, cracky = 3}, {"default_silver_sandstone.png"}, - "Silver Sandstone Stair", - "Silver Sandstone Slab", + S("Silver Sandstone Stair"), + S("Silver Sandstone Slab"), default.node_sound_stone_defaults(), true ) @@ -703,8 +708,8 @@ stairs.register_stair_and_slab( "default:silver_sandstone_brick", {cracky = 2}, {"default_silver_sandstone_brick.png"}, - "Silver Sandstone Brick Stair", - "Silver Sandstone Brick Slab", + S("Silver Sandstone Brick Stair"), + S("Silver Sandstone Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -714,8 +719,8 @@ stairs.register_stair_and_slab( "default:silver_sandstone_block", {cracky = 2}, {"default_silver_sandstone_block.png"}, - "Silver Sandstone Block Stair", - "Silver Sandstone Block Slab", + S("Silver Sandstone Block Stair"), + S("Silver Sandstone Block Slab"), default.node_sound_stone_defaults(), true ) @@ -725,8 +730,8 @@ stairs.register_stair_and_slab( "default:obsidian", {cracky = 1, level = 2}, {"default_obsidian.png"}, - "Obsidian Stair", - "Obsidian Slab", + S("Obsidian Stair"), + S("Obsidian Slab"), default.node_sound_stone_defaults(), true ) @@ -736,8 +741,8 @@ stairs.register_stair_and_slab( "default:obsidianbrick", {cracky = 1, level = 2}, {"default_obsidian_brick.png"}, - "Obsidian Brick Stair", - "Obsidian Brick Slab", + S("Obsidian Brick Stair"), + S("Obsidian Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -747,8 +752,8 @@ stairs.register_stair_and_slab( "default:obsidian_block", {cracky = 1, level = 2}, {"default_obsidian_block.png"}, - "Obsidian Block Stair", - "Obsidian Block Slab", + S("Obsidian Block Stair"), + S("Obsidian Block Slab"), default.node_sound_stone_defaults(), true ) @@ -758,8 +763,8 @@ stairs.register_stair_and_slab( "default:brick", {cracky = 3}, {"default_brick.png"}, - "Brick Stair", - "Brick Slab", + S("Brick Stair"), + S("Brick Slab"), default.node_sound_stone_defaults(), false ) @@ -769,8 +774,8 @@ stairs.register_stair_and_slab( "default:steelblock", {cracky = 1, level = 2}, {"default_steel_block.png"}, - "Steel Block Stair", - "Steel Block Slab", + S("Steel Block Stair"), + S("Steel Block Slab"), default.node_sound_metal_defaults(), true ) @@ -780,8 +785,8 @@ stairs.register_stair_and_slab( "default:tinblock", {cracky = 1, level = 2}, {"default_tin_block.png"}, - "Tin Block Stair", - "Tin Block Slab", + S("Tin Block Stair"), + S("Tin Block Slab"), default.node_sound_metal_defaults(), true ) @@ -791,8 +796,8 @@ stairs.register_stair_and_slab( "default:copperblock", {cracky = 1, level = 2}, {"default_copper_block.png"}, - "Copper Block Stair", - "Copper Block Slab", + S("Copper Block Stair"), + S("Copper Block Slab"), default.node_sound_metal_defaults(), true ) @@ -802,8 +807,8 @@ stairs.register_stair_and_slab( "default:bronzeblock", {cracky = 1, level = 2}, {"default_bronze_block.png"}, - "Bronze Block Stair", - "Bronze Block Slab", + S("Bronze Block Stair"), + S("Bronze Block Slab"), default.node_sound_metal_defaults(), true ) @@ -813,8 +818,8 @@ stairs.register_stair_and_slab( "default:goldblock", {cracky = 1}, {"default_gold_block.png"}, - "Gold Block Stair", - "Gold Block Slab", + S("Gold Block Stair"), + S("Gold Block Slab"), default.node_sound_metal_defaults(), true ) @@ -824,8 +829,8 @@ stairs.register_stair_and_slab( "default:ice", {cracky = 3, cools_lava = 1, slippery = 3}, {"default_ice.png"}, - "Ice Stair", - "Ice Slab", + S("Ice Stair"), + S("Ice Slab"), default.node_sound_glass_defaults(), true ) @@ -835,8 +840,8 @@ stairs.register_stair_and_slab( "default:snowblock", {crumbly = 3, cools_lava = 1, snowy = 1}, {"default_snow.png"}, - "Snow Block Stair", - "Snow Block Slab", + S("Snow Block Stair"), + S("Snow Block Slab"), default.node_sound_snow_defaults(), true ) @@ -850,7 +855,7 @@ stairs.register_stair( {"stairs_glass_split.png", "default_glass.png", "stairs_glass_stairside.png^[transformFX", "stairs_glass_stairside.png", "default_glass.png", "stairs_glass_split.png"}, - "Glass Stair", + S("Glass Stair"), default.node_sound_glass_defaults(), false ) @@ -860,7 +865,7 @@ stairs.register_slab( "default:glass", {cracky = 3}, {"default_glass.png", "default_glass.png", "stairs_glass_split.png"}, - "Glass Slab", + S("Glass Slab"), default.node_sound_glass_defaults(), false ) @@ -872,7 +877,7 @@ stairs.register_stair_inner( {"stairs_glass_stairside.png^[transformR270", "default_glass.png", "stairs_glass_stairside.png^[transformFX", "default_glass.png", "default_glass.png", "stairs_glass_stairside.png"}, - "Glass Stair", + S("Glass Stair"), default.node_sound_glass_defaults(), false ) @@ -884,7 +889,7 @@ stairs.register_stair_outer( {"stairs_glass_stairside.png^[transformR90", "default_glass.png", "stairs_glass_outer_stairside.png", "stairs_glass_stairside.png", "stairs_glass_stairside.png^[transformR90","stairs_glass_outer_stairside.png"}, - "Glass Stair", + S("Glass Stair"), default.node_sound_glass_defaults(), false ) @@ -896,7 +901,7 @@ stairs.register_stair( {"stairs_obsidian_glass_split.png", "default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png^[transformFX", "stairs_obsidian_glass_stairside.png", "default_obsidian_glass.png", "stairs_obsidian_glass_split.png"}, - "Obsidian Glass Stair", + S("Obsidian Glass Stair"), default.node_sound_glass_defaults(), false ) @@ -906,7 +911,7 @@ stairs.register_slab( "default:obsidian_glass", {cracky = 3}, {"default_obsidian_glass.png", "default_obsidian_glass.png", "stairs_obsidian_glass_split.png"}, - "Obsidian Glass Slab", + S("Obsidian Glass Slab"), default.node_sound_glass_defaults(), false ) @@ -918,7 +923,7 @@ stairs.register_stair_inner( {"stairs_obsidian_glass_stairside.png^[transformR270", "default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png^[transformFX", "default_obsidian_glass.png", "default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png"}, - "Obsidian Glass Stair", + S("Obsidian Glass Stair"), default.node_sound_glass_defaults(), false ) @@ -930,7 +935,7 @@ stairs.register_stair_outer( {"stairs_obsidian_glass_stairside.png^[transformR90", "default_obsidian_glass.png", "stairs_obsidian_glass_outer_stairside.png", "stairs_obsidian_glass_stairside.png", "stairs_obsidian_glass_stairside.png^[transformR90","stairs_obsidian_glass_outer_stairside.png"}, - "Obsidian Glass Stair", + S("Obsidian Glass Stair"), default.node_sound_glass_defaults(), false ) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 0cf3f098..0e061fa6 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -1,5 +1,11 @@ +-- tnt/init.lua + tnt = {} +-- Load support for MT game translation. +local S = minetest.get_translator("tnt") + + -- Default to enabled when in singleplayer local enable_tnt = minetest.settings:get_bool("enable_tnt") if enable_tnt == nil then @@ -422,7 +428,7 @@ minetest.register_node("tnt:boom", { }) minetest.register_node("tnt:gunpowder", { - description = "Gun Powder", + description = S("Gun Powder"), drawtype = "raillike", paramtype = "light", is_ground_content = false, @@ -547,7 +553,7 @@ minetest.register_craft({ }) minetest.register_craftitem("tnt:tnt_stick", { - description = "TNT Stick", + description = S("TNT Stick"), inventory_image = "tnt_tnt_stick.png", groups = {flammable = 5}, }) @@ -675,6 +681,6 @@ end tnt.register_tnt({ name = "tnt:tnt", - description = "TNT", + description = S("TNT"), radius = tnt_radius, }) diff --git a/mods/vessels/init.lua b/mods/vessels/init.lua index e5c68a74..6212ba8e 100644 --- a/mods/vessels/init.lua +++ b/mods/vessels/init.lua @@ -1,6 +1,12 @@ +-- vessels/init.lua + -- Minetest 0.4 mod: vessels -- See README.txt for licensing and other information. +-- Load support for MT game translation. +local S = minetest.get_translator("vessels") + + local vessels_shelf_formspec = "size[8,7;]" .. "list[context;vessels;0,0.3;8,2;]" .. @@ -30,7 +36,7 @@ local function get_vessels_shelf_formspec(inv) end minetest.register_node("vessels:shelf", { - description = "Vessels Shelf", + description = S("Vessels Shelf"), tiles = {"default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png", "vessels_shelf.png", "vessels_shelf.png"}, paramtype2 = "facedir", @@ -91,7 +97,7 @@ minetest.register_craft({ }) minetest.register_node("vessels:glass_bottle", { - description = "Empty Glass Bottle", + description = S("Empty Glass Bottle"), drawtype = "plantlike", tiles = {"vessels_glass_bottle.png"}, inventory_image = "vessels_glass_bottle.png", @@ -117,7 +123,7 @@ minetest.register_craft( { }) minetest.register_node("vessels:drinking_glass", { - description = "Empty Drinking Glass", + description = S("Empty Drinking Glass"), drawtype = "plantlike", tiles = {"vessels_drinking_glass.png"}, inventory_image = "vessels_drinking_glass_inv.png", @@ -143,7 +149,7 @@ minetest.register_craft( { }) minetest.register_node("vessels:steel_bottle", { - description = "Empty Heavy Steel Bottle", + description = S("Empty Heavy Steel Bottle"), drawtype = "plantlike", tiles = {"vessels_steel_bottle.png"}, inventory_image = "vessels_steel_bottle.png", @@ -172,7 +178,7 @@ minetest.register_craft( { -- Glass and steel recycling minetest.register_craftitem("vessels:glass_fragments", { - description = "Glass Fragments", + description = S("Glass Fragments"), inventory_image = "vessels_glass_fragments.png", }) diff --git a/mods/walls/init.lua b/mods/walls/init.lua index a14cc7f2..c267eba5 100644 --- a/mods/walls/init.lua +++ b/mods/walls/init.lua @@ -1,5 +1,11 @@ +-- walls/init.lua + walls = {} +-- Load support for MT game translation. +local S = minetest.get_translator("walls") + + walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wall_sounds) --make wall_texture_table paramenter backwards compatible for mods passing single texture if type(wall_texture_table) ~= "table" then @@ -39,12 +45,12 @@ walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wa end -walls.register("walls:cobble", "Cobblestone Wall", {"default_cobble.png"}, +walls.register("walls:cobble", S("Cobblestone Wall"), {"default_cobble.png"}, "default:cobble", default.node_sound_stone_defaults()) -walls.register("walls:mossycobble", "Mossy Cobblestone Wall", {"default_mossycobble.png"}, +walls.register("walls:mossycobble", S("Mossy Cobblestone Wall"), {"default_mossycobble.png"}, "default:mossycobble", default.node_sound_stone_defaults()) -walls.register("walls:desertcobble", "Desert Cobblestone Wall", {"default_desert_cobble.png"}, +walls.register("walls:desertcobble", S("Desert Cobblestone Wall"), {"default_desert_cobble.png"}, "default:desert_cobble", default.node_sound_stone_defaults()) diff --git a/mods/wool/init.lua b/mods/wool/init.lua index d10074a1..1464423e 100644 --- a/mods/wool/init.lua +++ b/mods/wool/init.lua @@ -1,10 +1,15 @@ +-- wool/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("wool") + local dyes = dye.dyes for i = 1, #dyes do local name, desc = unpack(dyes[i]) minetest.register_node("wool:" .. name, { - description = desc .. " Wool", + description = S("@1 Wool", desc), tiles = {"wool_" .. name .. ".png"}, is_ground_content = false, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, diff --git a/mods/xpanes/init.lua b/mods/xpanes/init.lua index ed68e0af..d978beeb 100644 --- a/mods/xpanes/init.lua +++ b/mods/xpanes/init.lua @@ -1,3 +1,8 @@ +-- xpanes/init.lua + +-- Load support for MT game translation. +local S = minetest.get_translator("xpanes") + local function is_pane(pos) return minetest.get_item_group(minetest.get_node(pos).name, "pane") > 0 @@ -148,7 +153,7 @@ function xpanes.register_pane(name, def) end xpanes.register_pane("pane", { - description = "Glass Pane", + description = S("Glass Pane"), textures = {"default_glass.png","xpanes_pane_half.png","xpanes_edge.png"}, inventory_image = "default_glass.png", wield_image = "default_glass.png", @@ -161,7 +166,7 @@ xpanes.register_pane("pane", { }) xpanes.register_pane("obsidian_pane", { - description = "Obsidian Glass Pane", + description = S("Obsidian Glass Pane"), textures = {"default_obsidian_glass.png","xpanes_pane_half.png","xpanes_edge_obsidian.png"}, inventory_image = "default_obsidian_glass.png", wield_image = "default_obsidian_glass.png", @@ -174,7 +179,7 @@ xpanes.register_pane("obsidian_pane", { }) xpanes.register_pane("bar", { - description = "Steel Bars", + description = S("Steel Bars"), textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_bar_top.png"}, inventory_image = "xpanes_bar.png", wield_image = "xpanes_bar.png",