Skip to content
Permalink
Browse files

Add support for MT 5 game translation (rebasing ) (#2466)

rebased #2368
  • Loading branch information...
yquemener authored and sfan5 committed Sep 10, 2019
1 parent d99a176 commit bb9279ccb843937bc8001ce333e3ccb71b0dba2d
@@ -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 = {
@@ -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")

@@ -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,

@@ -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},
@@ -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)
@@ -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}
)

@@ -1,16 +1,21 @@
-- 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
local name = butter_list[i][1]
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",
@@ -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)
@@ -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
@@ -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"
@@ -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,
@@ -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)

0 comments on commit bb9279c

Please sign in to comment.
You can’t perform that action at this time.