Skip to content

Commit

Permalink
Translations: protector_lott. Related to #328 (#1871)
Browse files Browse the repository at this point in the history
  • Loading branch information
lord-papirus authored Dec 23, 2024
1 parent 16dd8dd commit ded38fb
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 147 deletions.
6 changes: 3 additions & 3 deletions mods/lord/Blocks/protector_lott/blocks.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = lord.require_intllib()
local S = minetest.get_mod_translator()

minetest.register_alias("protector_lott:protect", "protector_lott:protect_stone")

Expand All @@ -12,7 +12,7 @@ local function reg_prot_node(subname, desc, base_node_name, texture)
end

minetest.register_node("protector_lott:protect_"..subname, {
description = SL("Protection "..desc),
description = S("Protection "..desc),
tiles = {texture, texture, texture.."^protector_logo.png"},
sounds = default.node_sound_stone_defaults(),
groups = groups,
Expand All @@ -21,7 +21,7 @@ local function reg_prot_node(subname, desc, base_node_name, texture)
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", SL("Protection").." ("..SL("owned by").." " .. meta:get_string("owner") .. ")")
meta:set_string("infotext", S("Protection").." ("..S("owned by").." " .. meta:get_string("owner") .. ")")
meta:set_string("members", "")
end,

Expand Down
14 changes: 7 additions & 7 deletions mods/lord/Blocks/protector_lott/chests.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
local SL = lord.require_intllib()
local S = minetest.get_mod_translator()

-- Protected Chest

minetest.register_node("protector_lott:chest", {
description = SL("Protected Chest"),
description = S("Protected Chest"),
tiles = {
"default_chest_top.png", "default_chest_top.png",
"default_chest_side.png", "default_chest_side.png",
Expand All @@ -17,7 +17,7 @@ minetest.register_node("protector_lott:chest", {

on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", SL("Protected Chest"))
meta:set_string("infotext", S("Protected Chest"))
meta:set_string("name", "")
local inv = meta:get_inventory()
inv:set_size("main", 8 * 4)
Expand Down Expand Up @@ -49,10 +49,10 @@ minetest.register_node("protector_lott:chest", {
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec = "size[8,9]"
.. "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"
.. "button[0,4.5;2,0.25;toup;"..SL("To Chest").."]"
.. "button[0,4.5;2,0.25;toup;"..S("To Chest").."]"
.. "field[2.3,4.8;4,0.25;chestname;;"
.. meta:get_string("name") .. "]"
.. "button[6,4.5;2,0.25;todn;"..SL("To Inventory").."]"
.. "button[6,4.5;2,0.25;todn;"..S("To Inventory").."]"
.. "list[current_player;main;0,5;8,1;]"
.. "list[current_player;main;0,6.08;8,3;8]"
.. "listring[nodemeta:" .. spos .. ";main]"
Expand Down Expand Up @@ -110,9 +110,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.chestname ~= "" then
meta:set_string("name", fields.chestname)
meta:set_string("infotext",
SL("Protected Chest").." (" .. fields.chestname .. ")")
S("Protected Chest").." (" .. fields.chestname .. ")")
else
meta:set_string("infotext", SL("Protected Chest"))
meta:set_string("infotext", S("Protected Chest"))
end

end
Expand Down
4 changes: 2 additions & 2 deletions mods/lord/Blocks/protector_lott/doors.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local SL = lord.require_intllib()
local S = minetest.get_mod_translator()

-- Register Protected Doors

Expand All @@ -13,7 +13,7 @@ local function reg_prot_door(desc, name, door, mat, texture_i, texture_uv)
end
doors.register(name, {
tiles = {{ name = texture_uv.."^protector_logo_door_uv.png", backface_culling = true }},
description = SL(desc),
description = S(desc),
inventory_image = texture_i.."^protector_logo_i.png",
groups = gd,
sunlight = true,
Expand Down
34 changes: 17 additions & 17 deletions mods/lord/Blocks/protector_lott/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local SL = lord.require_intllib()
local S = minetest.get_mod_translator()

minetest.register_privilege("delprotect", SL("Ignore player protection"))
minetest.register_privilege("delprotect", S("Ignore player protection"))


-- get static spawn position
Expand Down Expand Up @@ -53,8 +53,8 @@ end
protector.generate_formspec = function(meta)

local formspec = "size[8,7]"
.."label[0,1;"..SL("PUNCH node to show protected area or USE for area check").."]"
.."label[0,2;"..SL("Members: (type player name then press Enter to add)").."]"
.."label[0,1;"..S("PUNCH node to show protected area or USE for area check").."]"
.."label[0,2;"..S("Members: (type player name then press Enter to add)").."]"

local members = protector.get_member_list(meta)
local npp = 12
Expand All @@ -79,7 +79,7 @@ protector.generate_formspec = function(meta)
"field_close_on_enter[protector_add_member;false]"
end

formspec = formspec .. "button_exit[2.5,6.2;3,0.5;close_me;"..SL("Close").."]"
formspec = formspec .. "button_exit[2.5,6.2;3,0.5;close_me;"..S("Close").."]"

return formspec
end
Expand Down Expand Up @@ -131,15 +131,15 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
if infolevel == 1 then
minetest.get_player_by_name(digger):set_hp(dig_player:get_hp()-protector.damage)
minetest.chat_send_player(digger,
SL("This area is owned by").." " .. owner .. "!")
S("This area is owned by").." " .. owner .. "!")
elseif infolevel == 2 then
minetest.chat_send_player(digger,
SL("This area is owned by").." " .. owner .. ".")
S("This area is owned by").." " .. owner .. ".")
minetest.chat_send_player(digger,
SL("Protection located at:").." " .. minetest.pos_to_string(p))
S("Protection located at:").." " .. minetest.pos_to_string(p))
if members ~= "" then
minetest.chat_send_player(digger,
SL("Members:").." ".. members .. ".")
S("Members:").." ".. members .. ".")
end
end
return false
Expand All @@ -148,12 +148,12 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)

if infolevel == 2 then
minetest.chat_send_player(digger,
SL("This area is owned by").." " .. owner .. ".")
S("This area is owned by").." " .. owner .. ".")
minetest.chat_send_player(digger,
SL("Protection located at:").." " .. minetest.pos_to_string(positions[1]))
S("Protection located at:").." " .. minetest.pos_to_string(positions[1]))
if members ~= "" then
minetest.chat_send_player(digger,
SL("Members:").." ".. members .. ".")
S("Members:").." ".. members .. ".")
end
break
end
Expand All @@ -163,9 +163,9 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
if infolevel == 2 then
if #positions < 1 then
minetest.chat_send_player(digger,
SL("This area is not protected."))
S("This area is not protected."))
end
minetest.chat_send_player(digger, SL("You can build here."))
minetest.chat_send_player(digger, S("You can build here."))
end

return true
Expand Down Expand Up @@ -226,7 +226,7 @@ function minetest.item_place(itemstack, placer, pointed_thing)
local pos = pointed_thing.under
if not protector.can_dig(protector.radius * 2, pos, user, true, 3) then
minetest.chat_send_player(user,
SL("Overlaps into another protected area!"))
S("Overlaps into another protected area!"))
return protector.old_node_place(itemstack, placer, pos)
end
end
Expand All @@ -240,7 +240,7 @@ end
--= Protection Logo

minetest.register_node("protector_lott:protect2", {
description = SL("Protection Logo"),
description = S("Protection Logo"),
tiles = {"protector_logo.png"},
wield_image = "protector_logo.png",
inventory_image = "protector_logo.png",
Expand All @@ -264,7 +264,7 @@ minetest.register_node("protector_lott:protect2", {
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", SL("Protection").." ("..SL("owned by").." " .. meta:get_string("owner") .. ")")
meta:set_string("infotext", S("Protection").." ("..S("owned by").." " .. meta:get_string("owner") .. ")")
meta:set_string("members", "")
end,

Expand Down
59 changes: 0 additions & 59 deletions mods/lord/Blocks/protector_lott/locale/en.txt

This file was deleted.

60 changes: 60 additions & 0 deletions mods/lord/Blocks/protector_lott/locale/protector_lott.ru.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# textdomain: protector_lott
### init.lua ###
Protection Logo=Знак защиты

Protection=Защита
owned by=только для

PUNCH node to show protected area or USE for area check=Ударьте этот нод для подсветки защищённой области.
Members: (type player name then press Enter to add)=Доступ для (введите имя игрока и нажмите Enter для добавления):
Close=Закрыть

This area is owned by=Это только для
Protection located at:=Защитный блок на координатах:
Members:=Также доступно для:
This area is not protected.=Этот блок не защищён.
You can build here.=Вы можете здесь строить.

Overlaps into another protected area!=Перекрытие с другими защищёнными регионами!

To Chest=В сундук
To Inventory=В инвентарь

Ignore player protection=Возможность игнорировать защиту игроков

### blocks.lua ###
Protection Brick Block=Защитный кирпич
Protection Obsidian=Защитный обсидиан
Protection Stone=Защитный камень
Protection Cobble=Защитный булыжник
Protection Stonebrick=Защитный каменный кирпич
Protection Desert Stone=Защитный пустынный камень
Protection Desert Cobble=Защитный пустынный булыжник
Protection Desert Stone Brick=Защитный кирпич из пустынного камня
Protection Sandstone=Защитный песчаник
Protection Sandstone Brick=Защитный кирпич из песчаника
Protection Dungeon Stone=Защитный малахит
Protection Paving Stone=Защитная брусчатка
Protection Marble=Защитный мрамор
Protection Marble Brick=Защитный мраморный кирпич
Protection Orc Brick=Защитный орочий камень
Protection Mordor Stone=Защитный камень Мордора

### doors.lua ###
Protected Steel Door=Защищённая стальная дверь
Protected Glass Door=Защищённая стеклянная дверь
Protected Obsidian Glass Door=Защищённая стеклянно-обсидиановая дверь

Protected Wooden Door=Защищённая яблоневая дверь
Protected Junglewood Door=Защищённая эвкалиптовая дверь
Protected Alder Door=Защищённая ольховая дверь
Protected Birch Door=Защищённая берёзовая дверь
Protected Pine Door=Защищённая сосновая дверь
Protected Lebethron Door=Защищённая лебетроновая дверь
Protected Mallorn Door=Защищённая маллорновая дверь

Protected Oak Door=Защищённая дверь с зарешоченным окном
Protected Jail Door=Защищённая дверь-решётка

### chests.lua ###
Protected Chest=Защищённый сундук
59 changes: 0 additions & 59 deletions mods/lord/Blocks/protector_lott/locale/ru.txt

This file was deleted.

0 comments on commit ded38fb

Please sign in to comment.