diff --git a/mods/bones/init.lua b/mods/bones/init.lua index 852728cf..71bd29a3 100644 --- a/mods/bones/init.lua +++ b/mods/bones/init.lua @@ -1,6 +1,15 @@ -- Minetest 0.4 mod: bones -- See README.txt for licensing and other information. +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + bones_formspec = "size[8,9]".. "list[current_name;main;0,0;8,4;]".. @@ -18,7 +27,7 @@ local function is_owner(pos, name) end minetest.register_node("bones:bones", { - description = "Gravestone", + description = S("Gravestone"), tiles = {"default_stone.png", "default_stone.png", "default_stone.png", "default_stone.png", "default_stone.png", "default_stone.png^bones_writing.png", @@ -288,7 +297,7 @@ local function growgen(pointed_thing) end minetest.register_craftitem("bones:bonedust", { - description = "Bone Dust", + description = S("Bone Dust"), inventory_image = "bones_bonedust.png", liquids_pointable = false, stack_max = 99, @@ -302,7 +311,7 @@ minetest.register_craftitem("bones:bonedust", { }) minetest.register_craftitem("bones:bone", { - description = "Bone", + description = S("Bone"), inventory_image = "bones_bone.png", }) @@ -325,7 +334,7 @@ minetest.register_craft({ }) minetest.register_tool("bones:bone_scythe", { - description = "Bone Scythe", + description = S("Bone Scythe"), inventory_image = "bones_scythe.png", tool_capabilities = { full_punch_interval = 0.7, @@ -356,7 +365,7 @@ minetest.register_craft({ }) minetest.register_node("bones:skeleton", { - description = "Skeleton Head", + description = S("Skeleton Head"), drawtype = "nodebox", tiles = { "bones_skeleton_top.png", @@ -386,7 +395,7 @@ minetest.register_node("bones:skeleton", { }) minetest.register_node("bones:skeleton_body", { - description = "Skeleton", + description = S("Skeleton"), drawtype = "nodebox", tiles = {"bones_skeleton_top.png"}, inventory_image = "bones_skeleton.png", diff --git a/mods/bones/intllib.lua b/mods/bones/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/bones/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/bones/locale/de.txt b/mods/bones/locale/de.txt new file mode 100644 index 00000000..4f05d382 --- /dev/null +++ b/mods/bones/locale/de.txt @@ -0,0 +1,8 @@ +### init.lua +Bone = Knochen +Bone Dust = Knochenstaub +Bone Scythe = Knochensense +Gravestone = Grabstein +Skeleton = Skelett +Skeleton Head = Schädel + diff --git a/mods/bones/locale/template.txt b/mods/bones/locale/template.txt new file mode 100644 index 00000000..15a17cd2 --- /dev/null +++ b/mods/bones/locale/template.txt @@ -0,0 +1,8 @@ +### init.lua +Bone = +Bone Dust = +Bone Scythe = +Gravestone = +Skeleton = +Skeleton Head = + diff --git a/mods/bones/mod.conf b/mods/bones/mod.conf index 7f3dc797..f75f6575 100644 --- a/mods/bones/mod.conf +++ b/mods/bones/mod.conf @@ -1,3 +1,4 @@ name = bones description = Modified Minetest Game mod: bones - Add bones-related items and death mechanics -depends = default, lottfarming \ No newline at end of file +depends = default, lottfarming +optional_depends = intllib diff --git a/mods/default/intllib.lua b/mods/default/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/default/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/default/locale/de.txt b/mods/default/locale/de.txt new file mode 100644 index 00000000..6ad7b74e --- /dev/null +++ b/mods/default/locale/de.txt @@ -0,0 +1,17 @@ +### init.lua +Wooden Pickaxe = Holzspitzhacke +Stone Pickaxe = Steinspitzhacke +Steel Pickaxe = Stahlspitzhacke +Bronze Pickaxe = Bronzespitzhacke +Wooden Shovel = Holzschaufel +Stone Shovel = Steinschaufel +Steel Shovel = Stahlschaufel +Bronze Shovel = Bronzeschaufel +Wooden Axe = Holzaxt +Stone Axe = Steinaxt +Steel Axe = Stahlaxt +Bronze Axe = Bronzeaxt +Wooden Sword = Holzschwert +Stone Sword = Steinschwert +Steel Sword = Stahlschwert +Bronze Sword = Bronzeschwert diff --git a/mods/default/locale/template.txt b/mods/default/locale/template.txt new file mode 100644 index 00000000..65c5b0bb --- /dev/null +++ b/mods/default/locale/template.txt @@ -0,0 +1,17 @@ +### init.lua +Wooden Pickaxe = +Stone Pickaxe = +Steel Pickaxe = +Bronze Pickaxe = +Wooden Shovel = +Stone Shovel = +Steel Shovel = +Bronze Shovel = +Wooden Axe = +Stone Axe = +Steel Axe = +Bronze Axe = +Wooden Sword = +Stone Sword = +Steel Sword = +Bronze Sword = diff --git a/mods/default/mod.conf b/mods/default/mod.conf index f55aa412..4cad038d 100644 --- a/mods/default/mod.conf +++ b/mods/default/mod.conf @@ -1,2 +1,3 @@ name = default -description = Modified Minetest Game mod: default - Modified to suit LOTT's needs, with outdated minetest_game code \ No newline at end of file +description = Modified Minetest Game mod: default - Modified to suit LOTT's needs, with outdated minetest_game code +optional_depends = intllib diff --git a/mods/default/tools.lua b/mods/default/tools.lua index 323d8602..c13afaaf 100644 --- a/mods/default/tools.lua +++ b/mods/default/tools.lua @@ -1,5 +1,14 @@ -- mods/default/tools.lua +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + -- The hand minetest.register_item(":", { type = "none", @@ -22,7 +31,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, @@ -34,7 +43,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, @@ -46,7 +55,7 @@ minetest.register_tool("default:pick_stone", { }, }) 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, @@ -58,7 +67,7 @@ minetest.register_tool("default:pick_steel", { }, }) 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, @@ -75,7 +84,7 @@ minetest.register_tool("default:pick_bronze", { -- 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 = { @@ -88,7 +97,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 = { @@ -101,7 +110,7 @@ minetest.register_tool("default:shovel_stone", { }, }) 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 = { @@ -114,7 +123,7 @@ minetest.register_tool("default:shovel_steel", { }, }) 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 = { @@ -132,7 +141,7 @@ minetest.register_tool("default:shovel_bronze", { -- 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, @@ -144,7 +153,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, @@ -156,7 +165,7 @@ minetest.register_tool("default:axe_stone", { }, }) 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, @@ -168,7 +177,7 @@ minetest.register_tool("default:axe_steel", { }, }) 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, @@ -185,7 +194,7 @@ minetest.register_tool("default:axe_bronze", { -- minetest.register_tool("default:sword_wood", { - description = "Wooden Sword", + description = S("Wooden Sword"), inventory_image = "default_tool_woodsword.png", tool_capabilities = { full_punch_interval = 2, @@ -197,7 +206,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.5, @@ -209,7 +218,7 @@ minetest.register_tool("default:sword_stone", { } }) minetest.register_tool("default:sword_steel", { - description = "Steel Sword", + description = S("Steel Sword"), inventory_image = "default_tool_steelsword.png", tool_capabilities = { full_punch_interval = 1.05, @@ -221,7 +230,7 @@ minetest.register_tool("default:sword_steel", { } }) 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.9, diff --git a/mods/farming/init.lua b/mods/farming/init.lua index 08b7d80c..4d47ce6d 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -1,13 +1,22 @@ -- Minetest 0.4 mod: farming -- See README.txt for licensing and other information. +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + farming = {} -- -- Soil -- minetest.register_node("farming:soil", { - description = "Soil", + description = S("Soil"), tiles = {"farming_soil.png", "default_dirt.png"}, drop = "default:dirt", is_ground_content = true, @@ -16,7 +25,7 @@ minetest.register_node("farming:soil", { }) minetest.register_node("farming:soil_wet", { - description = "Wet Soil", + description = S("Wet Soil"), tiles = {"farming_soil_wet.png", "farming_soil_wet_side.png"}, drop = "default:dirt", is_ground_content = true, @@ -107,7 +116,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses) end minetest.register_tool("farming:hoe_wood", { - description = "Wooden Hoe", + description = S("Wooden Hoe"), inventory_image = "farming_tool_woodhoe.png", on_use = function(itemstack, user, pointed_thing) @@ -116,7 +125,7 @@ minetest.register_tool("farming:hoe_wood", { }) minetest.register_tool("farming:hoe_stone", { - description = "Stone Hoe", + description = S("Stone Hoe"), inventory_image = "farming_tool_stonehoe.png", on_use = function(itemstack, user, pointed_thing) @@ -125,7 +134,7 @@ minetest.register_tool("farming:hoe_stone", { }) minetest.register_tool("farming:hoe_steel", { - description = "Steel Hoe", + description = S("Steel Hoe"), inventory_image = "farming_tool_steelhoe.png", on_use = function(itemstack, user, pointed_thing) @@ -134,7 +143,7 @@ minetest.register_tool("farming:hoe_steel", { }) minetest.register_tool("farming:hoe_bronze", { - description = "Bronze Hoe", + description = S("Bronze Hoe"), inventory_image = "farming_tool_bronzehoe.png", on_use = function(itemstack, user, pointed_thing) @@ -206,7 +215,7 @@ for i=2,5 do end minetest.register_node(":default:junglegrass", { - description = "Jungle Grass", + description = S("Jungle Grass"), drawtype = "plantlike", visual_scale = 1.3, tiles = {"default_junglegrass.png"}, @@ -283,7 +292,7 @@ end -- Wheat -- minetest.register_craftitem("farming:seed_wheat", { - description = "Wheat Seed", + description = S("Wheat Seed"), inventory_image = "farming_wheat_seed.png", on_place = function(itemstack, placer, pointed_thing) return place_seed(itemstack, placer, pointed_thing, "farming:wheat_1") @@ -291,17 +300,17 @@ minetest.register_craftitem("farming:seed_wheat", { }) minetest.register_craftitem("farming:wheat", { - description = "Wheat", + description = S("Wheat"), inventory_image = "farming_wheat.png", }) minetest.register_craftitem("farming:flour", { - description = "Flour", + description = S("Flour"), inventory_image = "farming_flour.png", }) minetest.register_craftitem("farming:bread", { - description = "Bread", + description = S("Bread"), inventory_image = "farming_bread.png", on_use = minetest.item_eat(4), }) @@ -383,7 +392,7 @@ minetest.register_abm({ -- Cotton -- minetest.register_craftitem("farming:seed_cotton", { - description = "Cotton Seed", + description = S("Cotton Seed"), inventory_image = "farming_cotton_seed.png", on_place = function(itemstack, placer, pointed_thing) return place_seed(itemstack, placer, pointed_thing, "farming:cotton_1") @@ -391,7 +400,7 @@ minetest.register_craftitem("farming:seed_cotton", { }) minetest.register_craftitem("farming:string", { - description = "String", + description = S("String"), inventory_image = "farming_string.png", }) @@ -466,7 +475,7 @@ minetest.register_abm({ }) 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}, diff --git a/mods/farming/intllib.lua b/mods/farming/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/farming/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/farming/locale/de.txt b/mods/farming/locale/de.txt new file mode 100644 index 00000000..935aa26c --- /dev/null +++ b/mods/farming/locale/de.txt @@ -0,0 +1,25 @@ +### init.lua +Soil = Ackerboden +Wet Soil = Nasser Ackerboden +Savanna Soil = Savannenackerboden +Wet Savanna Soil = Nasser Savannenackerboden +Desert Sand Soil = Wüstensandackerboden +Wet Desert Sand Soil = Nasser Wüstensandackerboden +Wet Soil = Nasser Ackerboden +Wooden Hoe = Holzhacke +Stone Hoe = Steinhacke +Steel Hoe = Stahlhacke +Bronze Hoe = Bronzehacke +Wheat Seed = Weizensamen +Wheat Seed = Weizensamen +Wheat = Weizen +Flour = Mehl +Bread = Brot +Cotton Seed = Baumwollsamen +String = Faden +Straw = Stroh +Straw Stair = Strohtreppe +Straw Slab = Strohplatte +Inner Straw Stair = Innere Strohtreppe +Outer Straw Stair = Äußere Strohtreppe +Jungle Grass = Dschungelgras diff --git a/mods/farming/locale/template.txt b/mods/farming/locale/template.txt new file mode 100644 index 00000000..3a586e8c --- /dev/null +++ b/mods/farming/locale/template.txt @@ -0,0 +1,25 @@ +### init.lua +Soil = +Wet Soil = +Savanna Soil = +Wet Savanna Soil = +Desert Sand Soil = +Wet Desert Sand Soil = +Wet Soil = +Wooden Hoe = +Stone Hoe = +Steel Hoe = +Bronze Hoe = +Wheat Seed = +Wheat Seed = +Wheat = +Flour = +Bread = +Cotton Seed = +String = +Straw = +Straw Stair = +Straw Slab = +Inner Straw Stair = +Outer Straw Stair = +Jungle Grass = diff --git a/mods/farming/mod.conf b/mods/farming/mod.conf index d49297ee..ff4ef6f9 100644 --- a/mods/farming/mod.conf +++ b/mods/farming/mod.conf @@ -1,3 +1,4 @@ name = farming description = Old Minetest Game mod: farming -depends = default, wool \ No newline at end of file +depends = default, wool +optional_depends = intllib diff --git a/mods/lottachievements/init.lua b/mods/lottachievements/init.lua index 8329568a..f3df09d4 100644 --- a/mods/lottachievements/init.lua +++ b/mods/lottachievements/init.lua @@ -33,7 +33,7 @@ dofile(minetest.get_modpath("lottachievements").."/triggers.lua") minetest.register_craftitem("lottachievements:achievement_book", { - description = "Achievement Book", + description = S("Achievement Book"), inventory_image = "lottachievements_achievement_book.png", groups = {book=1}, on_place = function(_, player) @@ -49,15 +49,15 @@ minetest.register_craftitem("lottachievements:achievement_book", { -- Random Achievements! lottachievements.register_achievement("smoke_rings", { - title = "Smoke Rings", - description = "Blow a smoke ring with a pipe", + title = S("Smoke Rings"), + description = S("Blow a smoke ring with a pipe"), icon = "lottfarming_smoke_ring.png", id = 1, }) lottachievements.register_achievement("a_long_path_to_mushrooms", { - title = "A Long Path to Mushrooms", - description = "Show a hobbitish love of mushrooms by eating 99 brown mushrooms!", + title = S("A Long Path to Mushrooms"), + description = S("Show a hobbitish love of mushrooms by eating 99 brown mushrooms!"), icon = "lottplants_mushroom_wild.png", id = 2, trigger = { @@ -68,8 +68,8 @@ lottachievements.register_achievement("a_long_path_to_mushrooms", { }) lottachievements.register_achievement("tasty_taters", { - title = "Tasty Taters", - description = "Fill your belly with the good ballast of 9 potatoes", + title = S("Tasty Taters"), + description = S("Fill your belly with the good ballast of 9 potatoes"), icon = "lottfarming_potato_cooked.png", id = 3, trigger = { @@ -80,15 +80,15 @@ lottachievements.register_achievement("tasty_taters", { }) lottachievements.register_achievement("thief", { - title = "Thief!", - description = "Use a lockpick to break into a chest of a different race", + title = S("Thief!"), + description = S("Use a lockpick to break into a chest of a different race"), icon = "lottblocks_steel_lockpick.png", id = 4, }) lottachievements.register_achievement("rope_is_useful", { - title = "Rope is useful!", - description = "Craft 100 meters of elven rope", + title = S("Rope is useful!"), + description = S("Craft 100 meters of elven rope"), icon = "lottblocks_elven_rope.png", id = 5, trigger = { @@ -99,8 +99,8 @@ lottachievements.register_achievement("rope_is_useful", { }) lottachievements.register_achievement("silver_stringed_music", { - title = "Silver Stringed Music", - description = "Craft a dwarvern harp", + title = S("Silver Stringed Music"), + description = S("Craft a dwarvern harp"), icon = "lottblocks_harp_strings.png", id = 6, trigger = { @@ -111,8 +111,8 @@ lottachievements.register_achievement("silver_stringed_music", { }) lottachievements.register_achievement("dungeons_deep_and_caverns_old", { - title = "Dungeons Deep and Caverns Old", - description = "Find an underground dungeon", + title = S("Dungeons Deep and Caverns Old"), + description = S("Find an underground dungeon"), icon = "default_mossycobble.png", id = 7, trigger = { @@ -123,8 +123,8 @@ lottachievements.register_achievement("dungeons_deep_and_caverns_old", { }) lottachievements.register_achievement("dwarvern_tomb", { - title = "Dwarvern Tomb", - description = "Find (and loot!) a dwarvern tomb, deep underground...", + title = S("Dwarvern Tomb"), + description = S("Find (and loot!) a dwarvern tomb, deep underground..."), icon = "lottblocks_dh_top.png", id = 8, trigger = { @@ -135,8 +135,8 @@ lottachievements.register_achievement("dwarvern_tomb", { }) lottachievements.register_achievement("express_miner", { - title = "Express Miner", - description = "Craft a mithril pickaxe", + title = S("Express Miner"), + description = S("Craft a mithril pickaxe"), icon = "lottores_mithrilpick.png", id = 9, trigger = { @@ -147,8 +147,8 @@ lottachievements.register_achievement("express_miner", { }) lottachievements.register_achievement("elf_and_dwarf_cooperation", { - title = "Elf and Dwarf Cooperation", - description = "Place at least 6 ithildin stone", + title = S("Elf and Dwarf Cooperation"), + description = S("Place at least 6 ithildin stone"), icon = "default_stone.png^ithildin_1.png", id = 10, trigger = { @@ -159,8 +159,8 @@ lottachievements.register_achievement("elf_and_dwarf_cooperation", { }) lottachievements.register_achievement("chains_of_melkor", { - title = "Chains of Melkor", - description = "Craft a tilkal ingot", + title = S("Chains of Melkor"), + description = S("Craft a tilkal ingot"), icon = "lottores_tilkal_ingot.png", id = 11, trigger = { @@ -171,8 +171,8 @@ lottachievements.register_achievement("chains_of_melkor", { }) lottachievements.register_achievement("master_craftsman", { - title = "Master Craftsman", - description = "Craft a Master Book of Crafts", + title = S("Master Craftsman"), + description = S("Craft a Master Book of Crafts"), icon = "lottinventory_master_book.png", id = 12, trigger = { @@ -185,8 +185,8 @@ lottachievements.register_achievement("master_craftsman", { -- Mithril Achievements lottachievements.register_achievement("first_truesilver", { - title = "First Truesilver", - description = "Mine 1 mithril ore", + title = S("First Truesilver"), + description = S("Mine 1 mithril ore"), icon = "default_stone.png^lottores_mithril_ore.png^lottachievements_level1.png", id = 32, trigger = { @@ -197,8 +197,8 @@ lottachievements.register_achievement("first_truesilver", { }) lottachievements.register_achievement("dwarvern_miner", { - title = "Dwarven Miner", - description = "Mine 99 mithril ore", + title = S("Dwarven Miner"), + description = S("Mine 99 mithril ore"), icon = "default_stone.png^lottores_mithril_ore.png^lottachievements_level2.png", requires = "first_truesilver", id = 33, @@ -210,8 +210,8 @@ lottachievements.register_achievement("dwarvern_miner", { }) lottachievements.register_achievement("ammassing_fortune", { - title = "Amassing Fortune", - description = "Mine 500 mithril ore", + title = S("Amassing Fortune"), + description = S("Mine 500 mithril ore"), icon = "default_stone.png^lottores_mithril_ore.png^lottachievements_level3.png", requires = "dwarvern_miner", id = 34, @@ -223,8 +223,8 @@ lottachievements.register_achievement("ammassing_fortune", { }) lottachievements.register_achievement("truly_rich", { - title = "Truly Rich", - description = "Mine 1000 mithril ore", + title = S("Truly Rich"), + description = S("Mine 1000 mithril ore"), icon = "default_stone.png^lottores_mithril_ore.png^lottachievements_level4.png", requires = "ammassing_fortune", id = 35, @@ -236,8 +236,8 @@ lottachievements.register_achievement("truly_rich", { }) lottachievements.register_achievement("lord_of_moria", { - title = "Lord of Moria", - description = "Mine 5000 mithril ore", + title = S("Lord of Moria"), + description = S("Mine 5000 mithril ore"), icon = "default_stone.png^lottores_mithril_ore.png^lottachievements_level5.png", requires = "truly_rich", id = 36, @@ -251,8 +251,8 @@ lottachievements.register_achievement("lord_of_moria", { -- Armour Achievements lottachievements.register_achievement("foot_soldier", { - title = "Foot Soldier", - description = "Equip a full set of steel armor", + title = S("Foot Soldier"), + description = S("Equip a full set of steel armor"), icon = "lottarmor_inv_chestplate_steel.png", id = 30, trigger = { @@ -262,8 +262,8 @@ lottachievements.register_achievement("foot_soldier", { }) lottachievements.register_achievement("dwarvern_lord", { - title = "Dwarven Lord", - description = "Equip a full set of mithril armor", + title = S("Dwarven Lord"), + description = S("Equip a full set of mithril armor"), icon = "lottarmor_inv_chestplate_mithril.png", id = 31, trigger = { @@ -273,8 +273,8 @@ lottachievements.register_achievement("dwarvern_lord", { }) lottachievements.register_achievement("elven_lord", { - title = "Elven Lord", - description = "Equip a full set of galvorn armor", + title = S("Elven Lord"), + description = S("Equip a full set of galvorn armor"), icon = "lottarmor_inv_chestplate_galvorn.png", id = 29, trigger = { @@ -284,8 +284,8 @@ lottachievements.register_achievement("elven_lord", { }) lottachievements.register_achievement("rohirric_king", { - title = "Rohirric King", - description = "Equip a full set of gold armor", + title = S("Rohirric King"), + description = S("Equip a full set of gold armor"), icon = "lottarmor_inv_chestplate_gold.png", id = 28, trigger = { @@ -297,8 +297,8 @@ lottachievements.register_achievement("rohirric_king", { -- Various biome awards lottachievements.register_achievement("in_the_land_of_mordor", { - title = "In the Land of Mordor...", - description = "Visit Mordor and mine some Mordor Stone as proof", + title = S("In the Land of Mordor..."), + description = S("Visit Mordor and mine some Mordor Stone as proof"), icon = "lottmapgen_mordor_stone.png", id = 13, trigger = { @@ -309,8 +309,8 @@ lottachievements.register_achievement("in_the_land_of_mordor", { }) lottachievements.register_achievement("the_frozen_wastes", { - title = "The Frozen Wastes", - description = "Visit a frozen biome, and collect some snow", + title = S("The Frozen Wastes"), + description = S("Visit a frozen biome, and collect some snow"), icon = "default_snow.png", id = 14, trigger = { @@ -321,8 +321,8 @@ lottachievements.register_achievement("the_frozen_wastes", { }) lottachievements.register_achievement("iron_galore", { - title = "Iron Galore", - description = "Visit the Iron Hills and start a mine there", + title = S("Iron Galore"), + description = S("Visit the Iron Hills and start a mine there"), icon = "default_stone.png^default_mineral_iron.png", id = 15, trigger = { @@ -333,8 +333,8 @@ lottachievements.register_achievement("iron_galore", { }) lottachievements.register_achievement("the_merry_shire", { - title = "The Merry Shire", - description = "Visit the Shire, and examine its soil", + title = S("The Merry Shire"), + description = S("Visit the Shire, and examine its soil"), icon = "lottplants_plum.png", id = 16, trigger = { @@ -345,8 +345,8 @@ lottachievements.register_achievement("the_merry_shire", { }) lottachievements.register_achievement("lorien_the_golden", { - title = "Lorien the Golden", - description = "Visit the golden forest of Lorien", + title = S("Lorien the Golden"), + description = S("Visit the golden forest of Lorien"), icon = "lottplants_mallornleaf.png", id = 17, trigger = { @@ -357,8 +357,8 @@ lottachievements.register_achievement("lorien_the_golden", { }) lottachievements.register_achievement("a_small_patch_of_lorien", { - title = "A Small Patch of Lorien", - description = "Place 7 Mallorn Saplings", + title = S("A Small Patch of Lorien"), + description = S("Place 7 Mallorn Saplings"), icon = "lottplants_mallornsapling.png", id = 19, trigger = { @@ -369,8 +369,8 @@ lottachievements.register_achievement("a_small_patch_of_lorien", { }) lottachievements.register_achievement("the_corrupted_greenwood", { - title = "The Corrupted Greenwood", - description = "Chop down a tree in Mirkwood", + title = S("The Corrupted Greenwood"), + description = S("Chop down a tree in Mirkwood"), icon = "lottplants_mirkleaf.png", id = 18, trigger = { @@ -383,8 +383,8 @@ lottachievements.register_achievement("the_corrupted_greenwood", { -- Mob Killings! lottachievements.register_achievement("his_arm_has_grown_long", { - title = "His arm has grown long indeed", - description = "Craft a mithril spear", + title = S("His arm has grown long indeed"), + description = S("Craft a mithril spear"), icon = "lottweapons_mithril_spear.png", id = 20, trigger = { @@ -395,8 +395,8 @@ lottachievements.register_achievement("his_arm_has_grown_long", { }) lottachievements.register_achievement("marksman_of_lorien", { - title = "Marksman of Lorien", - description = "Craft a mallorn bow", + title = S("Marksman of Lorien"), + description = S("Craft a mallorn bow"), icon = "lottthrowing_bow_wood_mallorn.png", id = 21, trigger = { @@ -407,8 +407,8 @@ lottachievements.register_achievement("marksman_of_lorien", { }) lottachievements.register_achievement("durins_bane", { - title = "Durin's Bane", - description = "Kill a Balrog", + title = S("Durin's Bane"), + description = S("Kill a Balrog"), icon = "fire_basic_flame.png", id = 27, trigger = { @@ -419,8 +419,8 @@ lottachievements.register_achievement("durins_bane", { }) lottachievements.register_achievement("begone_foul_dwimmerlaik", { - title = "Begone, foul dwimmerlaik", - description = "Kill the king of the Nazgul", + title = S("Begone, foul dwimmerlaik"), + description = S("Kill the king of the Nazgul"), icon = "lottachievements_witch_king.png", id = 26, trigger = { @@ -431,8 +431,8 @@ lottachievements.register_achievement("begone_foul_dwimmerlaik", { }) lottachievements.register_achievement("living_wood", { - title = "Living Wood", - description = "Kill an ent", + title = S("Living Wood"), + description = S("Kill an ent"), icon = "default_jungletree.png", id = 25, trigger = { @@ -443,8 +443,8 @@ lottachievements.register_achievement("living_wood", { }) lottachievements.register_achievement("elven_champion", { - title = "Elven Champion", - description = "Kill 25 Mordor orcs", + title = S("Elven Champion"), + description = S("Kill 25 Mordor orcs"), icon = "lottweapons_elven_sword.png", id = 22, trigger = { @@ -455,8 +455,8 @@ lottachievements.register_achievement("elven_champion", { }) lottachievements.register_achievement("orcish_warlord", { - title = "Orcish Warlord", - description = "Kill 25 elves", + title = S("Orcish Warlord"), + description = S("Kill 25 elves"), icon = "lottweapons_orc_sword.png", id = 23, trigger = { @@ -467,8 +467,8 @@ lottachievements.register_achievement("orcish_warlord", { }) lottachievements.register_achievement("spider_hunter", { - title = "Spider Hunter", - description = "Kill 25 spiders", + title = S("Spider Hunter"), + description = S("Kill 25 spiders"), icon = "lottplants_mirkleaf.png", id = 24, trigger = { @@ -481,8 +481,8 @@ lottachievements.register_achievement("spider_hunter", { -- Advanced Achievements lottachievements.register_achievement("abandoned_workshop", { - title = "Abandoned Workshop", - description = "Discover a secret Elven Workshop underground", + title = S("Abandoned Workshop"), + description = S("Discover a secret Elven Workshop underground"), icon = "default_cracked_stone_brick.png", id = 37, trigger = { @@ -493,16 +493,16 @@ lottachievements.register_achievement("abandoned_workshop", { }) lottachievements.register_achievement("ringsilver_crafter", { - title = "Ringsilver crafter", - description = "Form your first ingot of ringsilver!", + title = S("Ringsilver crafter"), + description = S("Form your first ingot of ringsilver!"), icon = "lottother_ringsilver_ingot.png", requires = "abandoned_workshop", id = 38, }) lottachievements.register_achievement("the_ring_is_prepared", { - title = "The Ring is Prepared...", - description = "Make a ring ready to have a gem fitted to it", + title = S("The Ring is Prepared..."), + description = S("Make a ring ready to have a gem fitted to it"), icon = "lottother_prepared_ring.png", requires = "ringsilver_crafter", id = 39, @@ -514,8 +514,8 @@ lottachievements.register_achievement("the_ring_is_prepared", { }) lottachievements.register_achievement("a_pickaxe_fit_for_a_king", { - title = "A pickaxe fit for a king", - description = "Craft a gem pickaxe", + title = S("A pickaxe fit for a king"), + description = S("Craft a gem pickaxe"), icon = "lottother_gempick.png", requires = "abandoned_workshop", id = 40, @@ -527,24 +527,24 @@ lottachievements.register_achievement("a_pickaxe_fit_for_a_king", { }) lottachievements.register_achievement("polisher", { - title = "Polisher", - description = "Polish a gem", + title = S("Polisher"), + description = S("Polish a gem"), icon = "lottother_redgem.png", requires = "a_pickaxe_fit_for_a_king", id = 41, }) lottachievements.register_achievement("ring_smith", { - title = "Ring Smith", - description = "Forge a ring of power", + title = S("Ring Smith"), + description = S("Forge a ring of power"), requires = "polisher", icon = "lottother_narya.png", id = 42, }) lottachievements.register_achievement("supersonic_speed", { - title = "Supersonic Speed", - description = "Craft a palantir", + title = S("Supersonic Speed"), + description = S("Craft a palantir"), icon = "default_obsidian.png", secret = true, id = 43, @@ -558,8 +558,8 @@ lottachievements.register_achievement("supersonic_speed", { --Death awards :P lottachievements.register_achievement("first_time_for_everything", { - title = "First Time for Everything", - description = "Die once!", + title = S("First Time for Everything"), + description = S("Die once!"), id = 44, icon = "lottachievements_skull.png^lottachievements_level1.png", trigger = { @@ -569,8 +569,8 @@ lottachievements.register_achievement("first_time_for_everything", { }) lottachievements.register_achievement("not_again", { - title = "Not Again!", - description = "Die a second time", + title = S("Not Again!"), + description = S("Die a second time"), icon = "lottachievements_skull.png^lottachievements_level2.png", requires = "first_time_for_everything", id = 45, @@ -581,8 +581,8 @@ lottachievements.register_achievement("not_again", { }) lottachievements.register_achievement("this_is_becoming_a_habit", { - title = "This is becoming a habit...", - description = "Die 10 times!", + title = S("This is becoming a habit..."), + description = S("Die 10 times!"), icon = "lottachievements_skull.png^lottachievements_level3.png", requires = "not_again", id = 46, @@ -593,8 +593,8 @@ lottachievements.register_achievement("this_is_becoming_a_habit", { }) lottachievements.register_achievement("im_getting_good_at_this", { - title = "I'm getting good at this!", - description = "Die 20 times, then 5 more.", + title = S("I'm getting good at this!"), + description = S("Die 20 times, then 5 more."), icon = "lottachievements_skull.png^lottachievements_level4.png", requires = "this_is_becoming_a_habit", id = 47, @@ -605,8 +605,8 @@ lottachievements.register_achievement("im_getting_good_at_this", { }) lottachievements.register_achievement("this_is_really_too_much", { - title = "This is really too much...", - description = "Die a grand total of 100 times!", + title = S("This is really too much..."), + description = S("Die a grand total of 100 times!"), icon = "lottachievements_skull.png^lottachievements_level5.png", requires = "im_getting_good_at_this", id = 48, @@ -617,7 +617,7 @@ lottachievements.register_achievement("this_is_really_too_much", { }) lottachievements.register_achievement("king_of_dying", { - title = "King of Dying", + title = S("King of Dying"), description = "Have 500 deaths to your name!", icon = "lottachievements_crowned_skull.png^lottachievements_level6.png", requires = "this_is_really_too_much", @@ -629,8 +629,8 @@ lottachievements.register_achievement("king_of_dying", { }) lottachievements.register_achievement("so_dead_im_immortal", { - title = "So dead, I'm immortal!", - description = "1000 deaths. Yes, 1000.", + title = S("So dead, I'm immortal!"), + description = S("1000 deaths. Yes, 1000."), icon = "lottachievements_skull.png^lottachievements_level7.png", requires = "king_of_dying", id = 50, diff --git a/mods/lottachievements/locale/de.txt b/mods/lottachievements/locale/de.txt new file mode 100644 index 00000000..501cdaae --- /dev/null +++ b/mods/lottachievements/locale/de.txt @@ -0,0 +1,130 @@ +### api.lua +Achievement Unlocked: = Errungenschaft freigeschaltet: +Achievement Unlocked! = Errungenschaft freigeschaltet! +Achievement Unlocked: %s = Errungenschaft freigeschaltet: %s +(completed) = (fertiggestellt) +Error: No lottachievements available. = Fehler: lottachievements nicht verfügbar. +(Hidden Achievement) = (Versteckte Errungenschaft) +(Secret Achievement) = (Geheime Errungenschaft) +Secret Achievement Unlocked: = Geheime Errungenschaft freigeschaltet: +Secret Achievement Unlocked! = Geheime Errungenschaft freigeschaltet! +Secret Achievement Unlocked: %s = Geheime Errungenschaft freigeschaltet: %s +%s: %s = %s: %s +%s’s lottachievements: = lottachievements von %s +To see this achievement, complete \" = Um diese Errungenschaft zu sehen, vervollständige \" +To see this achievement you need to complete more achievements! = Um diese Errungenschaft zu sehen, musst du mehr Errungenschaften fertigstellen! +Unlock this achievement to find out what it is. = Schalte diese Errungenschaft frei, um zu sehen, was sie ist. +You have not unlocked any lottachievements. = Du hast bisher keine lottachievements freigeschaltet. +You've disabled lottachievements. Type /lottachievements enable to reenable. = lottachievements ist deaktiviert. Gib /lottachievements ein, um es wieder zu aktivieren. + +### init.lua +Abandoned Workshop = Verlassene Arbeitsstätte +A Long Path to Mushrooms = Ein langer Weg zu Pilzen +Amassing Fortune = Glück anhäufen +A pickaxe fit for a king = Eine Spitzhacke eines Königs würdig +A Small Patch of Lorien = Ein kleines Fleckchen Loriens +Begone, foul dwimmerlaik = Weiche, garstiger Hexenkönig +Chains of Melkor = Ketten von Melkor +Dungeons Deep and Caverns Old = Tiefe Verliese und alte Höhlen +Durin's Bane = Durins Bann +Dwarven Lord = Zwergenfürst +Dwarven Miner = Zwergenbergmann +Dwarvern Tomb = Zwergengrab +Elf and Dwarf Cooperation = Kooperation von Elfen und Zwergen +Elven Champion = Elfenmeister +Elven Lord = Elfenfürst +Express Miner = Eilbergmann +First Time for Everything = Das erste Mal für alles +First Truesilver = Erstes Echtsilber +Foot Soldier = Fußsoldat +His arm has grown long indeed = Sein Arm ist in der Tat lang geworden +I'm getting good at this! = Ich werde gut darin! +In the Land of Mordor... = Im Land Mordor... +Iron Galore = Massenweise Eisen +King of Dying = König des Sterbens +Living Wood = Lebendes Holz +Lord of Moria = Fürst von Moria +Lorien the Golden = Lorien das Goldene +Marksman of Lorien = Schütze von Lorien +Master Craftsman = Handwerksmeister +Not Again! = Nicht schon wieder! +Orcish Warlord = Orkischer Kriegsherr +Polisher = Polierer +Ringsilver crafter = Ringsilber-Hersteller +Ring Smith = Ringschmied +Rohirric King = König Rohans +Rope is useful! = Seil ist nützlich! +Silver Stringed Music = Silberbesaitete Musik +Smoke Rings = Rauchringe +So dead, I'm immortal! = So tot, dass ich unsterblich bin! +Spider Hunter = Spinnenjäger +Supersonic Speed = Überschallgeschwindigkeit +Tasty Taters = Schmackhafte Kartoffeln +The Corrupted Greenwood = Der beschädigte Grünwald +The Frozen Wastes = Das gefrorene Ödland +The Merry Shire = Das heitere Auenland +The Ring is Prepared... = Der Ring ist vorbereitet... +Thief! = Dieb! +This is becoming a habit... = Das wird zur Gewohnheit... +This is really too much... = Das ist wirklich zu viel... +Truly Rich = Wahrlich reich +Achievement Book = Buch der Errungenschaften +Blow a smoke ring with a pipe = Blase einen Rauchring mit einer Pfeife +Show a hobbitish love of mushrooms by eating 99 brown mushrooms! = Zeige hobbitartige Liebe zu Pilzen, indem Du 99 braune Pilze isst! +Fill your belly with the good ballast of 9 potatoes = Fülle Deinen Bauch mit dem gesunden Ballast von 9 Kartoffeln +Use a lockpick to break into a chest of a different race = Verwenden Sie einen Dietrich, um in eine Truhe einer anderen Rasse einzubrechen +Craft 100 meters of elven rope = Fertige 100 Meter Elfenseil +Craft a dwarvern harp = Fertige eine Zwergenharfe +Find an underground dungeon = Finde ein unterirdisches Verlies +Find (and loot!) a dwarvern tomb, deep underground... = Finde (und plündere!) ein Zwergengrab, tief unter der Erde... +Craft a mithril pickaxe = Fertige eine Mithrilspitzhacke +Place at least 6 ithildin stone = Platziere mindestets 6 Ithildin-Steine +Craft a tilkal ingot = Fertige einen Tilkal-Barren +Craft a Master Book of Crafts = Fertige ein Meisterbuch des Handwerks +Mine 1 mithril ore = Baue 1 Mithrilerz ab +Mine 99 mithril ore = Baue 99 Mithrilerz ab +Mine 500 mithril ore = Baue 500 Mithrilerz ab +Mine 1000 mithril ore = Baue 1000 Mithrilerz ab +Mine 5000 mithril ore = Baue 5000 Mithrilerz ab +Equip a full set of steel armor = Trage eine vollständige Stahlpanzerung +Equip a full set of mithril armor = Trage eine vollständige Mitrilpanzerung +Equip a full set of galvorn armor = Trage eine vollständige Galvornpanzerung +Equip a full set of gold armor = Trage eine vollständige Goldpanzerung +Visit Mordor and mine some Mordor Stone as proof = Besuche Morder und baue als Beweis etwas Mordorstein ab +Visit a frozen biome, and collect some snow = Besuche ein gefrorenes Biom, und sammle etwas Schnee +Visit the Iron Hills and start a mine there = Besuche die Eisenberge und fange an, dort abzubauen +Visit the Shire, and examine its soil = Besuche das Auenland, und untersuche seinen Boden +Visit the golden forest of Lorien = Besuche den goldenen Wald von Lorien +Place 7 Mallorn Saplings = Pflanze 7 Mallornsetzlinge +Chop down a tree in Mirkwood = Fälle einen Baum im Düsterwald +Craft a mithril spear = Fertige einen Mithrilspeer +Craft a mallorn bow = Fertige einen Mallornbogen +Kill a Balrog = Töte einen Balrog +Kill the king of the Nazgul = Töte den König der Nazgul +Kill an ent = Töte einen Ent +Kill 25 Mordor orcs = Töte 25 Mordor-Orks +Kill 25 elves = Töte 25 Elfen +Kill 25 spiders = Töte 25 Spinnen +Discover a secret Elven Workshop underground = Entdecke eine geheime unterirdische Elfenwerkstatt +Form your first ingot of ringsilver! = Gieße Deinen ersten Barren Ringsilber +Make a ring ready to have a gem fitted to it = Mache einen Ring bereit, um ein Juwel einzupassen +Craft a gem pickaxe = Fertige eine Juwelenspitzhacke +Polish a gem = Poliere ein Juwel +Forge a ring of power = Schmiede einen Ring der Macht +Craft a palantir = Fertige einen Palantir +Die once! = Stirb einmal! +Die a second time = Stirb ein zweites Mal +Die 10 times! = Stirb 10 Mal! +Die 20 times, then 5 more. = Stirb 20 Mal, dann 5 weitere male. +Die a grand total of 100 times! = Stirb insgesamt 100 Mal! +1000 deaths. Yes, 1000. = 1000 Tode. Ja, 1000. + +### triggers.lua +@1/@2 dug = @1/@2 abgebaut +@1/@2 placed = @1/@2 platziert +@1/@2 eaten = @1/@2 gegessen +@1/@2 deaths = @1/@2 Tode +@1/@2 chat messages = @1/@2 Chatnachrichten +@1/@2 game joins = @1/@2 Spielbeitritte +@1/@2 crafted = @1/@2 gefertigt +@1/@2 killed = @1/@2 getötet diff --git a/mods/lottachievements/locale/template.txt b/mods/lottachievements/locale/template.txt new file mode 100644 index 00000000..85ff4f49 --- /dev/null +++ b/mods/lottachievements/locale/template.txt @@ -0,0 +1,130 @@ +### api.lua +Achievement Unlocked: = +Achievement Unlocked! = +Achievement Unlocked: %s = +(completed) = +Error: No lottachievements available. = +(Hidden Achievement) = +(Secret Achievement) = +Secret Achievement Unlocked: = +Secret Achievement Unlocked! = +Secret Achievement Unlocked: %s = +%s: %s = +%s’s lottachievements: = +To see this achievement, complete \" = +To see this achievement you need to complete more achievements! = +Unlock this achievement to find out what it is. = +You have not unlocked any lottachievements. = +You've disabled lottachievements. Type /lottachievements enable to reenable. = + +### init.lua +Abandoned Workshop = +A Long Path to Mushrooms = +Amassing Fortune = +A pickaxe fit for a king = +A Small Patch of Lorien = +Begone, foul dwimmerlaik = +Chains of Melkor = +Dungeons Deep and Caverns Old = +Durin's Bane = +Dwarven Lord = +Dwarven Miner = +Dwarvern Tomb = +Elf and Dwarf Cooperation = +Elven Champion = +Elven Lord = +Express Miner = +First Time for Everything = +First Truesilver = +Foot Soldier = +His arm has grown long indeed = +I'm getting good at this! = +In the Land of Mordor... = +Iron Galore = +King of Dying = +Living Wood = +Lord of Moria = +Lorien the Golden = +Marksman of Lorien = +Master Craftsman = +Not Again! = +Orcish Warlord = +Polisher = +Ringsilver crafter = +Ring Smith = +Rohirric King = +Rope is useful! = +Silver Stringed Music = +Smoke Rings = +So dead, I'm immortal! = +Spider Hunter = +Supersonic Speed = +Tasty Taters = +The Corrupted Greenwood = +The Frozen Wastes = +The Merry Shire = +The Ring is Prepared... = +Thief! = +This is becoming a habit... = +This is really too much... = +Truly Rich = +Achievement Book = +Blow a smoke ring with a pipe = +Show a hobbitish love of mushrooms by eating 99 brown mushrooms! = +Fill your belly with the good ballast of 9 potatoes = +Use a lockpick to break into a chest of a different race = +Craft 100 meters of elven rope = +Craft a dwarvern harp = +Find an underground dungeon = +Find (and loot!) a dwarvern tomb, deep underground... = +Craft a mithril pickaxe = +Place at least 6 ithildin stone = +Craft a tilkal ingot = +Craft a Master Book of Crafts = +Mine 1 mithril ore = +Mine 99 mithril ore = +Mine 500 mithril ore = +Mine 1000 mithril ore = +Mine 5000 mithril ore = +Equip a full set of steel armor = +Equip a full set of mithril armor = +Equip a full set of galvorn armor = +Equip a full set of gold armor = +Visit Mordor and mine some Mordor Stone as proof = +Visit a frozen biome, and collect some snow = +Visit the Iron Hills and start a mine there = +Visit the Shire, and examine its soil = +Visit the golden forest of Lorien = +Place 7 Mallorn Saplings = +Chop down a tree in Mirkwood = +Craft a mithril spear = +Craft a mallorn bow = +Kill a Balrog = +Kill the king of the Nazgul = +Kill an ent = +Kill 25 Mordor orcs = +Kill 25 elves = +Kill 25 spiders = +Discover a secret Elven Workshop underground = +Form your first ingot of ringsilver! = +Make a ring ready to have a gem fitted to it = +Craft a gem pickaxe = +Polish a gem = +Forge a ring of power = +Craft a palantir = +Die once! = +Die a second time = +Die 10 times! = +Die 20 times, then 5 more. = +Die a grand total of 100 times! = +1000 deaths. Yes, 1000. = + +### triggers.lua +@1/@2 dug = +@1/@2 placed = +@1/@2 eaten = +@1/@2 deaths = +@1/@2 chat messages = +@1/@2 game joins = +@1/@2 crafted = +@1/@2 killed = diff --git a/mods/lottarmor/init.lua b/mods/lottarmor/init.lua index 3762e89f..5bef12af 100644 --- a/mods/lottarmor/init.lua +++ b/mods/lottarmor/init.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + dofile(minetest.get_modpath(minetest.get_current_modname()).."/multiskin.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/armor.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/shield.lua") @@ -7,28 +16,28 @@ dofile(minetest.get_modpath(minetest.get_current_modname()).."/wieldview.lua") -- Wood Armor minetest.register_tool("lottarmor:helmet_wood", { - description = "Training Helmet", + description = S("Training Helmet"), inventory_image = "lottarmor_inv_helmet_wood.png", groups = {armor_head=2.5, armor_heal=0, armor_use=2000, armor_healing=0, physics_speed=0.2}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_wood", { - description = "Training Chestplate", + description = S("Training Chestplate"), inventory_image = "lottarmor_inv_chestplate_wood.png", groups = {armor_torso=5, armor_heal=0, armor_use=2000, armor_healing=0, physics_speed=0.2}, wear = 0, }) minetest.register_tool("lottarmor:leggings_wood", { - description = "Training Leggings", + description = S("Training Leggings"), inventory_image = "lottarmor_inv_leggings_wood.png", groups = {armor_legs=2.5, armor_heal=0, armor_use=2000, armor_healing=0, physics_speed=0.2}, wear = 0, }) minetest.register_tool("lottarmor:boots_wood", { - description = "Training Boots", + description = S("Training Boots"), inventory_image = "lottarmor_inv_boots_wood.png", groups = {armor_feet=2.5, armor_heal=0, armor_use=2100, armor_healing=0, physics_speed=0.2}, wear = 0, @@ -36,28 +45,28 @@ minetest.register_tool("lottarmor:boots_wood", { -- Tin Armor minetest.register_tool("lottarmor:helmet_tin", { - description = "Tin Helmet", + description = S("Tin Helmet"), inventory_image = "lottarmor_inv_helmet_tin.png", groups = {armor_head=5, armor_heal=0, armor_use=1500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_tin", { - description = "Tin Chestplate", + description = S("Tin Chestplate"), inventory_image = "lottarmor_inv_chestplate_tin.png", groups = {armor_torso=10, armor_heal=0, armor_use=1500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:leggings_tin", { - description = "Tin Leggings", + description = S("Tin Leggings"), inventory_image = "lottarmor_inv_leggings_tin.png", groups = {armor_legs=5, armor_heal=0, armor_use=1500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:boots_tin", { - description = "Tin Boots", + description = S("Tin Boots"), inventory_image = "lottarmor_inv_boots_tin.png", groups = {armor_feet=5, armor_heal=0, armor_use=2000, armor_healing=0}, wear = 0, @@ -65,28 +74,28 @@ minetest.register_tool("lottarmor:boots_tin", { --Copper Armor minetest.register_tool("lottarmor:helmet_copper", { - description = "Copper Helmet", + description = S("Copper Helmet"), inventory_image = "lottarmor_inv_helmet_copper.png", groups = {armor_head=5, armor_heal=0, armor_use=1500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_copper", { - description = "Copper Chestplate", + description = S("Copper Chestplate"), inventory_image = "lottarmor_inv_chestplate_copper.png", groups = {armor_torso=10, armor_heal=0, armor_use=1500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:leggings_copper", { - description = "Copper Leggings", + description = S("Copper Leggings"), inventory_image = "lottarmor_inv_leggings_copper.png", groups = {armor_legs=5, armor_heal=0, armor_use=1500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:boots_copper", { - description = "Copper Boots", + description = S("Copper Boots"), inventory_image = "lottarmor_inv_boots_copper.png", groups = {armor_feet=5, armor_heal=0, armor_use=2000, armor_healing=0}, wear = 0, @@ -94,28 +103,28 @@ minetest.register_tool("lottarmor:boots_copper", { --Steel Armor minetest.register_tool("lottarmor:helmet_steel", { - description = "Steel Helmet", + description = S("Steel Helmet"), inventory_image = "lottarmor_inv_helmet_steel.png", groups = {armor_head=10, armor_heal=0, armor_use=500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_steel", { - description = "Steel Chestplate", + description = S("Steel Chestplate"), inventory_image = "lottarmor_inv_chestplate_steel.png", groups = {armor_torso=15, armor_heal=0, armor_use=500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:leggings_steel", { - description = "Steel Leggings", + description = S("Steel Leggings"), inventory_image = "lottarmor_inv_leggings_steel.png", groups = {armor_legs=15, armor_heal=0, armor_use=500, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:boots_steel", { - description = "Steel Boots", + description = S("Steel Boots"), inventory_image = "lottarmor_inv_boots_steel.png", groups = {armor_feet=10, armor_heal=0, armor_use=500, armor_healing=0}, wear = 0, @@ -123,28 +132,28 @@ minetest.register_tool("lottarmor:boots_steel", { --Bronze Armor minetest.register_tool("lottarmor:helmet_bronze", { - description = "Bronze Helmet", + description = S("Bronze Helmet"), inventory_image = "lottarmor_inv_helmet_bronze.png", groups = {armor_head=10, armor_heal=6, armor_use=250, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_bronze", { - description = "Bronze Chestplate", + description = S("Bronze Chestplate"), inventory_image = "lottarmor_inv_chestplate_bronze.png", groups = {armor_torso=15, armor_heal=6, armor_use=250, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:leggings_bronze", { - description = "Bronze Leggings", + description = S("Bronze Leggings"), inventory_image = "lottarmor_inv_leggings_bronze.png", groups = {armor_legs=15, armor_heal=6, armor_use=250, armor_healing=0}, wear = 0, }) minetest.register_tool("lottarmor:boots_bronze", { - description = "Bronze Boots", + description = S("Bronze Boots"), inventory_image = "lottarmor_inv_boots_bronze.png", groups = {armor_feet=10, armor_heal=6, armor_use=250, armor_healing=0}, wear = 0, @@ -153,28 +162,28 @@ minetest.register_tool("lottarmor:boots_bronze", { --Silver Armor minetest.register_tool("lottarmor:helmet_silver", { - description = "Silver Helmet", + description = S("Silver Helmet"), inventory_image = "lottarmor_inv_helmet_silver.png", groups = {armor_head=12, armor_heal=3, armor_use=300, armor_healing=0, physics_speed=-0.05}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_silver", { - description = "Silver Chestplate", + description = S("Silver Chestplate"), inventory_image = "lottarmor_inv_chestplate_silver.png", groups = {armor_torso=17, armor_heal=3, armor_use=300, armor_healing=0, physics_speed=-0.05}, wear = 0, }) minetest.register_tool("lottarmor:leggings_silver", { - description = "Silver Leggings", + description = S("Silver Leggings"), inventory_image = "lottarmor_inv_leggings_silver.png", groups = {armor_legs=17, armor_heal=3, armor_use=300, armor_healing=0, physics_speed=-0.05}, wear = 0, }) minetest.register_tool("lottarmor:boots_silver", { - description = "Silver Boots", + description = S("Silver Boots"), inventory_image = "lottarmor_inv_boots_silver.png", groups = {armor_feet=12, armor_heal=3, armor_use=300, armor_healing=0, physics_speed=-0.05}, wear = 0, @@ -182,28 +191,28 @@ minetest.register_tool("lottarmor:boots_silver", { --Gold Armor minetest.register_tool("lottarmor:helmet_gold", { - description = "Gold Helmet", + description = S("Gold Helmet"), inventory_image = "lottarmor_inv_helmet_gold.png", groups = {armor_head=10, armor_heal=6, armor_use=250, armor_healing=0, physics_speed=-0.05}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_gold", { - description = "Gold Chestplate", + description = S("Gold Chestplate"), inventory_image = "lottarmor_inv_chestplate_gold.png", groups = {armor_torso=15, armor_heal=6, armor_use=250, armor_healing=0, physics_speed=-0.05}, wear = 0, }) minetest.register_tool("lottarmor:leggings_gold", { - description = "Gold Leggings", + description = S("Gold Leggings"), inventory_image = "lottarmor_inv_leggings_gold.png", groups = {armor_legs=15, armor_heal=6, armor_use=250, armor_healing=0, physics_speed=-0.05}, wear = 0, }) minetest.register_tool("lottarmor:boots_gold", { - description = "Gold Boots", + description = S("Gold Boots"), inventory_image = "lottarmor_inv_boots_gold.png", groups = {armor_feet=10, armor_heal=6, armor_use=250, armor_healing=0, physics_speed=-0.05}, wear = 0, @@ -211,28 +220,28 @@ minetest.register_tool("lottarmor:boots_gold", { --Galvorn Armor minetest.register_tool("lottarmor:helmet_galvorn", { - description = "Galvorn Helmet", + description = S("Galvorn Helmet"), inventory_image = "lottarmor_inv_helmet_galvorn.png", groups = {armor_head=15, armor_heal=12, armor_use=100, armor_healing=0, physics_speed=-0.1, forbidden=1}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_galvorn", { - description = "Galvorn Chestplate", + description = S("Galvorn Chestplate"), inventory_image = "lottarmor_inv_chestplate_galvorn.png", groups = {armor_torso=20, armor_heal=12, armor_use=100, armor_healing=0, physics_speed=-0.1, forbidden=1}, wear = 0, }) minetest.register_tool("lottarmor:leggings_galvorn", { - description = "Galvorn Leggings", + description = S("Galvorn Leggings"), inventory_image = "lottarmor_inv_leggings_galvorn.png", groups = {armor_legs=20, armor_heal=12, armor_use=100, armor_healing=0, physics_speed=-0.1, forbidden=1}, wear = 0, }) minetest.register_tool("lottarmor:boots_galvorn", { - description = "Galvorn Boots", + description = S("Galvorn Boots"), inventory_image = "lottarmor_inv_boots_galvorn.png", groups = {armor_feet=15, armor_heal=12, armor_use=100, armor_healing=0, physics_speed=-0.1, forbidden=1}, wear = 0, @@ -240,28 +249,28 @@ minetest.register_tool("lottarmor:boots_galvorn", { --Mithril Armor minetest.register_tool("lottarmor:helmet_mithril", { - description = "Mithril Helmet", + description = S("Mithril Helmet"), inventory_image = "lottarmor_inv_helmet_mithril.png", groups = {armor_head=15, armor_heal=12, armor_use=50, armor_healing=0, physics_speed=-0.1}, wear = 0, }) minetest.register_tool("lottarmor:chestplate_mithril", { - description = "Mithril Chestplate", + description = S("Mithril Chestplate"), inventory_image = "lottarmor_inv_chestplate_mithril.png", groups = {armor_torso=20, armor_heal=12, armor_use=50, armor_healing=0, physics_speed=-0.1}, wear = 0, }) minetest.register_tool("lottarmor:leggings_mithril", { - description = "Mithril Leggings", + description = S("Mithril Leggings"), inventory_image = "lottarmor_inv_leggings_mithril.png", groups = {armor_legs=20, armor_heal=12, armor_use=50, armor_healing=0, physics_speed=-0.1}, wear = 0, }) minetest.register_tool("lottarmor:boots_mithril", { - description = "Mithril Boots", + description = S("Mithril Boots"), inventory_image = "lottarmor_inv_boots_mithril.png", groups = {armor_feet=15, armor_heal=12, armor_use=50, armor_healing=0, physics_speed=-0.1}, wear = 0, diff --git a/mods/lottarmor/intllib.lua b/mods/lottarmor/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottarmor/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottarmor/locale/de.txt b/mods/lottarmor/locale/de.txt new file mode 100644 index 00000000..2bbd12c7 --- /dev/null +++ b/mods/lottarmor/locale/de.txt @@ -0,0 +1,37 @@ +### init.lua +Bronze Boots = Bronzestiefel +Bronze Chestplate = Bronzebrustschutz +Bronze Helmet = Bronzehelm +Bronze Leggings = Bronzegamaschen +Copper Boots = Kupferstiefel +Copper Chestplate = Kupferbrustschutz +Copper Helmet = Kupferhelm +Copper Leggings = Kupfergamaschen +Galvorn Boots = Galvornstiefel +Galvorn Chestplate = Galvornbrustschutz +Galvorn Helmet = Galvornhelm +Galvorn Leggings = Galvorngamaschen +Gold Boots = Goldstiefel +Gold Chestplate = Goldbrustschutz +Gold Helmet = Goldhelm +Gold Leggings = Goldgamaschen +Mithril Boots = Mithrilstiefel +Mithril Chestplate = Mithrilbrustschutz +Mithril Helmet = Mithrilhelm +Mithril Leggings = Mithrilgamaschen +Silver Boots = Silberstiefel +Silver Chestplate = Silberbrustschutz +Silver Helmet = Silberhelm +Silver Leggings = Silbergamaschen +Steel Boots = Stahlstiefel +Steel Chestplate = Stahlbrustschutz +Steel Helmet = Stahlhelm +Steel Leggings = Stahlgamaschen +Tin Boots = Zinnstiefel +Tin Chestplate = Zinnbrustschutz +Tin Helmet = Zinnhelm +Tin Leggings = Zinngamaschen +Training Boots = Trainingsstiefel +Training Chestplate = Trainingsbrustschutz +Training Helmet = Trainingshelm +Training Leggings = Trainingsgamaschen diff --git a/mods/lottarmor/locale/template.txt b/mods/lottarmor/locale/template.txt new file mode 100644 index 00000000..2f2caee5 --- /dev/null +++ b/mods/lottarmor/locale/template.txt @@ -0,0 +1,37 @@ +### init.lua +Bronze Boots = +Bronze Chestplate = +Bronze Helmet = +Bronze Leggings = +Copper Boots = +Copper Chestplate = +Copper Helmet = +Copper Leggings = +Galvorn Boots = +Galvorn Chestplate = +Galvorn Helmet = +Galvorn Leggings = +Gold Boots = +Gold Chestplate = +Gold Helmet = +Gold Leggings = +Mithril Boots = +Mithril Chestplate = +Mithril Helmet = +Mithril Leggings = +Silver Boots = +Silver Chestplate = +Silver Helmet = +Silver Leggings = +Steel Boots = +Steel Chestplate = +Steel Helmet = +Steel Leggings = +Tin Boots = +Tin Chestplate = +Tin Helmet = +Tin Leggings = +Training Boots = +Training Chestplate = +Training Helmet = +Training Leggings = diff --git a/mods/lottarmor/mod.conf b/mods/lottarmor/mod.conf index e3ef4ade..fcda4dd4 100644 --- a/mods/lottarmor/mod.conf +++ b/mods/lottarmor/mod.conf @@ -1,3 +1,4 @@ name = lottarmor description = LOTT Game mod: lottarmor - Adds various armours, modified from Stu's 3d_armor mod -depends = default, lottores, lottinventory \ No newline at end of file +depends = default, lottores, lottinventory +optional_depends = intllib diff --git a/mods/lottblocks/chests.lua b/mods/lottblocks/chests.lua index 4822c279..57d61695 100644 --- a/mods/lottblocks/chests.lua +++ b/mods/lottblocks/chests.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_tool("lottblocks:lockpick", { - description = "Lockpick", + description = S("Lockpick"), inventory_image = "lottblocks_steel_lockpick.png", --Made by HeroOfTheWinds --https://github.com/HeroOfTheWinds/lockpicks/blob/master/textures/steel_lockpick.png max_stack = 1, @@ -17,7 +26,7 @@ minetest.register_craft({ local function lockpick(itemstack, pos, race, player) if math.random(1, 4) ~= 3 then itemstack:add_wear(65535/20) - minetest.chat_send_player(player, "Lockpick failed") + minetest.chat_send_player(player, S("Lockpick failed")) else itemstack:add_wear(65535/18) minetest.show_formspec(player, @@ -28,7 +37,7 @@ local function lockpick(itemstack, pos, race, player) end minetest.register_node("lottblocks:hobbit_chest", { - description = "Hobbit Chest", + description = S("Hobbit Chest"), tiles = {"lottblocks_hobbit_chest_top.png", "lottblocks_hobbit_chest_top.png", "lottblocks_hobbit_chest_side.png", "lottblocks_hobbit_chest_side.png", "lottblocks_hobbit_chest_side.png", "lottblocks_hobbit_chest_front.png"}, paramtype2 = "facedir", @@ -38,7 +47,7 @@ minetest.register_node("lottblocks:hobbit_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Hobbit Chest") + meta:set_string("infotext", S("Hobbit Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -53,7 +62,7 @@ minetest.register_node("lottblocks:hobbit_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "hobbit", player) else - minetest.chat_send_player(player, "Only Hobbits can open this kind of chest!") + minetest.chat_send_player(player, S("Only Hobbits can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -63,13 +72,13 @@ minetest.register_node("lottblocks:hobbit_chest", { end, on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Hobbit Chest") + meta:set_string("infotext", S("Hobbit Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:gondor_chest", { - description = "Gondorian Chest", + description = S("Gondorian Chest"), tiles = {"lottblocks_gondor_chest_top.png", "lottblocks_gondor_chest_bottom.png", "lottblocks_gondor_chest_side.png", "lottblocks_gondor_chest_side.png", "lottblocks_gondor_chest_side.png", "lottblocks_gondor_chest_front.png"}, paramtype2 = "facedir", @@ -79,7 +88,7 @@ minetest.register_node("lottblocks:gondor_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Gondorian Chest") + meta:set_string("infotext", S("Gondorian Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -96,7 +105,7 @@ minetest.register_node("lottblocks:gondor_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "gondor", player) else - minetest.chat_send_player(player, "Only Humans can open this kind of chest!") + minetest.chat_send_player(player, S("Only Humans can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -106,13 +115,13 @@ minetest.register_node("lottblocks:gondor_chest", { end, on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Gondorian Chest") + meta:set_string("infotext", S("Gondorian Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:rohan_chest", { - description = "Rohirrim Chest", + description = S("Rohirrim Chest"), tiles = {"lottblocks_rohan_chest_top.png", "lottblocks_rohan_chest_bottom.png", "lottblocks_rohan_chest_side.png", "lottblocks_rohan_chest_side.png", "lottblocks_rohan_chest_side.png", "lottblocks_rohan_chest_front.png"}, paramtype2 = "facedir", @@ -122,7 +131,7 @@ minetest.register_node("lottblocks:rohan_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Rohirrim Chest") + meta:set_string("infotext", S("Rohirrim Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -139,7 +148,7 @@ minetest.register_node("lottblocks:rohan_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "rohan", player) else - minetest.chat_send_player(player, "Only Humans can open this kind of chest!") + minetest.chat_send_player(player, S("Only Humans can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -149,13 +158,13 @@ minetest.register_node("lottblocks:rohan_chest", { end, on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Rohirrim Chest") + meta:set_string("infotext", S("Rohirrim Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:elfloth_chest", { - description = "Elven (Lorien) Chest", + description = S("Elven (Lorien) Chest"), tiles = {"lottblocks_elf_chest_top.png", "lottblocks_elf_chest_bottom.png", "lottblocks_elf_chest_side.png", "lottblocks_elf_chest_side.png", "lottblocks_elf_chest_side.png", "lottblocks_elf_chest_front.png"}, paramtype2 = "facedir", @@ -165,7 +174,7 @@ minetest.register_node("lottblocks:elfloth_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Elven (Lorien) Chest") + meta:set_string("infotext", S("Elven (Lorien) Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -182,7 +191,7 @@ minetest.register_node("lottblocks:elfloth_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "elf", player) else - minetest.chat_send_player(player, "Only Elves can open this kind of chest!") + minetest.chat_send_player(player, S("Only Elves can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -192,13 +201,13 @@ minetest.register_node("lottblocks:elfloth_chest", { end, on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Elven (Lorien) Chest") + meta:set_string("infotext", S("Elven (Lorien) Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:elfmirk_chest", { - description = "Elven (Mirkwood) Chest", + description = S("Elven (Mirkwood) Chest"), tiles = {"lottblocks_elf_chest_top.png", "lottblocks_elf_chest_bottom.png", "lottblocks_elf_chest_side.png", "lottblocks_elf_chest_side.png", "lottblocks_elf_chest_side.png", "lottblocks_elf_chest_front.png"}, paramtype2 = "facedir", @@ -208,7 +217,7 @@ minetest.register_node("lottblocks:elfmirk_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Elven (Mirkwood) Chest") + meta:set_string("infotext", S("Elven (Mirkwood) Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -225,7 +234,7 @@ minetest.register_node("lottblocks:elfmirk_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "elf", player) else - minetest.chat_send_player(player, "Only Elves can open this kind of chest!") + minetest.chat_send_player(player, S("Only Elves can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -235,13 +244,13 @@ minetest.register_node("lottblocks:elfmirk_chest", { end, on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Elven (Mirkwood) Chest") + meta:set_string("infotext", S("Elven (Mirkwood) Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:mordor_chest", { - description = "Mordor Chest", + description = S("Mordor Chest"), tiles = {"lottblocks_mordor_chest_top.png", "lottblocks_mordor_chest_top.png", "lottblocks_mordor_chest_side.png", "lottblocks_mordor_chest_side.png", "lottblocks_mordor_chest_side.png", "lottblocks_mordor_chest_front.png"}, paramtype2 = "facedir", @@ -251,7 +260,7 @@ minetest.register_node("lottblocks:mordor_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Mordor Chest") + meta:set_string("infotext", S("Mordor Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -268,7 +277,7 @@ minetest.register_node("lottblocks:mordor_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "mordor", player) else - minetest.chat_send_player(player, "Only Orcs can open this kind of chest!") + minetest.chat_send_player(player, S("Only Orcs can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -278,13 +287,13 @@ minetest.register_node("lottblocks:mordor_chest", { end, on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Mordor Chest") + meta:set_string("infotext", S("Mordor Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:angmar_chest", { - description = "Angmar Chest", + description = S("Angmar Chest"), tiles = {"lottblocks_angmar_chest_top.png", "lottblocks_angmar_chest_top.png", "lottblocks_angmar_chest_side.png", "lottblocks_angmar_chest_side.png", "lottblocks_angmar_chest_side.png", "lottblocks_angmar_chest_front.png"}, paramtype2 = "facedir", @@ -294,7 +303,7 @@ minetest.register_node("lottblocks:angmar_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Angmar Chest") + meta:set_string("infotext", S("Angmar Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -311,7 +320,7 @@ minetest.register_node("lottblocks:angmar_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "angmar", player) else - minetest.chat_send_player(player, "Only Orcs can open this kind of chest!") + minetest.chat_send_player(player, S("Only Orcs can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -322,13 +331,13 @@ minetest.register_node("lottblocks:angmar_chest", { --backwards compatibility: punch to set formspec on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Angmar Chest") + meta:set_string("infotext", S("Angmar Chest")) meta:set_string("formspec", "") end, }) minetest.register_node("lottblocks:dwarf_chest", { - description = "Dwarf Chest", + description = S("Dwarf Chest"), tiles = {"lottblocks_dwarf_chest_top.png", "lottblocks_dwarf_chest_top.png", "lottblocks_dwarf_chest_side.png", "lottblocks_dwarf_chest_side.png", "lottblocks_dwarf_chest_side.png", "lottblocks_dwarf_chest_front.png"}, paramtype2 = "facedir", @@ -338,7 +347,7 @@ minetest.register_node("lottblocks:dwarf_chest", { sounds = default.node_sound_wood_defaults(), on_construct = function(pos, node, active_object_count, active_object_count_wider) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Dwarf Chest") + meta:set_string("infotext", S("Dwarf Chest")) local inv = meta:get_inventory() inv:set_size("main", 8*4) end, @@ -355,7 +364,7 @@ minetest.register_node("lottblocks:dwarf_chest", { elseif item == "lottblocks:lockpick" then lockpick(itemstack, pos, "dwarf", player) else - minetest.chat_send_player(player, "Only Dwarfs can open this kind of chest!") + minetest.chat_send_player(player, S("Only Dwarfs can open this kind of chest!")) end end, can_dig = function(pos,player) @@ -366,7 +375,7 @@ minetest.register_node("lottblocks:dwarf_chest", { --backwards compatibility: punch to set formspec on_punch = function(pos,player) local meta = minetest.get_meta(pos) - meta:set_string("infotext", "Dwarf Chest") + meta:set_string("infotext", S("Dwarf Chest")) meta:set_string("formspec", "") end, }) diff --git a/mods/lottblocks/decoration.lua b/mods/lottblocks/decoration.lua index 4951343b..b572b0d5 100644 --- a/mods/lottblocks/decoration.lua +++ b/mods/lottblocks/decoration.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + --Thanks for all the things in this file, and the related textures goes to catninja!-- ------------- @@ -8,7 +17,7 @@ -- Vine tree minetest.register_node("lottblocks:tree_vine", { - description = "Tree With Vines", + description = S("Tree With Vines"), tiles = {"lottblocks_tree_vine_top.png", "lottblocks_tree_vine_top.png", "lottblocks_tree_vine.png", "lottblocks_tree_vine.png", "lottblocks_tree_vine.png", "lottblocks_tree_vine.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -27,7 +36,7 @@ stairs.register_stair_and_slab("tree_vine", "lottblocks:tree_vine", -- Mossy tree minetest.register_node("lottblocks:tree_mossy", { - description = "Tree With Moss", + description = S("Tree With Moss"), tiles = {"lottblocks_tree_mossy_top.png", "lottblocks_tree_mossy_top.png", "lottblocks_tree_mossy.png", "lottblocks_tree_mossy.png", "lottblocks_tree_mossy.png", "lottblocks_tree_mossy.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -46,7 +55,7 @@ stairs.register_stair_and_slab("tree_mossy", "lottblocks:tree_mossy", -- Leafroof dark minetest.register_node("lottblocks:leafroof_dark", { - description = "Dark Leaf Roof", + description = S("Dark Leaf Roof"), tiles = {"lottblocks_leafroof.png"}, paramtype = "light", drawtype = "allfaces_optional", @@ -68,7 +77,7 @@ stairs.register_stair_and_slab("leafroof_dark", "lottblocks:leafroof_dark", -- Leafroof mallorn minetest.register_node("lottblocks:leafroof_mallorn", { - description = "Mallorn Leaf Roof", + description = S("Mallorn Leaf Roof"), tiles = {"lottblocks_mallornroof.png"}, paramtype = "light", drawtype = "allfaces_optional", @@ -88,7 +97,7 @@ stairs.register_stair_and_slab("leafroof_mallorn", "lottblocks:leafroof_mallorn" -- mallorn pillar minetest.register_node("lottblocks:mallorn_pillar", { - description = "Mallorn Pillar", + description = S("Mallorn Pillar"), tiles = {"lottblocks_mallorn_pillar.png"}, paramtype = "light", paramtype2 = "facedir", @@ -108,7 +117,7 @@ stairs.register_stair_and_slab("mallorn_pillar", "lottblocks:mallorn_pillar", -- mallorn White minetest.register_node("lottblocks:mallorn_white", { - description = "White Mallorn", + description = S("White Mallorn"), tiles = {"lottblocks_mallorn_white.png"}, paramtype = "light", paramtype2 = "facedir", @@ -129,7 +138,7 @@ stairs.register_stair_and_slab("mallorn_white", "lottblocks:mallorn_white", -- white minetest.register_node("lottblocks:dwarfstone_white", { - description = "White Dwarf Stone", + description = S("White Dwarf Stone"), tiles = {"lottblocks_dwarfstone_white_top.png", "lottblocks_dwarfstone_white_top.png", "lottblocks_dwarfstone_white_side.png", "lottblocks_dwarfstone_white_side.png", "lottblocks_dwarfstone_white_side.png", "lottblocks_dwarfstone_white_side.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -148,7 +157,7 @@ stairs.register_stair_and_slab("dwarfstone_white", "lottblocks:dwarfstone_white" -- black minetest.register_node("lottblocks:dwarfstone_black", { - description = "Black Dwarf Stone", + description = S("Black Dwarf Stone"), tiles = {"lottblocks_dwarfstone_black_top.png", "lottblocks_dwarfstone_black_top.png", "lottblocks_dwarfstone_black_side.png", "lottblocks_dwarfstone_black_side.png", "lottblocks_dwarfstone_black_side.png", "lottblocks_dwarfstone_black_side.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -167,7 +176,7 @@ stairs.register_stair_and_slab("dwarfstone_black", "lottblocks:dwarfstone_black" -- stripe minetest.register_node("lottblocks:dwarfstone_stripe", { - description = "Stripe Dwarf Stone", + description = S("Stripe Dwarf Stone"), tiles = {"lottblocks_dwarfstone_stripe_top.png", "lottblocks_dwarfstone_stripe_bottom.png", "lottblocks_dwarfstone_stripe_l.png", "lottblocks_dwarfstone_stripe_l.png", "lottblocks_dwarfstone_stripe_r.png", "lottblocks_dwarfstone_stripe_r.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -278,7 +287,7 @@ minetest.register_craft({ -- Dwarf Tombs, by Amaz. minetest.register_node("lottblocks:dwarf_tomb_top", { - description = "Dwarf Tomb", + description = S("Dwarf Tomb"), drawtype = "nodebox", tiles = { "lottblocks_dh_top.png", "default_stone.png", @@ -366,7 +375,7 @@ minetest.register_node("lottblocks:dwarf_tomb_top", { }) minetest.register_node("lottblocks:dwarf_tomb_bottom", { - description = "Dwarf Tomb Bottom", + description = S("Dwarf Tomb Bottom"), tiles = { "lottblocks_db_top.png", "default_stone.png", "lottblocks_db_side2.png", "lottblocks_db_side1.png", @@ -394,13 +403,13 @@ minetest.register_node("lottblocks:dwarf_tomb_bottom", { }) minetest.register_node("lottblocks:snowycobble", { - description = "Snowy Cobblestone", + description = S("Snowy Cobblestone"), tiles = {"lottblocks_snowycobble.png"}, is_ground_content = false, groups = {cracky=3}, }) minetest.register_node("lottblocks:orc_brick", { - description = "Orc Brick", + description = S("Orc Brick"), tiles = {"lottblocks_orc_brick.png"}, is_ground_content = false, groups = {cracky=2}, @@ -412,7 +421,7 @@ stairs.register_stair_and_slab("orc_brick", "lottblocks:orc_brick", "Orc Brick" ) minetest.register_node("lottblocks:marble_brick", { - description = "Marble Brick", + description = S("Marble Brick"), tiles = {"lottblocks_marble_brick.png"}, is_ground_content = false, groups = {cracky=2}, diff --git a/mods/lottblocks/intllib.lua b/mods/lottblocks/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottblocks/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottblocks/lamps.lua b/mods/lottblocks/lamps.lua index 01ebe117..26c7ee5c 100644 --- a/mods/lottblocks/lamps.lua +++ b/mods/lottblocks/lamps.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_alias("lottother:blue_torch", "lottblocks:elf_torch") minetest.register_alias("lottother:orc_torch", "lottblocks:orc_torch") minetest.register_alias("lottother:lamp_wood", "lottblocks:lamp_wood") @@ -197,7 +206,7 @@ lottblocks.register_lamp("lebethron_orc", "Mordor Lebethron", "lottblocks_orc_la -- Made by lumidify - lottblocks_mithril_stonelamp.png -- created by modifying darkage_lamp.png minetest.register_node("lottblocks:mithril_stonelamp", { - description = "Mithril Stonelamp", + description = S("Mithril Stonelamp"), tiles = { "lottblocks_mithril_stonelamp.png" }, paramtype = "light", sunlight_propagates = true, diff --git a/mods/lottblocks/locale/de.txt b/mods/lottblocks/locale/de.txt new file mode 100644 index 00000000..8af95592 --- /dev/null +++ b/mods/lottblocks/locale/de.txt @@ -0,0 +1,39 @@ +### chests.lua +Lockpick = Dietrich +Lockpick failed = Schloss knacken fehlgeschlagen +Hobbit Chest = Halblingstruhe +Only Hobbits can open this kind of chest! = Nur Halblinge können diese Art von Truhe öffnen! +Only Humans can open this kind of chest! = Nur Menschen können diese Art von Truhe öffnen! +Gondorian Chest = Gondor'sche Truhe +Angmar Chest = Truhe aus Angmar +Dwarf Chest = Zwergentruhe +Elven (Lorien) Chest = Elfentruhe aus Lorien +Elven (Mirkwood) Chest = Elfentruhe aus Düsterwald +Mordor Chest = Truhe aus Morder +Only Dwarfs can open this kind of chest! = Nur Zwerge können diese Art von Truhe öffnen! +Only Elves can open this kind of chest! = Nur Elfen können diese Art von Truhe öffnen! +Only Orcs can open this kind of chest! = Nur Orks können diese Art von Truhe öffnen! +Rohirrim Chest = Truhe aus Rohan + +### decoration.lua +Black Dwarf Stone = Schwarzer Zwergenstein +Dark Leaf Roof = Dunkles Blätterdach +Dwarf Tomb = Zwergengrab +Dwarf Tomb Bottom = Zwergengrabboden +Mallorn Leaf Roof = Mallornblätterdach +Mallorn Pillar = Mallornsäule +Marble Brick = Marmorstein +Orc Brick = Orkziegel +Snowy Cobblestone = Verschneiter Pflasterstein +Stripe Dwarf Stone = Gestreifter Zwergenstein +Tree With Moss = Baum mit Moos +Tree With Vines = Baum mit Ranken +White Dwarf Stone = Weißer Zwergenstein +White Mallorn = Weißes Mallorn + +### lamps.lua +Mithril Stonelamp = Mithrilsteinlampe + +### torches.lua +Elf Torch = Elfenfackel +Orc Torch = Orkfackel diff --git a/mods/lottblocks/locale/template.txt b/mods/lottblocks/locale/template.txt new file mode 100644 index 00000000..b2461cb6 --- /dev/null +++ b/mods/lottblocks/locale/template.txt @@ -0,0 +1,39 @@ +### chests.lua +Lockpick = +Lockpick failed = +Hobbit Chest = +Only Hobbits can open this kind of chest! = +Only Humans can open this kind of chest! = +Gondorian Chest = +Angmar Chest = +Dwarf Chest = +Elven (Lorien) Chest = +Elven (Mirkwood) Chest = +Mordor Chest = +Only Dwarfs can open this kind of chest! = +Only Elves can open this kind of chest! = +Only Orcs can open this kind of chest! = +Rohirrim Chest = + +### decoration.lua +Black Dwarf Stone = +Dark Leaf Roof = +Dwarf Tomb = +Dwarf Tomb Bottom = +Mallorn Leaf Roof = +Mallorn Pillar = +Marble Brick = +Orc Brick = +Snowy Cobblestone = +Stripe Dwarf Stone = +Tree With Moss = +Tree With Vines = +White Dwarf Stone = +White Mallorn = + +### lamps.lua +Mithril Stonelamp = + +### torches.lua +Elf Torch = +Orc Torch = diff --git a/mods/lottblocks/mod.conf b/mods/lottblocks/mod.conf index 1054f7ab..e344bf7e 100644 --- a/mods/lottblocks/mod.conf +++ b/mods/lottblocks/mod.conf @@ -1,3 +1,4 @@ name = lottblocks description = LOTT Game mod: lottblocks - Adds various decoration blocks and guides -depends = stairs, doors, lottplants, default, dye, lottachievements \ No newline at end of file +depends = stairs, doors, lottplants, default, dye, lottachievements +optional_depends = intllib diff --git a/mods/lottblocks/torches.lua b/mods/lottblocks/torches.lua index aab6b1b9..aa66c7c8 100644 --- a/mods/lottblocks/torches.lua +++ b/mods/lottblocks/torches.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + -- Elf torch local function on_flood_elf(pos, oldnode, newnode) minetest.add_item(pos, ItemStack("lottblocks:elf_torch 1")) @@ -5,7 +14,7 @@ local function on_flood_elf(pos, oldnode, newnode) end minetest.register_node("lottblocks:elf_torch", { - description = "Elf Torch", + description = S("Elf Torch"), drawtype = "mesh", mesh = "default_torch_floor.obj", inventory_image = "lottblocks_elf_torch_on_floor.png", @@ -109,7 +118,7 @@ local function on_flood_orc(pos, oldnode, newnode) end minetest.register_node("lottblocks:orc_torch", { - description = "Orc Torch", + description = S("Orc Torch"), drawtype = "mesh", mesh = "default_torch_floor.obj", inventory_image = "lottblocks_orc_torch_on_floor.png", diff --git a/mods/lottclasses/immunity.lua b/mods/lottclasses/immunity.lua index 980c0055..2c999b7b 100644 --- a/mods/lottclasses/immunity.lua +++ b/mods/lottclasses/immunity.lua @@ -18,7 +18,7 @@ minetest.register_on_newplayer(function(player) minetest.after(5, function() if player == nil then return end - minetest.chat_send_player(name, minetest.colorize("green", "Starter mob immunity granted for "..immune_amt/ 60 .." minutes! Travel to a safe area!")) + minetest.chat_send_player(name, minetest.colorize("green", string.format(S("Starter mob immunity granted for %s minutes!"), (immune_amt/60)) .. " " .. S("Travel to a safe area!"))) end) for i = 1, immune_amt do minetest.after(i, function() @@ -30,7 +30,7 @@ minetest.register_on_newplayer(function(player) end minetest.after(immune_amt+1, function() meta:set_string("lott:immunity", "") - minetest.chat_send_player(name, minetest.colorize("orange", "Your starter mob immunity has expired!")) + minetest.chat_send_player(name, minetest.colorize("orange", S("Your starter mob immunity has expired!"))) armor:set_player_armor(player) end) end @@ -50,8 +50,8 @@ minetest.register_on_joinplayer(function(player) if tonumber(immunity) >= immune_amt then return end - minetest.chat_send_player(name, minetest.colorize("green", "Your starter mob immunity has resumed!")) - minetest.chat_send_player(name, minetest.colorize("green", "You still have "..tonumber(immunity) / 60 .." minutes left!")) + minetest.chat_send_player(name, minetest.colorize("green", S("Your starter mob immunity has resumed!"))) + minetest.chat_send_player(name, minetest.colorize("green", string.format(S("You still have %s minutes left!"), (tonumber(immunity) / 60)))) for i = 1, tonumber(immunity) do if not tonumber(immunity) then @@ -70,7 +70,7 @@ minetest.register_on_joinplayer(function(player) meta:set_string("lott:immunity", "") armor:set_player_armor(player) - minetest.chat_send_player(name, minetest.colorize("orange", "Your starter mob immunity has expired!")) + minetest.chat_send_player(name, minetest.colorize("orange", S("Your starter mob immunity has expired!"))) end) end -end) \ No newline at end of file +end) diff --git a/mods/lottclasses/init.lua b/mods/lottclasses/init.lua index 7c0fd05f..25a63b0e 100644 --- a/mods/lottclasses/init.lua +++ b/mods/lottclasses/init.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + lottclasses = {} lottclasses.race = {} lottclasses.race["wizard"] = {"GAMEwizard", "wizards", "Wizard"} @@ -10,7 +19,7 @@ lottclasses.race["orc"] = {"GAMEorc", "orcs", "Orc"} -- create race privileges for races, rdata in pairs(lottclasses.race) do minetest.register_privilege(rdata[1], { - description = races.."-race player", + description = S("@1-race player", S(races), S(rdata[2])), give_to_singleplayer = false, give_to_admin = false, }) @@ -18,12 +27,12 @@ end -- gender privileges minetest.register_privilege("GAMEmale", { - description = "A male player", + description = S("A male player"), give_to_singleplayer = false, give_to_admin = false, }) minetest.register_privilege("GAMEfemale", { - description = "A female player", + description = S("A female player"), give_to_singleplayer = false, give_to_admin = false, }) @@ -34,23 +43,23 @@ dofile(minetest.get_modpath("lottclasses").."/immunity.lua") local race_chooser = "size[8,6]".. "background[8,6;1,1;gui_formbg.png;true]".. - "label[0,0;" .. minetest.colorize("#A52A2A", "Please select the race you wish to be") .. "]".. + "label[0,0;" .. minetest.colorize("#A52A2A", S("Please select the race you wish to be")) .. "]".. "image[0.25,1.4;0.75,0.75;dwarf.png]".. - "button_exit[1,1.5;2,0.5;dwarf;Dwarf]".. + "button_exit[1,1.5;2,0.5;dwarf;" .. S("Dwarf") .. "]".. "image[4.75,1.4;0.75,0.75;elf.png]".. - "button_exit[5.5,1.5;2,0.5;elf;Elf]".. + "button_exit[5.5,1.5;2,0.5;elf;" .. S("Elf") .. "]".. "image[0.25,2.4;0.75,0.75;man.png]".. - "button_exit[1,2.5;2,0.5;man;Man]".. + "button_exit[1,2.5;2,0.5;man;" .. S("Man") .. "]".. "image[4.75,2.4;0.75,0.75;orc.png]".. - "button_exit[5.5,2.5;2,0.5;orc;Orc]".. + "button_exit[5.5,2.5;2,0.5;orc;" .. S("Orc") .. "]".. "image[0.25,3.4;0.75,0.75;hobbit.png]".. - "button_exit[1,3.5;2,0.5;hobbit;Hobbit]".. - "dropdown[5.5,3.4;2;gender;Male,Female;1]" + "button_exit[1,3.5;2,0.5;hobbit;" .. S("Hobbit") .. "]".. + "dropdown[5.5,3.4;2;gender;" .. S("Male") .. "," .. S("Female") .. ";1]" -local fly_stuff = "button[1,4.75;2,0.5;fast;Fast]" .. - "button[3,4.75;2,0.5;fly;Fly]" .. - "button[5,4.75;2,0.5;noclip;Noclip]" .. - "button[2.5,5.5;3,0.5;fast_fly_noclip;Fast, Fly & Noclip]" +local fly_stuff = "button[1,4.75;2,0.5;fast;" .. S("Fast") .. "]" .. + "button[3,4.75;2,0.5;fly;" .. S("Fly") .. "]" .. + "button[5,4.75;2,0.5;noclip;" .. S("Noclip") .. "]" .. + "button[2.5,5.5;3,0.5;fast_fly_noclip;" .. S("Fast") .. ", " .. S("Fly") .. " & Noclip]" local function add_item(player, item) local inv = player:get_inventory() @@ -159,14 +168,14 @@ local function set_race(name, race) local privs = minetest.get_player_privs(name) privs["GAME"..race] = true minetest.set_player_privs(name, privs) - minetest.chat_send_player(name, "You are now a member of the race of "..lottclasses.race[race][2]..", go forth into the world.") + minetest.chat_send_player(name, string.format(S("You are now a member of the race of %s, go forth into the world."), S(lottclasses.race[race][2]))) end minetest.register_on_player_receive_fields(function(player, formname, fields) if formname ~= "race_selector" then return end local name = player:get_player_name() local privs = minetest.get_player_privs(name) - if fields.gender == "Male" then + if fields.gender == S("Male") then for races in pairs(lottclasses.race) do if fields[races] then set_gender(player, "male") @@ -177,7 +186,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) return end end - elseif fields.gender == "Female" then + elseif fields.gender == S("Female") then for races in pairs(lottclasses.race) do if fields[races] then set_gender(player, "female") @@ -208,7 +217,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end if fields.quit then if not privs.GAMEfemale and not privs.GAMEmale then - minetest.chat_send_player(name, minetest.colorize("red", "Please select a race!")) + minetest.chat_send_player(name, minetest.colorize("red", S("Please select a race!"))) minetest.after(0.1, function() if minetest.is_singleplayer() then minetest.show_formspec(name, "race_selector", race_chooser .. fly_stuff) @@ -222,7 +231,7 @@ end) minetest.register_chatcommand("race", { params = " ", - description = "Find/change a player's race", + description = S("Find/change a player's race"), func = function(name, param) local playername, changerace = string.match(param, "([^ ]+) (.+)") if not playername then @@ -235,13 +244,13 @@ minetest.register_chatcommand("race", { local privs = minetest.get_player_privs(playername) if minetest.player_exists(playername) == false then - return true, playername.." does not exists!" + return true, string.format(S("%s does not exist!"), playername) end if not changerace then for races, rdata in pairs(lottclasses.race) do if privs[rdata[1]] then - return true, "Race of "..playername..": "..rdata[3] + return true, string.format(S("Race of %s"), playername) .. ": " .. S(rdata[3]) end end if name == playername then @@ -251,11 +260,11 @@ minetest.register_chatcommand("race", { minetest.show_formspec(name, "race_selector", race_chooser) end else - return true, playername.." has not chosen a race!" + return true, string.format(S("%s has not chosen a race!"), player) end elseif changerace then if not minetest.get_player_privs(name).privs then - return true, "You have insufficient privilege to change player races!" + return true, S("You have insufficient privilege to change player races!") end if lottclasses.race[changerace] then @@ -268,13 +277,13 @@ minetest.register_chatcommand("race", { set_race(playername, changerace) update_skin(player) minetest.log("action", name.." changed "..playername.."'s race to "..changerace) - return true, "Race of "..playername.." has been changed to "..changerace + return true, S("Race of @1 has been changed to @2", playername, S(changerace)) else - return true, playername.." has not chosen a race!" + return true, S("@1 has not chosen a race!", playername) end else - return true, changerace.." is not valid race. Select between: wizard dwarf elf man orc hobbit" + return true, S("@1 is not valid race. Select between: wizard dwarf elf man orc hobbit", changerace) end end end -}) \ No newline at end of file +}) diff --git a/mods/lottclasses/intllib.lua b/mods/lottclasses/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottclasses/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottclasses/locale/de.txt b/mods/lottclasses/locale/de.txt new file mode 100644 index 00000000..22ea65bc --- /dev/null +++ b/mods/lottclasses/locale/de.txt @@ -0,0 +1,42 @@ +### init.lua +@1-race player = Spieler aus der Welt der @2 +A male player = Ein männlicher Spieler +A female player = Eine weibliche Spielerin +Please select the race you wish to be = Bitte wähle die Rasse, die Du sein möchtest +Dwarf = Zwerg +Elf = Elf +Man = Mensch +Orc = Ork +Hobbit = Halbling +dwarf = Zwerg +elf = Elf +man = Mensch +orc = Ork +hobbit = Halbling +Male = Männlich +Female = Weiblich +Fast = Schnell +Fly = Flug +Noclip = Geistmodus +You are now a member of the race of %s, go forth into the world. = Du gehörst nun zur Rasse der %s, geh voran in der Welt. +Race of %s = Rasse von %s +Wizard = Magier +%s has not chosen a race! = %s hat keine Rasse gewählt! +%s does not exist! = %s existiert nicht! +Find/change a player's race = Rasse eines Spielers anzeigen/ändern +You have insufficient privilege to change player races! = Unzureichende Berechtigungen, um Spieler-Rassen zu ändern! +orcs = Orks +dwarves = Zwerge +elves = Elfen +men = Menschen +hobbits = Halblinge +Please select a race! = Bitte wähle eine Rasse! +Race of @1 has been changed to @2 = Rasse von @1 wurde zu @2 geändert +@1 is not valid race. Select between: wizard dwarf elf man orc hobbit = @1 ist keine zulässige Rasse. Wähle zwischen: wizard dwarf elf man orc hobbit + +### immunity.lua +Starter mob immunity granted for %s minutes! = Anfänger-Mob-Immunität für %s Minuten gewährt! +Travel to a safe area! = Reise in ein sicheres Gebiet! +Your starter mob immunity has expired! = Deine Anfänger-Mob-Immunität ist abgelaufen! +Your starter mob immunity has resumed! = Deine Anfänger-Mob-Immunität wird fortgesetzt! +You still have %s minutes left! = Dir bleiben immer noch %s Minuten! diff --git a/mods/lottclasses/locale/template.txt b/mods/lottclasses/locale/template.txt new file mode 100644 index 00000000..1a54da7c --- /dev/null +++ b/mods/lottclasses/locale/template.txt @@ -0,0 +1,42 @@ +### init.lua +@1-race player = +A male player = +A female player = +Please select the race you wish to be = +Dwarf = +Elf = +Man = +Orc = +Hobbit = +dwarf = +elf = +man = +orc = +hobbit = +Male = +Female = +Fast = +Fly = +Noclip = +You are now a member of the race of %s, go forth into the world. = +Race of %s = +Wizard = +%s has not chosen a race! = +%s does not exist! = +Find/change a player's race = +You have insufficient privilege to change player races! = +orcs = +dwarves = +elves = +men = +hobbits = +Please select a race! = +Race of @1 has been changed to @2 = +@1 is not valid race. Select between: wizard dwarf elf man orc hobbit = + +### immunity.lua +Starter mob immunity granted for %s minutes! = +Travel to a safe area! = +Your starter mob immunity has expired! = +Your starter mob immunity has resumed! = +You still have %s minutes left! = diff --git a/mods/lottclasses/mod.conf b/mods/lottclasses/mod.conf index d2820648..d2343fcc 100644 --- a/mods/lottclasses/mod.conf +++ b/mods/lottclasses/mod.conf @@ -1,3 +1,4 @@ name = lottclasses description = LOTT Game mod: lottclasses - Add player "classes"/"races" -depends = default, lottarmor \ No newline at end of file +depends = default, lottarmor +optional_depends = intllib diff --git a/mods/lottfarming/intllib.lua b/mods/lottfarming/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottfarming/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottfarming/locale/de.txt b/mods/lottfarming/locale/de.txt new file mode 100644 index 00000000..00bd7b9b --- /dev/null +++ b/mods/lottfarming/locale/de.txt @@ -0,0 +1,21 @@ +### orc_food.lua +Orc Food = Orkmahlzeit +Orc medicine = Orkarznei + +### pipeweed.lua +Cooked Pipeweed = gekochtes Pfeifenkraut +Pipe = Pfeife +Pipeweed = Pfeifenkraut +Pipeweed Seeds = Pfeifenkrautsamen + +### tomatoes.lua +Cooked Tomato = gekochte Tomate +Tomato = Tomate +Tomato Seeds = Tomatensamen +Tomato Soup = Tomatensuppe + +### potato.lua +Cooked Potato = gekochte Kartoffel +Potato = Kartoffel +Potato Seeds = Kartoffelsamen + diff --git a/mods/lottfarming/locale/template.txt b/mods/lottfarming/locale/template.txt new file mode 100644 index 00000000..a4a03f46 --- /dev/null +++ b/mods/lottfarming/locale/template.txt @@ -0,0 +1,21 @@ +### orc_food.lua +Orc Food = +Orc medicine = + +### pipeweed.lua +Cooked Pipeweed = +Pipe = +Pipeweed = +Pipeweed Seeds = + +### tomatoes.lua +Cooked Tomato = +Tomato = +Tomato Seeds = +Tomato Soup = + +### potato.lua +Cooked Potato = +Potato = +Potato Seeds = + diff --git a/mods/lottfarming/mod.conf b/mods/lottfarming/mod.conf index 9fda39ad..4d18bcce 100644 --- a/mods/lottfarming/mod.conf +++ b/mods/lottfarming/mod.conf @@ -1,3 +1,4 @@ name = lottfarming description = LOTT Game mod: lottfarming - Adds various crops and farming-related items -depends = default, farming \ No newline at end of file +depends = default, farming +optional_depends = intllib diff --git a/mods/lottfarming/orc_food.lua b/mods/lottfarming/orc_food.lua index ffe82b4c..7bf7bc09 100644 --- a/mods/lottfarming/orc_food.lua +++ b/mods/lottfarming/orc_food.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_craftitem("lottfarming:orc_food", { - description = "Orc Food", + description = S("Orc Food"), inventory_image = "lottfarming_orc_food.png", on_use = function(itemstack, user, pointed_thing) if minetest.settings:get_bool("creative_mode") ~= true then @@ -42,7 +51,7 @@ minetest.register_craft({ }) minetest.register_craftitem("lottfarming:orc_medicine", { - description = "Orc medicine", + description = S("Orc medicine"), inventory_image = "lottfarming_orc_medicine.png", on_use = function(itemstack, user, pointed_thing) if minetest.settings:get_bool("creative_mode") ~= true then diff --git a/mods/lottfarming/pipeweed.lua b/mods/lottfarming/pipeweed.lua index 0d5d42a5..fb74d2d8 100644 --- a/mods/lottfarming/pipeweed.lua +++ b/mods/lottfarming/pipeweed.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_craftitem("lottfarming:pipeweed_seed", { - description = "Pipeweed Seeds", + description = S("Pipeweed Seeds"), inventory_image = "lottfarming_pipeweed_seed.png", on_place = function(itemstack, placer, pointed_thing) return place_seed(itemstack, placer, pointed_thing, "lottfarming:pipeweed_1", 34) @@ -83,7 +92,7 @@ minetest.register_node("lottfarming:pipeweed_4", { }) minetest.register_craftitem("lottfarming:pipeweed", { - description = "Pipeweed", + description = S("Pipeweed"), inventory_image = "lottfarming_pipeweed.png", }) @@ -97,7 +106,7 @@ minetest.register_craft({ }) minetest.register_craftitem("lottfarming:pipeweed_cooked", { - description = "Cooked Pipeweed", + description = S("Cooked Pipeweed"), inventory_image = "lottfarming_pipeweed_cooked.png", }) @@ -115,7 +124,7 @@ pipeweed = { } minetest.register_tool("lottfarming:pipe", { - description = "Pipe", + description = S("Pipe"), inventory_image = "lottfarming_pipe.png", on_use = function(itemstack, player) for _,arrow in ipairs(pipeweed) do diff --git a/mods/lottfarming/potato.lua b/mods/lottfarming/potato.lua index 3cbecf17..15edc741 100644 --- a/mods/lottfarming/potato.lua +++ b/mods/lottfarming/potato.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_craftitem("lottfarming:potato_seed", { - description = "Potato Seeds", + description = S("Potato Seeds"), inventory_image = "lottfarming_potato_seed.png", on_place = function(itemstack, placer, pointed_thing) return place_seed(itemstack, placer, pointed_thing, "lottfarming:potato_1", 40) @@ -65,7 +74,7 @@ minetest.register_node("lottfarming:potato_3", { }) minetest.register_craftitem("lottfarming:potato", { - description = "Potato", + description = S("Potato"), inventory_image = "lottfarming_potato.png", on_use = minetest.item_eat(1), }) @@ -80,7 +89,7 @@ minetest.register_craft({ }) minetest.register_craftitem("lottfarming:potato_cooked", { - description = "Cooked Potato", + description = S("Cooked Potato"), inventory_image = "lottfarming_potato_cooked.png", on_use = minetest.item_eat(5), }) diff --git a/mods/lottfarming/tomatoes.lua b/mods/lottfarming/tomatoes.lua index cbe71f13..6274c0bd 100644 --- a/mods/lottfarming/tomatoes.lua +++ b/mods/lottfarming/tomatoes.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_craftitem("lottfarming:tomatoes_seed", { - description = "Tomato Seeds", + description = S("Tomato Seeds"), inventory_image = "lottfarming_tomatoes_seed.png", on_place = function(itemstack, placer, pointed_thing) return place_seed(itemstack, placer, pointed_thing, "lottfarming:tomatoes_1", 10) @@ -83,7 +92,7 @@ minetest.register_node("lottfarming:tomatoes_4", { }) minetest.register_craftitem("lottfarming:tomatoes", { - description = "Tomato", + description = S("Tomato"), inventory_image = "lottfarming_tomatoes.png", on_use = minetest.item_eat(2), groups = {salad=1}, @@ -99,13 +108,13 @@ minetest.register_craft({ }) minetest.register_craftitem("lottfarming:tomatoes_cooked", { - description = "Cooked Tomato", + description = S("Cooked Tomato"), inventory_image = "lottfarming_tomatoes_cooked.png", on_use = minetest.item_eat(2), }) minetest.register_craftitem("lottfarming:tomato_soup", { - description = "Tomato Soup", + description = S("Tomato Soup"), inventory_image = "lottfarming_tomato_soup.png", on_use = minetest.item_eat(10), }) diff --git a/mods/lottinventory/brewing.lua b/mods/lottinventory/brewing.lua index c800a0fa..89b63a74 100644 --- a/mods/lottinventory/brewing.lua +++ b/mods/lottinventory/brewing.lua @@ -1,25 +1,34 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + function lottinventory.get_brewing_formspec(player, page) if page=="brews" then return "size[8,5.5]" .."background[5,5;1,1;craft_formbg.png;true]" - .."label[0,0;Book of Brewing]" - .."button_exit[6,0;2,0.5;quit;Exit]" + .."label[0,0;" .. S("Book of Brewing") .. "]" + .."button_exit[6,0;2,0.5;quit;" .. S("Exit") .. "]" .."image_button[7,1;1,1;zcg_next.png;brews2;;false;false;zcg_next_press.png]" .."image[6,1;1,1;zcg_previous_inactive.png]" --First - .."label[1,2.2; Wine]" + .."label[1,2.2; " .. S("Wine") .. "]" .."item_image_button[4,2;1,1;lottpotion:drinking_glass_water;zcg:vessels:glass_water;]" .."item_image_button[5,2;1,1;lottfarming:berries;zcg:berries;5]" .."image[6,1;1,1;zcg_craft_arrow.png]" .."item_image_button[7,2;1,1;lottpotion:wine;zcg:wine;]" --Second - .."label[1,3.2; Beer]" + .."label[1,3.2; " .. S("Beer") .. "]" .."item_image_button[4,3;1,1;lottpotion:drinking_glass_water;zcg:drinking_glass_water;]" .."item_image_button[5,3;1,1;farming:wheat;zcg:wheat;3]" .."image[6,3;1,1;zcg_craft_arrow.png]" .."item_image_button[7,3;1,1;lottpotion:beer;zcg:beer;]" --Third - .."label[1,4.2; Mead]" + .."label[1,4.2; " .. S("Mead") .. "]" .."item_image_button[4,4;1,1;lottpotion:drinking_glass_water;zcg:drinking_glass_water;]" .."item_image_button[5,4;1,1;lottplants:honey;zcg:honey;6]" .."image[6,4;1,1;zcg_craft_arrow.png]" @@ -28,18 +37,18 @@ function lottinventory.get_brewing_formspec(player, page) if page=="brews2" then return "size[8,5.5]" .."background[5,5;1,1;craft_formbg.png;true]" - .."label[0,0;Book of Brewing]" - .."button_exit[6,0;2,0.5;quit;Exit]" + .."label[0,0;" .. S("Book of Brewing") .. "]" + .."button_exit[6,0;2,0.5;quit;" .. S("Exit") .. "]" .."image[7,1;1,1;zcg_next_inactive.png]" .."image_button[6,1;1,1;zcg_previous.png;brews;;false;false;zcg_previous_press.png]" --First - .."label[1,2.2; Cider]" + .."label[1,2.2; " .. S("Cider") .. "]" .."item_image_button[4,2;1,1;lottpotion:drinking_glass_water;zcg:drinking_glass_water;]" .."item_image_button[5,2;1,1;default:apple;zcg:apple; 5]" .."image[6,2;1,1;zcg_craft_arrow.png]" .."item_image_button[7,2;1,1;lottpotion:cider;zcg:cider;]" --Second - .."label[1,3.2; Ale]" + .."label[1,3.2; " .. S("Ale") .. "]" .."item_image_button[4,3;1,1;lottpotion:drinking_glass_water;zcg:drinking_glass_water;]" .."item_image_button[5,3;1,1;lottfarming:barley;zcg:barley;6]" .."image[6,3;1,1;zcg_craft_arrow.png]" @@ -66,7 +75,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end) minetest.register_tool("lottinventory:brewing_book",{ - description = "Book of Brewing", + description = S("Book of Brewing"), inventory_image = "lottinventory_brewing_book.png", wield_image = "", wield_scale = {x=1,y=1,z=1}, diff --git a/mods/lottinventory/guides.lua b/mods/lottinventory/guides.lua index 5a2563c0..5a171893 100644 --- a/mods/lottinventory/guides.lua +++ b/mods/lottinventory/guides.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + -- This file contains the more basic guides, the normal craft guide, the cooking -- guide, the armor/protection guide, the forbidden item guide and the master guide. -- These all use the same system, as outlined in functions.lua. The brewing and @@ -34,7 +43,7 @@ for name, table in pairs(guides) do end minetest.register_tool("lottinventory:" .. name .. "_book",{ - description = name:gsub("^%l", string.upper) .. " Book", + description = S(name:gsub("^%l", string.upper) .. " Book"), groups = groups, inventory_image = "lottinventory_" .. name .. "_book.png", wield_image = "", diff --git a/mods/lottinventory/init.lua b/mods/lottinventory/init.lua index ce8c4685..b78c3cc1 100644 --- a/mods/lottinventory/init.lua +++ b/mods/lottinventory/init.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + dofile(minetest.get_modpath("lottinventory") .. "/functions.lua") dofile(minetest.get_modpath("lottinventory") .. "/potions.lua") dofile(minetest.get_modpath("lottinventory") .. "/brewing.lua") @@ -22,17 +31,17 @@ end) --Bags minetest.register_tool("lottinventory:small", { - description = "Small Bag", + description = S("Small Bag"), inventory_image = "bags_small.png", groups = {bagslots=8}, }) minetest.register_tool("lottinventory:medium", { - description = "Medium Bag", + description = S("Medium Bag"), inventory_image = "bags_medium.png", groups = {bagslots=16}, }) minetest.register_tool("lottinventory:large", { - description = "Large Bag", + description = S("Large Bag"), inventory_image = "bags_large.png", groups = {bagslots=24, forbidden=1}, }) diff --git a/mods/lottinventory/intllib.lua b/mods/lottinventory/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottinventory/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottinventory/locale/de.txt b/mods/lottinventory/locale/de.txt new file mode 100644 index 00000000..958c276a --- /dev/null +++ b/mods/lottinventory/locale/de.txt @@ -0,0 +1,21 @@ +### guides.lua +Craft Book = Handwerksbuch +Cooking Book = Kochbuch +Protection Book = Rüstungsbuch +Forbidden Book = verbotenes Buch +Master Book = Meisterbuch + +### brewing.lua +Ale = Ale +Beer = Bier +Book of Brewing = Buch des Brauens +Cider = Apfelwein +Exit = Verlassen +Mead = Met +Wine = Wein + +### init.lua +Large Bag = große Tasche +Medium Bag = mittlere Tasche +Small Bag = kleine Tasche + diff --git a/mods/lottinventory/locale/template.txt b/mods/lottinventory/locale/template.txt new file mode 100644 index 00000000..396d5163 --- /dev/null +++ b/mods/lottinventory/locale/template.txt @@ -0,0 +1,21 @@ +### guides.lua +Craft Book = +Cooking Book = +Protection Book = +Forbidden Book = +Master Book = + +### brewing.lua +Ale = +Beer = +Book of Brewing = +Cider = +Exit = +Mead = +Wine = + +### init.lua +Large Bag = +Medium Bag = +Small Bag = + diff --git a/mods/lottinventory/mod.conf b/mods/lottinventory/mod.conf index 91fbb2bd..4804bd03 100644 --- a/mods/lottinventory/mod.conf +++ b/mods/lottinventory/mod.conf @@ -1,3 +1,4 @@ name = lottinventory description = LOTT Game mod: lottinventory - Adds inventory-based modifications -depends = default \ No newline at end of file +depends = default +optional_depends = intllib diff --git a/mods/lottmapgen/intllib.lua b/mods/lottmapgen/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottmapgen/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottmapgen/locale/de.txt b/mods/lottmapgen/locale/de.txt new file mode 100644 index 00000000..ac76080e --- /dev/null +++ b/mods/lottmapgen/locale/de.txt @@ -0,0 +1,16 @@ +### nodes.lua +Fog = Nebel +Snow Block = Schneeblock +Frozen Stone = gefrorener Stein +Mordor Stone = Mordorstein +Ice = Eis +Black Water Source = Schwarzwasserquelle +Black River Source = Schwarzflussquelle +Dunland Grass = Dunlandgras +Iron Hills Grass = Eisenhügelgras +Gondor Grass = Gondorgras +Lorien Grass = Loriengras +? Grass = ?-Gras +Mirkwood Grass = Düsterwaldgras +Shire Grass = Auenlandgras +Ithilien Grass = Ithiliengras diff --git a/mods/lottmapgen/locale/template.txt b/mods/lottmapgen/locale/template.txt new file mode 100644 index 00000000..d00d88bd --- /dev/null +++ b/mods/lottmapgen/locale/template.txt @@ -0,0 +1,16 @@ +### nodes.lua +Fog = +Snow Block = +Frozen Stone = +Mordor Stone = +Ice = +Black Water Source = +Black River Source = +Dunland Grass = +Iron Hills Grass = +Gondor Grass = +Lorien Grass = +? Grass = +Mirkwood Grass = +Shire Grass = +Ithilien Grass = diff --git a/mods/lottmapgen/mod.conf b/mods/lottmapgen/mod.conf index 9a7f2b75..af76a385 100644 --- a/mods/lottmapgen/mod.conf +++ b/mods/lottmapgen/mod.conf @@ -1,4 +1,4 @@ name = lottmapgen description = LOTT Game mod: lottmapgen - Adds a map generation based off Middle Earth depends = default, lottplants, lottfarming, lottores, lottother, bucket -optional_depends = areas \ No newline at end of file +optional_depends = areas, intllib diff --git a/mods/lottmapgen/nodes.lua b/mods/lottmapgen/nodes.lua index 0cb2062a..0a5cb0b0 100644 --- a/mods/lottmapgen/nodes.lua +++ b/mods/lottmapgen/nodes.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_node("lottmapgen:fog", { - description = "Fog", + description = S("Fog"), drawtype = "glasslike", tiles = {"lottmapgen_fog.png"}, paramtype = "light", @@ -15,7 +24,7 @@ minetest.register_node("lottmapgen:fog", { }) minetest.register_node("lottmapgen:angsnowblock", { - description = "Snow Block", + description = S("Snow Block"), tiles = {"default_snow.png"}, is_ground_content = true, drop = 'default:snowblock', @@ -28,7 +37,7 @@ minetest.register_node("lottmapgen:angsnowblock", { }) minetest.register_node("lottmapgen:frozen_stone", { - description = "Frozen Stone", + description = S("Frozen Stone"), tiles = {"default_stone.png^lottmapgen_frozen.png"}, is_ground_content = true, groups = {cracky=3, stone=1}, @@ -37,7 +46,7 @@ minetest.register_node("lottmapgen:frozen_stone", { }) minetest.register_node("lottmapgen:mordor_stone", { - description = "Mordor Stone", + description = S("Mordor Stone"), tiles = {"lottmapgen_mordor_stone.png"}, is_ground_content = true, groups = {cracky=3, stone=1}, @@ -45,7 +54,7 @@ minetest.register_node("lottmapgen:mordor_stone", { }) minetest.register_node(":default:ice", { - description = "Ice", + description = S("Ice"), drawtype = "glasslike", tiles = {"lottmapgen_ice.png"}, is_ground_content = true, @@ -57,7 +66,7 @@ minetest.register_node(":default:ice", { }) minetest.register_node("lottmapgen:blacksource", { - description = "Black Water Source", + description = S("Black Water Source"), drawtype = "liquid", tiles = {"lottmapgen_black_water.png"}, use_texture_alpha = "blend", @@ -107,7 +116,7 @@ minetest.register_node("lottmapgen:blackflowing", { }) minetest.register_node("lottmapgen:black_river_source", { - description = "Black River Source", + description = S("Black River Source"), drawtype = "liquid", tiles = {"lottmapgen_black_water.png"}, use_texture_alpha = "blend", @@ -171,7 +180,7 @@ bucket.register_liquid( -- Grasses minetest.register_node("lottmapgen:dunland_grass", { - description = "Dunland Grass", + description = S("Dunland Grass"), tiles = {"default_grass.png^[colorize:#35ba3c:50", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#35ba3c:50)", tileable_vertical = false} }, @@ -184,7 +193,7 @@ minetest.register_node("lottmapgen:dunland_grass", { }) minetest.register_node("lottmapgen:ironhill_grass", { - description = "Iron Hills Grass", + description = S("Iron Hills Grass"), tiles = {"default_grass.png^[colorize:#1cbca7:60", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#1cbca7:60)", tileable_vertical = false} }, @@ -197,7 +206,7 @@ minetest.register_node("lottmapgen:ironhill_grass", { }) minetest.register_node("lottmapgen:gondor_grass", { - description = "Gondor Grass", + description = S("Gondor Grass"), tiles = {"default_grass.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, is_ground_content = true, groups = {crumbly=3, soil=1, lottmapgen_grass=1, not_in_creative_inventory=1}, @@ -208,7 +217,7 @@ minetest.register_node("lottmapgen:gondor_grass", { }) minetest.register_node("lottmapgen:lorien_grass", { - description = "Lorien Grass", + description = S("Lorien Grass"), tiles = {"default_grass.png^[colorize:#5bf7ea:75", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#5bf7ea:75)", tileable_vertical = false} }, @@ -221,7 +230,7 @@ minetest.register_node("lottmapgen:lorien_grass", { }) minetest.register_node("lottmapgen:fangorn_grass", { - description = "? Grass", + description = S("? Grass"), tiles = {"default_grass.png^[colorize:#720e6f:30", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#720e6f:30)", tileable_vertical = false} }, @@ -234,7 +243,7 @@ minetest.register_node("lottmapgen:fangorn_grass", { }) minetest.register_node("lottmapgen:mirkwood_grass", { - description = "Mirkwood Grass", + description = S("Mirkwood Grass"), tiles = {"default_grass.png^[colorize:#331507:120", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#331507:120)", tileable_vertical = false} }, @@ -247,7 +256,7 @@ minetest.register_node("lottmapgen:mirkwood_grass", { }) minetest.register_node("lottmapgen:rohan_grass", { - description = "? Grass", + description = S("? Grass"), tiles = {"default_grass.png^[colorize:#af5301:95", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#af5301:95)", tileable_vertical = false} }, @@ -260,7 +269,7 @@ minetest.register_node("lottmapgen:rohan_grass", { }) minetest.register_node("lottmapgen:shire_grass", { - description = "Shire Grass", + description = S("Shire Grass"), tiles = {"default_grass.png^[colorize:#86ad06:105", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#86ad06:105)", tileable_vertical = false} }, @@ -273,7 +282,7 @@ minetest.register_node("lottmapgen:shire_grass", { }) minetest.register_node("lottmapgen:ithilien_grass", { - description = "Ithilien Grass", + description = S("Ithilien Grass"), tiles = {"default_grass.png^[colorize:#ba6f35:50", "default_dirt.png", {name = "default_dirt.png^(default_grass_side.png^[colorize:#ba6f35:50)", tileable_vertical = false} }, diff --git a/mods/lottmobs/craftitems.lua b/mods/lottmobs/craftitems.lua index 6ba9d8a3..0813f7e4 100644 --- a/mods/lottmobs/craftitems.lua +++ b/mods/lottmobs/craftitems.lua @@ -1,16 +1,25 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_craftitem("lottmobs:meat", { - description = "Cooked Meat", + description = S("Cooked Meat"), inventory_image = "lottmobs_meat.png", on_use = minetest.item_eat(4), }) minetest.register_craftitem("lottmobs:meat_raw", { - description = "Raw Meat", + description = S("Raw Meat"), inventory_image = "lottmobs_meat_raw.png", }) minetest.register_craftitem("lottmobs:spiderpoison", { - description = "Spider Poison", + description = S("Spider Poison"), inventory_image = "lottmobs_spiderpoison.png", on_use = minetest.item_eat(-15) }) @@ -22,7 +31,7 @@ minetest.register_craft({ }) minetest.register_craftitem("lottmobs:dirty_shirt", { - description = "Dirty Jacket", + description = S("Dirty Jacket"), inventory_image = "lottclothes_inv_jacket_midgewater.png^[colorize:#935d3675", stack_max = 1, }) @@ -35,7 +44,7 @@ minetest.register_craft({ }) minetest.register_craftitem("lottmobs:dirty_trousers", { - description = "Dirty Trousers", + description = S("Dirty Trousers"), inventory_image = "lottclothes_inv_pants_midgewater.png^[colorize:#935d3675", stack_max = 1, }) diff --git a/mods/lottmobs/horse.lua b/mods/lottmobs/horse.lua index f6d312ce..7728f43e 100644 --- a/mods/lottmobs/horse.lua +++ b/mods/lottmobs/horse.lua @@ -1,3 +1,11 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) local function is_ground(pos) local nn = minetest.get_node(pos).name @@ -308,7 +316,7 @@ end --------------------- lottmobs:register_horse("lottmobs:horseh1", { - description = "Brown Horse", + description = S("Brown Horse"), inventory_image = "lottmobs_horse_inventory.png", }, { physical = true, @@ -334,7 +342,7 @@ lottmobs:register_horse("lottmobs:horseh1", { --horse white lottmobs:register_horse("lottmobs:horsepegh1", { - description = "White Horse", + description = S("White Horse"), inventory_image = "lottmobs_horsepeg_inventory.png", }, { physical = true, @@ -359,7 +367,7 @@ lottmobs:register_horse("lottmobs:horsepegh1", { --horse arabik lottmobs:register_horse("lottmobs:horsearah1", { - description = "Black Horse", + description = S("Black Horse"), inventory_image = "lottmobs_horseara_inventory.png", }, { physical = true, @@ -383,7 +391,7 @@ lottmobs:register_horse("lottmobs:horsearah1", { lottmobs:register_horse("lottmobs:shireponyblackh1", { - description = "Shire Pony", + description = S("Shire Pony"), inventory_image = "lottmobs_shireponyblack_inventory.png", }, { physical = true, @@ -407,7 +415,7 @@ lottmobs:register_horse("lottmobs:shireponyblackh1", { lottmobs:register_horse("lottmobs:shireponyh1", { - description = "Shire Pony", + description = S("Shire Pony"), inventory_image = "lottmobs_shirepony_inventory.png", }, { physical = true, diff --git a/mods/lottmobs/intllib.lua b/mods/lottmobs/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottmobs/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottmobs/locale/de.txt b/mods/lottmobs/locale/de.txt new file mode 100644 index 00000000..666b6584 --- /dev/null +++ b/mods/lottmobs/locale/de.txt @@ -0,0 +1,68 @@ +### trader_goods.lua +Ah, what a lovely land we have, so peaceful, so beautiful. = Ah, welch herrliches Land wir haben, so friedlich, so schön. +Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together. = Bist Du willens, mit uns zu kämpfen? Wir haben viel zu verlieren, aber auch viel zu gewinnen! Wir müssen uns zusammenscharen. +Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr! = +A spear is not a dwarven weapon, but it will kill all the same. = Ein Speer ist keine Zwergenwaffe, aber wird genauso töten. +Be careful when you enter our homes, a fall from the ladder could well prove deadly. = Sei vorsichtig beim Betreten unserer Behausungen, ein Sturz von der Leiter könnte durchaus tödlich enden. +Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme. = Vorsicht! Unsere Gemeinschaft, und alle Gemeinschaften, sind auf Messers Schneide - eine falsche Bewegung, und alles wird enden, und Sauron wird oberster Herrscher. +DIE!!! = STIRB!!! +Do not meddle in the affairs of Wizards, for they are subtle and quick to anger. = Mische dich nicht in die Angelegenheiten von Zauberern, denn sie sind sehr spitzfindig, und schnell zu erzürnen. +Do not scorn pity that is the gift of a gentle heart, Éowyn! = Verspotte nicht das Erbarmen, das von einem milden Herzen geschenkt wird, Éowyn! +Don't even think of stealing our treasure... If you do, heads shall roll. = Denke nicht einmal daran, unseren Schatz zu stehlen... Wenn du es tust, werden Köpfe rollen. +Don't listen to those who say that all this talk of war will come to nothing, for we are at war now. = Hör nicht auf jene, die behaupten, all diese Worte vom Krieg führten zu nichts, denn wir befinden uns bereits im Krieg. +Drinking contests with humans are unbearable. They drink, they collapse, \nand we have to drag them back to their homes. The next day they never remember losing. = Wetttrinken mit Menschen ist unerträglich. Sie trinken, sie brechen zusammen, \nund wir müssen sie zurück in ihre Häuser tragen. Am nächsten Tag dann erinnern sie sich nicht einmal daran, verloren zu haben. +Evil breeds in the guts of the lazy. = Das Übel gedeiht im Innern der Faulen. +Faithless is he who says farewell when the road darkens. = Treulos ist der, der sich verabschiedet, wenn sich der Weg verdunkelt. +Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes... = Essen ist dafür da, genossen zu werden, nicht verschlungen. Iss nicht nur hier und da ein bisschen, setz Dich auch einmal für eine richtige Mahlzeit hin... +For even the very wise cannot see all ends. = Denn auch die besonders weisen können nicht jeden Ausgang ersehen. +Go not to the Elves for counsel, for they will say both no and yes. = Frage niemals einen Elfen um Rat, denn er wird sowohl ja als auch nein sagen. +Guard your life, guard your gold, guard your beard. In that order. = Schütze Dein Leben, schütze Dein Gold, schütze Deinen Bart. In dieser Reihenfolge. +If you are in need of any food, there are traders who wander around and they usually have a good stock. = Wenn Du etwas zum Essen brauchst, es gibt Händler, die umherziehen, und sie haben meist einen guten Bestand. +If you are thinking that you'll find adventures here, think again! Good day! = Wenn Du meinst, Du wirst hier Abenteuer finden, überleg noch einmal! Guten Tag! +If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly. = Wenn Du Dich tief unter die Erde wagst, nimm Dich in acht! Die Monster dort sind sehr mächtig, und töten den Unvorbereiteten ohne Zögern. +If you want to mine, do so. There's plenty of iron to go around! = Wenn Du schürfen willst, leg los. Es gibt viel Eisen hier! +If you wish to buy goods from us, there are certain traders who wander our land. = Wenn Du Güter von uns kaufen willst, es gibt bestimmte Händler, die durch unsere Gebiete wandern. +It is easy to fool a goblin, but even easier to kill one. = Es ist leicht, einen Goblin zu überlisten, aber noch leichter, einen zu töten. +It is perilous to study too deeply the arts of the Enemy, for good or for ill. But such falls and betrayals, alas, have happened before. = Es ist gefährlich, die Künste des Feindes zu genau zu erforschen, ob gut oder schlecht. Aber leider ist solch Sturz und Verrat auch schon zuvor geschehen. +I will not say 'do not weep,' for not all tears are an evil. = Ich werde nicht sagen 'weine nicht', denn nicht alle Tränen sind ein Übel. +KILL! KILL! KILL! = TÖTEN! TÖTEN! TÖTEN! +Life here is far from normal. We wish for peace, yet the only way we can get peace is through war... = Das Leben hier ist bei weitem nicht normal. Wir wünschen uns Frieden, doch der einzige Weg, um Frieden zu haben, ist durch Krieg... +May the wind fill your sails. = Möge der Wind Deine Segel füllen. +Mines of Moria, where all our riches are! Mines of Moria, where our greed led to destruction. = Minen von Moria, wo all unsere Reichtümer sind! Minen von Moria, wo unsere Gier zur Zerstörung führte. +Never turn down an ale, who knows if it may be your last... = Lehne niemals ein Bier ab, wer weiß, ob es Dein letztes sein wird... +Rest among us and prepare yourself, for war is imminent. = Ruhe unter uns, und bereite Dich vor, denn der Krieg steht bevor. +Sauron grows in power. Shall we be able to vanquish him again? = Saurons Macht wächst. Werden wir in der Lage sein, ihn erneut zu bezwingen? +Someone else always has to carry on the story. = Stets muss ein anderer die Geschichte weiterführen. +Sweet water and light laughter till next we meet. = Süßes Wasser und unbeschwertes Lachen bis zum nächsten Mal, da wir uns sehen. +The best place to hide something precious is in your beard. = Der beste Ort, um etwas wertvolles zu verstecken, ist in Deinem Bart. +The Humans have a saying. The nail that sticks out gets hammered. We have a saying too. Shoddy work! Not a single nail should be sticking out. = Die Menschen haben ein Sprichwort. Den Nagel, der herausschaut, den trifft der Hammer. Wir haben auch ein Sprichwort. Schäbige Arbeit! Kein einziger Nagel sollte herausschauen. +The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods. = Das edle Volk der Menschen steigt auf in der Welt! Sogar die Zwerge fangen an, Interesse an manchen unserer Güter zu zeigen. +The old that is strong does not wither, deep roots are not reached by the frost. = Das alte, das kräftig ist, verkümmert nicht, tiefe Wurzeln werden vom Frost nicht erreicht. +The praise of the praiseworthy is above all rewards. = Der Ruhm des Rühmenswerten ist über aller Belohnung. +There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there? = Es geht nichts über den Geruch von Pfeifenrauch, der über einen kalten Oktobermorgen hinaufsteigt, oder? +The stones will sing if you let them. = Die Steine werden singen, wenn Du sie lässt. +Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!! = +War comes swiftly... We are preparing, but are we doing enough? = Der Krieg kommt rasch... Wir bereiten uns vor, aber tun wir genug? +We are a peace loving people, but if we are angered, our wrath is terrible! = Wir sind ein friedliebendes Volk, aber wenn wir erzürnt werden, ist unsere Wut schrecklich! +We can’t bring a troll to the fire, but we can bring the fire to the troll. = Wir können einen Troll nicht zum Feuer bringen, aber wir können das Feuer zum Troll bringen. +We have many treasures, and for the right price we might be willing to part with them... = Wir haben viele Schätze, und für einen angemessenen Preis könnten wir willens sein, uns von ihnen zu trennen... +We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt. = Wir hören Märchen vom Krieg, aber sie können nicht mehr sein als Märchen - wie das vom Oliphanten. +Welcome to our lovely forest home, weary traveler. Refresh yourself here. = Willkommen in unserer herrlichen Waldheimat, müder Reisender. Erfrische Dich hier. +We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force! = Wir erleiden Raubzüge von Orks, und andere üble Dinge, doch wir tun nichts! Wir müssen handeln, mit Stärke handeln! +What are you doing here? What do you want from us? = Was tust Du hier? Was willst Du von uns? +Wherever there are elves, there are lies. = Überall, wo Elfen sind, dort sind auch Lügen. +You can kill a dwarf, but you can never vanquish one. = Du kannst einen Zwerg töten, aber Du kannst niemals einen bezwingen. + +### horse.lua +Black Horse = Schwarzes Pferd +Brown Horse = Braunes Pferd +Shire Pony = Auenlandpony +White Horse = Weißes Pferd + +### craftitems.lua +Cooked Meat = gekochtes Fleisch +Dirty Jacket = schmutzige Jacke +Dirty Trousers = schmutzige Hose +Raw Meat = rohes Fleisch +Spider Poison = Spinnengift + diff --git a/mods/lottmobs/locale/template.txt b/mods/lottmobs/locale/template.txt new file mode 100644 index 00000000..c2b5c503 --- /dev/null +++ b/mods/lottmobs/locale/template.txt @@ -0,0 +1,68 @@ +### trader_goods.lua +Ah, what a lovely land we have, so peaceful, so beautiful. = +Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together. = +Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr! = +A spear is not a dwarven weapon, but it will kill all the same. = +Be careful when you enter our homes, a fall from the ladder could well prove deadly. = +Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme. = +DIE!!! = +Do not meddle in the affairs of Wizards, for they are subtle and quick to anger. = +Do not scorn pity that is the gift of a gentle heart, Éowyn! = +Don't even think of stealing our treasure... If you do, heads shall roll. = +Don't listen to those who say that all this talk of war will come to nothing, for we are at war now. = +Drinking contests with humans are unbearable. They drink, they collapse, \nand we have to drag them back to their homes. The next day they never remember losing. = +Evil breeds in the guts of the lazy. = +Faithless is he who says farewell when the road darkens. = +Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes... = +For even the very wise cannot see all ends. = +Go not to the Elves for counsel, for they will say both no and yes. = +Guard your life, guard your gold, guard your beard. In that order. = +If you are in need of any food, there are traders who wander around and they usually have a good stock. = +If you are thinking that you'll find adventures here, think again! Good day! = +If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly. = +If you want to mine, do so. There's plenty of iron to go around! = +If you wish to buy goods from us, there are certain traders who wander our land. = +It is easy to fool a goblin, but even easier to kill one. = +It is perilous to study too deeply the arts of the Enemy, for good or for ill. But such falls and betrayals, alas, have happened before. = +I will not say 'do not weep,' for not all tears are an evil. = +KILL! KILL! KILL! = +Life here is far from normal. We wish for peace, yet the only way we can get peace is through war... = +May the wind fill your sails. = +Mines of Moria, where all our riches are! Mines of Moria, where our greed led to destruction. = +Never turn down an ale, who knows if it may be your last... = +Rest among us and prepare yourself, for war is imminent. = +Sauron grows in power. Shall we be able to vanquish him again? = +Someone else always has to carry on the story. = +Sweet water and light laughter till next we meet. = +The best place to hide something precious is in your beard. = +The Humans have a saying. The nail that sticks out gets hammered. We have a saying too. Shoddy work! Not a single nail should be sticking out. = +The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods. = +The old that is strong does not wither, deep roots are not reached by the frost. = +The praise of the praiseworthy is above all rewards. = +There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there? = +The stones will sing if you let them. = +Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!! = +War comes swiftly... We are preparing, but are we doing enough? = +We are a peace loving people, but if we are angered, our wrath is terrible! = +We can’t bring a troll to the fire, but we can bring the fire to the troll. = +We have many treasures, and for the right price we might be willing to part with them... = +We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt. = +Welcome to our lovely forest home, weary traveler. Refresh yourself here. = +We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force! = +What are you doing here? What do you want from us? = +Wherever there are elves, there are lies. = +You can kill a dwarf, but you can never vanquish one. = + +### horse.lua +Black Horse = +Brown Horse = +Shire Pony = +White Horse = + +### craftitems.lua +Cooked Meat = +Dirty Jacket = +Dirty Trousers = +Raw Meat = +Spider Poison = + diff --git a/mods/lottmobs/mod.conf b/mods/lottmobs/mod.conf index e4224b1a..c2604e90 100644 --- a/mods/lottmobs/mod.conf +++ b/mods/lottmobs/mod.conf @@ -1,3 +1,4 @@ name = lottmobs description = LOTT Game mod: lottmobs - Adds various mobs -depends = default, mobs, lottclasses, fire, bones, lottores \ No newline at end of file +depends = default, mobs, lottclasses, fire, bones, lottores +optional_depends = intllib diff --git a/mods/lottmobs/trader_goods.lua b/mods/lottmobs/trader_goods.lua index 8f7c6309..533c5b06 100644 --- a/mods/lottmobs/trader_goods.lua +++ b/mods/lottmobs/trader_goods.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + --Item table format: --{thing selling, price (in gold ingots), chance that it won't appear in the trader's inventory} @@ -43,25 +52,25 @@ lottmobs.dwarf = { "Ori", "Gimli", "Gamil" }, messages = { - "We have many treasures, and for the right price we might be willing to part with them...", - "Don't even think of stealing our treasure... If you do, heads shall roll.", - "What are you doing here? What do you want from us?", - "Be careful when you enter our homes, a fall from the ladder could well prove deadly.", - "If you want to mine, do so. There's plenty of iron to go around!", - "If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly.", - "Mines of Moria, where all our riches are! Mines of Moria, where our greed led to destruction.", - "We can’t bring a troll to the fire, but we can bring the fire to the troll.", - "Never turn down an ale, who knows if it may be your last...", - "Guard your life, guard your gold, guard your beard. In that order.", - "Wherever there are elves, there are lies.", - "The Humans have a saying. The nail that sticks out gets hammered. We have a saying too. Shoddy work! Not a single nail should be sticking out.", - "You can kill a dwarf, but you can never vanquish one.", - "It is easy to fool a goblin, but even easier to kill one.", - "The best place to hide something precious is in your beard.", - "Evil breeds in the guts of the lazy.", - "The stones will sing if you let them.", - "Drinking contests with humans are unbearable. They drink, they collapse, \nand we have to drag them back to their homes. The next day they never remember losing.", - "A spear is not a dwarven weapon, but it will kill all the same.", + S("We have many treasures, and for the right price we might be willing to part with them..."), + S("Don't even think of stealing our treasure... If you do, heads shall roll."), + S("What are you doing here? What do you want from us?"), + S("Be careful when you enter our homes, a fall from the ladder could well prove deadly."), + S("If you want to mine, do so. There's plenty of iron to go around!"), + S("If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly."), + S("Mines of Moria, where all our riches are! Mines of Moria, where our greed led to destruction."), + S("We can’t bring a troll to the fire, but we can bring the fire to the troll."), + S("Never turn down an ale, who knows if it may be your last..."), + S("Guard your life, guard your gold, guard your beard. In that order."), + S("Wherever there are elves, there are lies."), + S("The Humans have a saying. The nail that sticks out gets hammered. We have a saying too. Shoddy work! Not a single nail should be sticking out."), + S("You can kill a dwarf, but you can never vanquish one."), + S("It is easy to fool a goblin, but even easier to kill one."), + S("The best place to hide something precious is in your beard."), + S("Evil breeds in the guts of the lazy."), + S("The stones will sing if you let them."), + S("Drinking contests with humans are unbearable. They drink, they collapse, \nand we have to drag them back to their homes. The next day they never remember losing."), + S("A spear is not a dwarven weapon, but it will kill all the same."), } } @@ -108,26 +117,26 @@ lottmobs.elf = { "Mistriel", "Ganis", "Mithes", "Loboril" }, messages = { - "Welcome to our lovely forest home, weary traveler. Refresh yourself here.", - "Sauron grows in power. Shall we be able to vanquish him again?", - "We are a peace loving people, but if we are angered, our wrath is terrible!", - "Rest among us and prepare yourself, for war is imminent.", - "If you wish to buy goods from us, there are certain traders who wander our land.", - "Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme.", + S("Welcome to our lovely forest home, weary traveler. Refresh yourself here."), + S("Sauron grows in power. Shall we be able to vanquish him again?"), + S("We are a peace loving people, but if we are angered, our wrath is terrible!"), + S("Rest among us and prepare yourself, for war is imminent."), + S("If you wish to buy goods from us, there are certain traders who wander our land."), + S("Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme."), "Êl síla erin lû e-govaned vîn.", - "It is perilous to study too deeply the arts of the Enemy, for good or for ill. But such falls and betrayals, alas, have happened before.", - "Do not meddle in the affairs of Wizards, for they are subtle and quick to anger.", - "The praise of the praiseworthy is above all rewards.", - "The old that is strong does not wither, deep roots are not reached by the frost.", - "I will not say 'do not weep,' for not all tears are an evil.", - "For even the very wise cannot see all ends.", - "Faithless is he who says farewell when the road darkens.", + S("It is perilous to study too deeply the arts of the Enemy, for good or for ill. But such falls and betrayals, alas, have happened before."), + S("Do not meddle in the affairs of Wizards, for they are subtle and quick to anger."), + S("The praise of the praiseworthy is above all rewards."), + S("The old that is strong does not wither, deep roots are not reached by the frost."), + S("I will not say 'do not weep,' for not all tears are an evil."), + S("For even the very wise cannot see all ends."), + S("Faithless is he who says farewell when the road darkens."), "Aa' lasser en lle coia orn n' omenta gurtha.", - "Sweet water and light laughter till next we meet.", + S("Sweet water and light laughter till next we meet."), "Aa' menealle nauva ar' malta.", - "May the wind fill your sails.", - "Do not scorn pity that is the gift of a gentle heart, Éowyn!", - "Someone else always has to carry on the story.", + S("May the wind fill your sails."), + S("Do not scorn pity that is the gift of a gentle heart, Éowyn!"), + S("Someone else always has to carry on the story."), } } @@ -171,13 +180,13 @@ lottmobs.hobbit = { "Hobson", "Ilberic", "Largo", "Madoc", "Orgulas", "Rorimac" }, messages = { - "Ah, what a lovely land we have, so peaceful, so beautiful.", - "There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there?", - "If you are in need of any food, there are traders who wander around and they usually have a good stock.", - "If you are thinking that you'll find adventures here, think again! Good day!", - "We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt.", - "Go not to the Elves for counsel, for they will say both no and yes.", - "Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes...", + S("Ah, what a lovely land we have, so peaceful, so beautiful."), + S("There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there?"), + S("If you are in need of any food, there are traders who wander around and they usually have a good stock."), + S("If you are thinking that you'll find adventures here, think again! Good day!"), + S("We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt."), + S("Go not to the Elves for counsel, for they will say both no and yes."), + S("Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes..."), } } @@ -221,12 +230,12 @@ lottmobs.human = { "Gilraen", "Írimon", "Minardil", "Oromendil", "Tarcil", "Vorondil" }, messages = { - "War comes swiftly... We are preparing, but are we doing enough?", - "The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods.", - "Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together.", - "Don't listen to those who say that all this talk of war will come to nothing, for we are at war now.", - "We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force!", - "Life here is far from normal. We wish for peace, yet the only way we can get peace is through war...", + S("War comes swiftly... We are preparing, but are we doing enough?"), + S("The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods."), + S("Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together."), + S("Don't listen to those who say that all this talk of war will come to nothing, for we are at war now."), + S("We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force!"), + S("Life here is far from normal. We wish for peace, yet the only way we can get peace is through war..."), } } lottmobs.orc = { @@ -236,7 +245,7 @@ lottmobs.orc = { "Othrod", "Radbug", "Shagrat", "Ufthak", "Uglúk" }, messages = { - "DIE!!!", "Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!!", - "Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!", "KILL! KILL! KILL!" + S("DIE!!!"), S("Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!!"), + S("Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!"), S("KILL! KILL! KILL!") }, } diff --git a/mods/lottores/intllib.lua b/mods/lottores/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottores/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottores/locale/de.txt b/mods/lottores/locale/de.txt new file mode 100644 index 00000000..70aecbc4 --- /dev/null +++ b/mods/lottores/locale/de.txt @@ -0,0 +1,25 @@ +### tools.lua +Copper Axe = Kupferaxt +Copper Pickaxe = Kupferspitzhacke +Copper Shovel = Kupferschaufel +Copper Sword = Kupferschwert +Galvorn Axe = Galvornaxt +Galvorn Pickaxe = Galvornspitzhacke +Galvorn Shovel = Galvornschaufel +Galvorn Sword = Galvornschwert +Gold Axe = Goldaxt +Gold Pickaxe = Goldspitzhacke +Gold Shovel = Goldschaufel +Gold Sword = Goldschwert +Mithril Axe = Mithrilaxt +Mithril Pickaxe = Mithrilspitzhacke +Mithril Shovel = Mithrilschaufel +Mithril Sword = Mithrilschwert +Silver Axe = Silberaxt +Silver Pickaxe = Silberspitzhacke +Silver Shovel = Silberschaufel +Silver Sword = Silberschwert +Tin Axe = Zinnaxt +Tin Pickaxe = Zinnspitzhacke +Tin Shovel = Zinnschaufel +Tin Sword = Zinnschwert diff --git a/mods/lottores/locale/template.txt b/mods/lottores/locale/template.txt new file mode 100644 index 00000000..a3a5db6b --- /dev/null +++ b/mods/lottores/locale/template.txt @@ -0,0 +1,25 @@ +### tools.lua +Copper Axe = +Copper Pickaxe = +Copper Shovel = +Copper Sword = +Galvorn Axe = +Galvorn Pickaxe = +Galvorn Shovel = +Galvorn Sword = +Gold Axe = +Gold Pickaxe = +Gold Shovel = +Gold Sword = +Mithril Axe = +Mithril Pickaxe = +Mithril Shovel = +Mithril Sword = +Silver Axe = +Silver Pickaxe = +Silver Shovel = +Silver Sword = +Tin Axe = +Tin Pickaxe = +Tin Shovel = +Tin Sword = diff --git a/mods/lottores/mod.conf b/mods/lottores/mod.conf index e409b9f9..20ffaa17 100644 --- a/mods/lottores/mod.conf +++ b/mods/lottores/mod.conf @@ -1,3 +1,4 @@ name = lottores description = LOTT Game mod: lottores - Adds various ores and their decorative counterparts -depends = default, stairs \ No newline at end of file +depends = default, stairs +optional_depends = intllib diff --git a/mods/lottores/tools.lua b/mods/lottores/tools.lua index 1653f21d..2f8ca3d0 100644 --- a/mods/lottores/tools.lua +++ b/mods/lottores/tools.lua @@ -1,7 +1,16 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + -- Pickaxe minetest.register_tool("lottores:copperpick", { - description = "Copper Pickaxe", + description = S("Copper Pickaxe"), inventory_image = "lottores_copperpick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -14,7 +23,7 @@ minetest.register_tool("lottores:copperpick", { }) minetest.register_tool("lottores:tinpick", { - description = "Tin Pickaxe", + description = S("Tin Pickaxe"), inventory_image = "lottores_tinpick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -27,7 +36,7 @@ minetest.register_tool("lottores:tinpick", { }) minetest.register_tool("lottores:silverpick", { - description = "Silver Pickaxe", + description = S("Silver Pickaxe"), inventory_image = "lottores_silverpick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -40,7 +49,7 @@ minetest.register_tool("lottores:silverpick", { }) minetest.register_tool("lottores:goldpick", { - description = "Gold Pickaxe", + description = S("Gold Pickaxe"), inventory_image = "lottores_goldpick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -53,7 +62,7 @@ minetest.register_tool("lottores:goldpick", { }) minetest.register_tool("lottores:galvornpick", { - description = "Galvorn Pickaxe", + description = S("Galvorn Pickaxe"), inventory_image = "lottores_galvornpick.png", groups = {forbidden=1}, tool_capabilities = { @@ -67,7 +76,7 @@ minetest.register_tool("lottores:galvornpick", { }) minetest.register_tool("lottores:mithrilpick", { - description = "Mithril Pickaxe", + description = S("Mithril Pickaxe"), inventory_image = "lottores_mithrilpick.png", tool_capabilities = { full_punch_interval = 0.8, @@ -83,7 +92,7 @@ minetest.register_tool("lottores:mithrilpick", { -- Axe minetest.register_tool("lottores:copperaxe", { - description = "Copper Axe", + description = S("Copper Axe"), inventory_image = "lottores_copperaxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -96,7 +105,7 @@ minetest.register_tool("lottores:copperaxe", { }) minetest.register_tool("lottores:tinaxe", { - description = "Tin Axe", + description = S("Tin Axe"), inventory_image = "lottores_tinaxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -109,7 +118,7 @@ minetest.register_tool("lottores:tinaxe", { }) minetest.register_tool("lottores:silveraxe", { - description = "Silver Axe", + description = S("Silver Axe"), inventory_image = "lottores_silveraxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -122,7 +131,7 @@ minetest.register_tool("lottores:silveraxe", { }) minetest.register_tool("lottores:goldaxe", { - description = "Gold Axe", + description = S("Gold Axe"), inventory_image = "lottores_goldaxe.png", tool_capabilities = { full_punch_interval = 1.0, @@ -135,7 +144,7 @@ minetest.register_tool("lottores:goldaxe", { }) minetest.register_tool("lottores:galvornaxe", { - description = "Galvorn Axe", + description = S("Galvorn Axe"), inventory_image = "lottores_galvornaxe.png", groups = {forbidden=1}, tool_capabilities = { @@ -149,7 +158,7 @@ minetest.register_tool("lottores:galvornaxe", { }) minetest.register_tool("lottores:mithrilaxe", { - description = "Mithril Axe", + description = S("Mithril Axe"), inventory_image = "lottores_mithrilaxe.png", tool_capabilities = { full_punch_interval = 0.8, @@ -164,7 +173,7 @@ minetest.register_tool("lottores:mithrilaxe", { -- Sword minetest.register_tool("lottores:coppersword", { - description = "Copper Sword", + description = S("Copper Sword"), inventory_image = "lottores_coppersword.png", tool_capabilities = { full_punch_interval = 1.25, @@ -177,7 +186,7 @@ minetest.register_tool("lottores:coppersword", { }) minetest.register_tool("lottores:tinsword", { - description = "Tin Sword", + description = S("Tin Sword"), inventory_image = "lottores_tinsword.png", tool_capabilities = { full_punch_interval = 1.25, @@ -190,7 +199,7 @@ minetest.register_tool("lottores:tinsword", { }) minetest.register_tool("lottores:silversword", { - description = "Silver Sword", + description = S("Silver Sword"), inventory_image = "lottores_silversword.png", tool_capabilities = { full_punch_interval = 1, @@ -203,7 +212,7 @@ minetest.register_tool("lottores:silversword", { }) minetest.register_tool("lottores:goldsword", { - description = "Gold Sword", + description = S("Gold Sword"), inventory_image = "lottores_goldsword.png", tool_capabilities = { full_punch_interval = 0.75, @@ -216,7 +225,7 @@ minetest.register_tool("lottores:goldsword", { }) minetest.register_tool("lottores:galvornsword", { - description = "Galvorn Sword", + description = S("Galvorn Sword"), inventory_image = "lottores_galvornsword.png", groups = {forbidden=1}, tool_capabilities = { @@ -230,7 +239,7 @@ minetest.register_tool("lottores:galvornsword", { }) minetest.register_tool("lottores:mithrilsword", { - description = "Mithril Sword", + description = S("Mithril Sword"), inventory_image = "lottores_mithrilsword.png", tool_capabilities = { full_punch_interval = 0.25, @@ -245,7 +254,7 @@ minetest.register_tool("lottores:mithrilsword", { -- Shovel minetest.register_tool("lottores:coppershovel", { - description = "Copper Shovel", + description = S("Copper Shovel"), inventory_image = "lottores_coppershovel.png", wield_image = "lottores_coppershovel.png^[transformR90", tool_capabilities = { @@ -259,7 +268,7 @@ minetest.register_tool("lottores:coppershovel", { }) minetest.register_tool("lottores:tinshovel", { - description = "Tin Shovel", + description = S("Tin Shovel"), inventory_image = "lottores_tinshovel.png", wield_image = "lottores_tinshovel.png^[transformR90", tool_capabilities = { @@ -273,7 +282,7 @@ minetest.register_tool("lottores:tinshovel", { }) minetest.register_tool("lottores:silvershovel", { - description = "Silver Shovel", + description = S("Silver Shovel"), inventory_image = "lottores_silvershovel.png", wield_image = "lottores_silvershovel.png^[transformR90", tool_capabilities = { @@ -287,7 +296,7 @@ minetest.register_tool("lottores:silvershovel", { }) minetest.register_tool("lottores:goldshovel", { - description = "Gold Shovel", + description = S("Gold Shovel"), inventory_image = "lottores_goldshovel.png", wield_image = "lottores_goldshovel.png^[transformR90", tool_capabilities = { @@ -301,7 +310,7 @@ minetest.register_tool("lottores:goldshovel", { }) minetest.register_tool("lottores:galvornshovel", { - description = "Galvorn Shovel", + description = S("Galvorn Shovel"), inventory_image = "lottores_galvornshovel.png", wield_image = "lottores_galvornshovel.png^[transformR90", groups = {forbidden=1}, @@ -316,7 +325,7 @@ minetest.register_tool("lottores:galvornshovel", { }) minetest.register_tool("lottores:mithrilshovel", { - description = "Mithril Shovel", + description = S("Mithril Shovel"), inventory_image = "lottores_mithrilshovel.png", wield_image = "lottores_mithrilshovel.png^[transformR90", tool_capabilities = { diff --git a/mods/lottplants/depends.txt b/mods/lottplants/depends.txt index 9abfa9b8..4d66736c 100644 --- a/mods/lottplants/depends.txt +++ b/mods/lottplants/depends.txt @@ -2,3 +2,4 @@ default flowers lottfarming stairs +intllib? diff --git a/mods/lottplants/init.lua b/mods/lottplants/init.lua index 174f703d..b243910b 100644 --- a/mods/lottplants/init.lua +++ b/mods/lottplants/init.lua @@ -1,10 +1,19 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + dofile(minetest.get_modpath("lottplants").."/nodes.lua") dofile(minetest.get_modpath("lottplants").."/wild_food.lua") dofile(minetest.get_modpath("lottplants").."/flowers.lua") dofile(minetest.get_modpath("lottplants").."/functions.lua") minetest.register_node("lottplants:brambles_of_mordor", { - description = "Brambles Of Mordor", + description = S("Brambles Of Mordor"), drawtype = "plantlike", tiles = { "lottplants_brambles_of_mordor.png" }, inventory_image = "lottplants_brambles_of_mordor.png", @@ -25,7 +34,7 @@ minetest.register_node("lottplants:brambles_of_mordor", { }) minetest.register_node("lottplants:pilinehtar", { - description = "Pilinehtar", + description = S("Pilinehtar"), drawtype = "plantlike", tiles = { "lottplants_pilinehtar.png" }, inventory_image = "lottplants_pilinehtar.png", @@ -95,7 +104,7 @@ minetest.register_abm({ }) minetest.register_craftitem("lottplants:honey", { - description = "Honey", + description = S("Honey"), inventory_image = "lottplants_honey.png", on_use = minetest.item_eat(1), }) diff --git a/mods/lottplants/intllib.lua b/mods/lottplants/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottplants/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottplants/locale/de.txt b/mods/lottplants/locale/de.txt new file mode 100644 index 00000000..c99a312f --- /dev/null +++ b/mods/lottplants/locale/de.txt @@ -0,0 +1,53 @@ +### nodes.lua +Alder Leaf = Erlenblatt +Alder Planks = Erlenbretter +Alder Sapling = Erlenbäumchen +Alder Tree = Erlenbaum +Apple Leaf = Apfelblatt +Apple Tree Sapling = Apfelbäumchen +Beech Leaf = Buchenblatt +Beech Sapling = Buchenbäumchen +Birch Leaf = Birkenblatt +Birch Planks = Birkenbretter +Birch Sapling = Birkenbäumchen +Birch Tree = Birkenbaum +Culumalda Leaf = Culumaldablatt +Culumalda Sapling = Culumaldabäumchen +Elm Leaf = Ulmenblatt +Elm Sapling = Ulmenbäumchen +Fireflies = Glühwürmchen +Fir Leaf = Tannenblatt +Fir Sapling = Tannenbäumchen +Lebethron Leaf = Lebethronblatt +Lebethron Planks = Lebethronbretter +Lebethron Sapling = Lebethronbäumchen +Lebethron Tree = Lebethronbaum +Lorien Grass = Loriengras +Mallorn Leaf = Mallornblatt +Mallorn Planks = Mallornbretter +Mallorn Sapling = Mallornbäumchen +Mallorn Tree = Mallornbaum +Mirkwood Leaves = Düsterwaldblätter +Mirkwood Sapling = Düsterwaldbäumchen +Pine Leaf = Kiefernblatt +Pine Planks = Kiefernbretter +Pine Sapling = Kiefernbäumchen +Pine Tree = Kiefernbaum +Plum = Pflaume +Plum Leaf = Pflaumenblatt +Plum Tree Sapling = Pflaumenbäumchen +Rowan Leaf = Ebereschenblatt +Rowan Leaf with Berries = Ebereschenblatt mit Beeren +Rowan Sapling = Ebereschenbäumchen +White Leaf = weißes Blatt +White Tree Sapling = Weißblattbäumchen +Yavannamire Fruit = Yavannamirfrucht +Yavannamire Leaf = Yavannamirblatt +Yavannamire Sapling = Yavannamirbäumchen +Yellow Flowers on Culumalda Leaf = gelbe Blüten auf einem Culumaldablatt +Young Mallorn Trunk = junger Mallornstamm + +### init.lua +Brambles Of Mordor = Dornen von Mordor +Honey = Honig + diff --git a/mods/lottplants/locale/template.txt b/mods/lottplants/locale/template.txt new file mode 100644 index 00000000..7a5c1162 --- /dev/null +++ b/mods/lottplants/locale/template.txt @@ -0,0 +1,53 @@ +### nodes.lua +Alder Leaf = +Alder Planks = +Alder Sapling = +Alder Tree = +Apple Leaf = +Apple Tree Sapling = +Beech Leaf = +Beech Sapling = +Birch Leaf = +Birch Planks = +Birch Sapling = +Birch Tree = +Culumalda Leaf = +Culumalda Sapling = +Elm Leaf = +Elm Sapling = +Fireflies = +Fir Leaf = +Fir Sapling = +Lebethron Leaf = +Lebethron Planks = +Lebethron Sapling = +Lebethron Tree = +Lorien Grass = +Mallorn Leaf = +Mallorn Planks = +Mallorn Sapling = +Mallorn Tree = +Mirkwood Leaves = +Mirkwood Sapling = +Pine Leaf = +Pine Planks = +Pine Sapling = +Pine Tree = +Plum = +Plum Leaf = +Plum Tree Sapling = +Rowan Leaf = +Rowan Leaf with Berries = +Rowan Sapling = +White Leaf = +White Tree Sapling = +Yavannamire Fruit = +Yavannamire Leaf = +Yavannamire Sapling = +Yellow Flowers on Culumalda Leaf = +Young Mallorn Trunk = + +### init.lua +Brambles Of Mordor = +Honey = + diff --git a/mods/lottplants/mod.conf b/mods/lottplants/mod.conf index dcc71944..4707c461 100644 --- a/mods/lottplants/mod.conf +++ b/mods/lottplants/mod.conf @@ -1,3 +1,4 @@ name = lottplants description = LOTT Game mod: lottplants - Adds a series of decorative plants meant to be used by lottmapgen to populate the world -depends = default, flowers, lottfarming, stairs \ No newline at end of file +depends = default, flowers, lottfarming, stairs +optional_depends = intllib diff --git a/mods/lottplants/nodes.lua b/mods/lottplants/nodes.lua index 71b967bf..2c232f70 100644 --- a/mods/lottplants/nodes.lua +++ b/mods/lottplants/nodes.lua @@ -1,7 +1,16 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + -- LEAVES minetest.register_node("lottplants:alderleaf", { - description = "Alder Leaf", + description = S("Alder Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_alderleaf.png"}, paramtype = "light", @@ -23,7 +32,7 @@ minetest.register_node("lottplants:alderleaf", { }) minetest.register_node("lottplants:appleleaf", { - description = "Apple Leaf", + description = S("Apple Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_appleleaf.png"}, paramtype = "light", @@ -45,7 +54,7 @@ minetest.register_node("lottplants:appleleaf", { }) minetest.register_node("lottplants:birchleaf", { - description = "Birch Leaf", + description = S("Birch Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_birchleaf.png"}, paramtype = "light", @@ -67,7 +76,7 @@ minetest.register_node("lottplants:birchleaf", { }) minetest.register_node("lottplants:beechleaf", { - description = "Beech Leaf", + description = S("Beech Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_beechleaf.png"}, paramtype = "light", @@ -89,7 +98,7 @@ minetest.register_node("lottplants:beechleaf", { }) minetest.register_node("lottplants:culumaldaleaf", { - description = "Culumalda Leaf", + description = S("Culumalda Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_culumaldaleaf.png"}, paramtype = "light", @@ -111,7 +120,7 @@ minetest.register_node("lottplants:culumaldaleaf", { }) minetest.register_node("lottplants:yellowflowers", { - description = "Yellow Flowers on Culumalda Leaf", + description = S("Yellow Flowers on Culumalda Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_yellowflowers.png"}, paramtype = "light", @@ -129,7 +138,7 @@ minetest.register_node("lottplants:yellowflowers", { }) minetest.register_node("lottplants:elmleaf", { - description = "Elm Leaf", + description = S("Elm Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_elmleaf.png"}, paramtype = "light", @@ -151,7 +160,7 @@ minetest.register_node("lottplants:elmleaf", { }) minetest.register_node("lottplants:firleaf", { - description = "Fir Leaf", + description = S("Fir Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_firleaf.png"}, paramtype = "light", @@ -173,7 +182,7 @@ minetest.register_node("lottplants:firleaf", { }) minetest.register_node("lottplants:lebethronleaf", { - description = "Lebethron Leaf", + description = S("Lebethron Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_lebethronleaf.png"}, paramtype = "light", @@ -195,7 +204,7 @@ minetest.register_node("lottplants:lebethronleaf", { }) minetest.register_node("lottplants:mallornleaf", { - description = "Mallorn Leaf", + description = S("Mallorn Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_mallornleaf.png"}, paramtype = "light", @@ -217,7 +226,7 @@ minetest.register_node("lottplants:mallornleaf", { }) minetest.register_node("lottplants:pineleaf", { - description = "Pine Needles", + description = S("Pine Needles"), drawtype = "allfaces_optional", tiles = {"lottplants_pineleaf.png"}, paramtype = "light", @@ -239,7 +248,7 @@ minetest.register_node("lottplants:pineleaf", { }) minetest.register_node("lottplants:plumleaf", { - description = "Plum Leaf", + description = S("Plum Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_plumleaf.png"}, paramtype = "light", @@ -261,7 +270,7 @@ minetest.register_node("lottplants:plumleaf", { }) minetest.register_node("lottplants:rowanleaf", { - description = "Rowan Leaf", + description = S("Rowan Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_rowanleaf.png"}, paramtype = "light", @@ -279,7 +288,7 @@ minetest.register_node("lottplants:rowanleaf", { }) minetest.register_node("lottplants:rowanberry", { - description = "Rowan Leaf with Berries", + description = S("Rowan Leaf with Berries"), drawtype = "allfaces_optional", tiles = {"lottplants_rowanleaf.png^lottplants_rowanberry.png"}, paramtype = "light", @@ -296,7 +305,7 @@ minetest.register_node("lottplants:rowanberry", { }) minetest.register_node("lottplants:whiteleaf", { - description = "White Leaf", + description = S("White Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_whiteleaf.png"}, paramtype = "light", @@ -318,7 +327,7 @@ minetest.register_node("lottplants:whiteleaf", { }) minetest.register_node("lottplants:yavannamireleaf", { - description = "Yavannamire Leaf", + description = S("Yavannamire Leaf"), drawtype = "allfaces_optional", tiles = {"lottplants_yavannamireleaf.png"}, paramtype = "light", @@ -341,7 +350,7 @@ minetest.register_node("lottplants:yavannamireleaf", { minetest.register_alias("lottmapgen:mirkleaves", "lottplants:mirkleaf") minetest.register_node("lottplants:mirkleaf", { - description = "Mirkwood Leaves", + description = S("Mirkwood Leaves"), drawtype = "allfaces_optional", tiles = {"lottplants_mirkleaf.png"}, paramtype = "light", @@ -367,7 +376,7 @@ minetest.register_node("lottplants:mirkleaf", { -- TREE minetest.register_node("lottplants:pinetree", { - description = "Pine Tree", + description = S("Pine Tree"), tiles = {"lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png"}, paramtype2 = "facedir", groups = {tree=1,choppy=3,flammable=2}, @@ -379,7 +388,7 @@ minetest.register_node("lottplants:pinetree", { }) minetest.register_node("lottplants:birchtree", { - description = "Birch Tree", + description = S("Birch Tree"), tiles = {"lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png"}, paramtype2 = "facedir", groups = {tree=1,choppy=3,flammable=2}, @@ -391,7 +400,7 @@ minetest.register_node("lottplants:birchtree", { }) minetest.register_node("lottplants:aldertree", { - description = "Alder Tree", + description = S("Alder Tree"), tiles = {"lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png"}, paramtype2 = "facedir", groups = {tree=1,choppy=2,flammable=2}, @@ -403,7 +412,7 @@ minetest.register_node("lottplants:aldertree", { }) minetest.register_node("lottplants:lebethrontree", { - description = "Lebethron Tree", + description = S("Lebethron Tree"), tiles = {"lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png"}, paramtype2 = "facedir", groups = {tree=1,choppy=1,flammable=2}, @@ -415,7 +424,7 @@ minetest.register_node("lottplants:lebethrontree", { }) minetest.register_node("lottplants:mallorntree", { - description = "Mallorn Tree", + description = S("Mallorn Tree"), tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"}, paramtype2 = "facedir", groups = {tree=1,choppy=1,flammable=2}, @@ -427,7 +436,7 @@ minetest.register_node("lottplants:mallorntree", { }) minetest.register_node("lottplants:mallorntree_young", { - description = "Young Mallorn Trunk", + description = S("Young Mallorn Trunk"), tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"}, drawtype = "nodebox", paramtype = "light", @@ -450,7 +459,7 @@ minetest.register_node("lottplants:mallorntree_young", { -- SAPLINGS minetest.register_node("lottplants:aldersapling", { - description = "Alder Sapling", + description = S("Alder Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_aldersapling.png"}, @@ -463,7 +472,7 @@ minetest.register_node("lottplants:aldersapling", { }) minetest.register_node("lottplants:applesapling", { - description = "Apple Tree Sapling", + description = S("Apple Tree Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_applesapling.png"}, @@ -476,7 +485,7 @@ minetest.register_node("lottplants:applesapling", { }) minetest.register_node("lottplants:birchsapling", { - description = "Birch Sapling", + description = S("Birch Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_birchsapling.png"}, @@ -489,7 +498,7 @@ minetest.register_node("lottplants:birchsapling", { }) minetest.register_node("lottplants:beechsapling", { - description = "Beech Sapling", + description = S("Beech Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_beechsapling.png"}, @@ -502,7 +511,7 @@ minetest.register_node("lottplants:beechsapling", { }) minetest.register_node("lottplants:culumaldasapling", { - description = "Culumalda Sapling", + description = S("Culumalda Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_culumaldasapling.png"}, @@ -515,7 +524,7 @@ minetest.register_node("lottplants:culumaldasapling", { }) minetest.register_node("lottplants:elmsapling", { - description = "Elm Sapling", + description = S("Elm Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_elmsapling.png"}, @@ -528,7 +537,7 @@ minetest.register_node("lottplants:elmsapling", { }) minetest.register_node("lottplants:firsapling", { - description = "Fir Sapling", + description = S("Fir Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_firsapling.png"}, @@ -541,7 +550,7 @@ minetest.register_node("lottplants:firsapling", { }) minetest.register_node("lottplants:lebethronsapling", { - description = "Lebethron Sapling", + description = S("Lebethron Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_lebethronsapling.png"}, @@ -554,7 +563,7 @@ minetest.register_node("lottplants:lebethronsapling", { }) minetest.register_node("lottplants:mallornsapling", { - description = "Mallorn Sapling", + description = S("Mallorn Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_mallornsapling.png"}, @@ -567,7 +576,7 @@ minetest.register_node("lottplants:mallornsapling", { }) minetest.register_node("lottplants:mallorntree_young_grower", { - description = "Young Mallorn Trunk", + description = S("Young Mallorn Trunk"), tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"}, drawtype = "nodebox", paramtype = "light", @@ -589,7 +598,7 @@ minetest.register_node("lottplants:mallorntree_young_grower", { }) minetest.register_node("lottplants:mallorntree_grower", { - description = "Mallorn Tree", + description = S("Mallorn Tree"), tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"}, paramtype2 = "facedir", groups = {tree=1,choppy=1,flammable=2, not_in_creative_inventory=1,sapling=1}, @@ -602,7 +611,7 @@ minetest.register_node("lottplants:mallorntree_grower", { }) minetest.register_node("lottplants:pinesapling", { - description = "Pine Sapling", + description = S("Pine Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_pinesapling.png"}, @@ -615,7 +624,7 @@ minetest.register_node("lottplants:pinesapling", { }) minetest.register_node("lottplants:plumsapling", { - description = "Plum Tree Sapling", + description = S("Plum Tree Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_plumsapling.png"}, @@ -628,7 +637,7 @@ minetest.register_node("lottplants:plumsapling", { }) minetest.register_node("lottplants:rowansapling", { - description = "Rowan Sapling", + description = S("Rowan Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_rowansapling.png"}, @@ -641,7 +650,7 @@ minetest.register_node("lottplants:rowansapling", { }) minetest.register_node("lottplants:whitesapling", { - description = "White Tree Sapling", + description = S("White Tree Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_whitesapling.png"}, @@ -654,7 +663,7 @@ minetest.register_node("lottplants:whitesapling", { }) minetest.register_node("lottplants:yavannamiresapling", { - description = "Yavannamire Sapling", + description = S("Yavannamire Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_yavannamiresapling.png"}, @@ -667,7 +676,7 @@ minetest.register_node("lottplants:yavannamiresapling", { }) minetest.register_node("lottplants:mirksapling", { - description = "Mirkwood Sapling", + description = S("Mirkwood Sapling"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_mirksapling.png"}, @@ -682,7 +691,7 @@ minetest.register_node("lottplants:mirksapling", { -- FRUITS minetest.register_node("lottplants:plum", { - description = "Plum", + description = S("Plum"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_plum.png"}, @@ -705,7 +714,7 @@ minetest.register_node("lottplants:plum", { }) minetest.register_node("lottplants:yavannamirefruit", { - description = "Yavannamire Fruit", + description = S("Yavannamire Fruit"), drawtype = "plantlike", visual_scale = 1.0, tiles = {"lottplants_yavannamirefruit.png"}, @@ -730,35 +739,35 @@ minetest.register_node("lottplants:yavannamirefruit", { --Wood minetest.register_node("lottplants:pinewood", { - description = "Pine Planks", + description = S("Pine Planks"), tiles = {"lottplants_pinewood.png"}, groups = {choppy=3,flammable=3,wood=1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("lottplants:birchwood", { - description = "Birch Planks", + description = S("Birch Planks"), tiles = {"lottplants_birchwood.png"}, groups = {choppy=3,flammable=3,wood=1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("lottplants:alderwood", { - description = "Alder Planks", + description = S("Alder Planks"), tiles = {"lottplants_alderwood.png"}, groups = {choppy=2,flammable=3,wood=1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("lottplants:lebethronwood", { - description = "Lebethron Planks", + description = S("Lebethron Planks"), tiles = {"lottplants_lebethronwood.png"}, groups = {choppy=1,flammable=3,wood=1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("lottplants:mallornwood", { - description = "Mallorn Planks", + description = S("Mallorn Planks"), tiles = {"lottplants_mallornwood.png"}, groups = {choppy=1,flammable=3,wood=1}, sounds = default.node_sound_wood_defaults(), @@ -767,7 +776,7 @@ minetest.register_node("lottplants:mallornwood", { --Lorien grass minetest.register_node("lottplants:lorien_grass_1", { - description = "Lorien Grass", + description = S("Lorien Grass"), drawtype = "plantlike", tiles = {"lottplants_lorien_grass_1.png"}, -- use a bigger inventory image @@ -795,7 +804,7 @@ minetest.register_node("lottplants:lorien_grass_1", { for i = 2, 4 do minetest.register_node("lottplants:lorien_grass_" .. i, { - description = "Lorien Grass", + description = S("Lorien Grass"), drawtype = "plantlike", tiles = {"lottplants_lorien_grass_" .. i .. ".png"}, inventory_image = "lottplants_lorien_grass_" .. i .. ".png", @@ -940,7 +949,7 @@ minetest.register_craft({ --Fireflies minetest.register_node("lottplants:fireflies", { - description = "Fireflies", + description = S("Fireflies"), drawtype = "glasslike", tiles = { { diff --git a/mods/lottthrowing/arrow.lua b/mods/lottthrowing/arrow.lua index 02d1a905..6bb38d6d 100644 --- a/mods/lottthrowing/arrow.lua +++ b/mods/lottthrowing/arrow.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_node("lottthrowing:light", { drawtype = "airlike", paramtype = "light", @@ -23,15 +32,15 @@ minetest.register_abm({ }) local arrow_types = { - {"arrow", "Arrow", 3}, - {"arrow_mithril", "Mithril Arrow", 10}, - {"arrow_fire", "Fire Arrow", 5, "fire:basic_flame"}, - {"arrow_fire_blue", "Fire Arrow", 20, "lottother:blue_flame"}, - {"arrow_magical", "Magical Arrow", 0, nil, true}, - - {"bolt", "Bolt", 5}, - {"bolt_mithril", "Mithril Bolt", 20}, - {"bolt_fire", "Fire Bolt", 8, "fire:basic_flame"}, + {"arrow", S("Arrow"), 3}, + {"arrow_mithril", S("Mithril Arrow"), 10}, + {"arrow_fire", S("Fire Arrow"), 5, "fire:basic_flame"}, + {"arrow_fire_blue", S("Fire Arrow"), 20, "lottother:blue_flame"}, + {"arrow_magical", S("Magical Arrow"), 0, nil, true}, + + {"bolt", S("Bolt"), 5}, + {"bolt_mithril", S("Mithril Bolt"), 20}, + {"bolt_fire", S("Fire Bolt"), 8, "fire:basic_flame"}, } for i in pairs(arrow_types) do @@ -174,4 +183,4 @@ minetest.register_craft({ recipe = { {'default:stick', 'default:stick', 'default:mese'}, } -}) \ No newline at end of file +}) diff --git a/mods/lottthrowing/init.lua b/mods/lottthrowing/init.lua index 19c2c12e..98a0b694 100644 --- a/mods/lottthrowing/init.lua +++ b/mods/lottthrowing/init.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + arrows = { {"lottthrowing:arrow", "lottthrowing:arrow_entity"}, {"lottthrowing:arrow_mithril", "lottthrowing:arrow_mithril_entity"}, @@ -151,7 +160,7 @@ local lottthrowing_shoot_bolt = function(itemstack, player, pointed_thing, draws end minetest.register_tool("lottthrowing:bow_wood", { - description = "Normal Wood Bow", + description = S("Normal Wood Bow"), inventory_image = "lottthrowing_bow_wood.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -165,7 +174,7 @@ minetest.register_tool("lottthrowing:bow_wood", { }) minetest.register_tool("lottthrowing:bow_wood_alder", { - description = "Alder Wood Bow", + description = S("Alder Wood Bow"), inventory_image = "lottthrowing_bow_wood_alder.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -179,7 +188,7 @@ minetest.register_tool("lottthrowing:bow_wood_alder", { }) minetest.register_tool("lottthrowing:bow_wood_birch", { - description = "Birch Wood Bow", + description = S("Birch Wood Bow"), inventory_image = "lottthrowing_bow_wood_birch.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -193,7 +202,7 @@ minetest.register_tool("lottthrowing:bow_wood_birch", { }) minetest.register_tool("lottthrowing:bow_wood_lebethron", { - description = "Lebethron Wood Bow", + description = S("Lebethron Wood Bow"), inventory_image = "lottthrowing_bow_wood_lebethron.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -207,7 +216,7 @@ minetest.register_tool("lottthrowing:bow_wood_lebethron", { }) minetest.register_tool("lottthrowing:bow_wood_mallorn", { - description = "Mallorn Bow", + description = S("Mallorn Bow"), inventory_image = "lottthrowing_bow_wood_mallorn.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -266,7 +275,7 @@ minetest.register_craft({ }) minetest.register_tool("lottthrowing:crossbow_wood", { - description = "Wooden Crossbow", + description = S("Wooden Crossbow"), inventory_image = "lottthrowing_crossbow_wood.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -280,7 +289,7 @@ minetest.register_tool("lottthrowing:crossbow_wood", { }) minetest.register_tool("lottthrowing:crossbow_steel", { - description = "Steel Crossbow", + description = S("Steel Crossbow"), inventory_image = "lottthrowing_crossbow_steel.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -294,7 +303,7 @@ minetest.register_tool("lottthrowing:crossbow_steel", { }) minetest.register_tool("lottthrowing:crossbow_tin", { - description = "Tin Crossbow", + description = S("Tin Crossbow"), inventory_image = "lottthrowing_crossbow_tin.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -308,7 +317,7 @@ minetest.register_tool("lottthrowing:crossbow_tin", { }) minetest.register_tool("lottthrowing:crossbow_silver", { - description = "Silver Crossbow", + description = S("Silver Crossbow"), inventory_image = "lottthrowing_crossbow_silver.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -322,7 +331,7 @@ minetest.register_tool("lottthrowing:crossbow_silver", { }) minetest.register_tool("lottthrowing:crossbow_gold", { - description = "Gold Crossbow", + description = S("Gold Crossbow"), inventory_image = "lottthrowing_crossbow_gold.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) @@ -336,7 +345,7 @@ minetest.register_tool("lottthrowing:crossbow_gold", { }) minetest.register_tool("lottthrowing:crossbow_galvorn", { - description = "Galvorn Crossbow", + description = S("Galvorn Crossbow"), inventory_image = "lottthrowing_crossbow_galvorn.png", groups = {forbidden=1}, stack_max = 1, @@ -351,7 +360,7 @@ minetest.register_tool("lottthrowing:crossbow_galvorn", { }) minetest.register_tool("lottthrowing:crossbow_mithril", { - description = "Mithril Crossbow", + description = S("Mithril Crossbow"), inventory_image = "lottthrowing_crossbow_mithril.png", stack_max = 1, on_use = function(itemstack, user, pointed_thing) diff --git a/mods/lottthrowing/intllib.lua b/mods/lottthrowing/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottthrowing/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottthrowing/locale/de.txt b/mods/lottthrowing/locale/de.txt new file mode 100644 index 00000000..0241eebc --- /dev/null +++ b/mods/lottthrowing/locale/de.txt @@ -0,0 +1,22 @@ +### init.lua +Alder Wood Bow = Erlenholzbogen +Birch Wood Bow = Birkenholzbogen +Galvorn Crossbow = Galvornholzbogen +Gold Crossbow = Goldarmbrust +Lebethron Wood Bow = Lebethronholzbogen +Mallorn Bow = Mallornbogen +Mithril Crossbow = Mithrilarmbrust +Normal Wood Bow = normaler Holzbogen +Silver Crossbow = Silberarmbrust +Steel Crossbow = Stahlarmbrust +Tin Crossbow = Zinnarmbrust +Wooden Crossbow = hölzerne Armbrust + +### arrow.lua +Arrow = Pfeil +Mithril Arrow = Mithrilpfeil +Magical Arrow = Magischer Pfeil +Fire Arrow = Feuerpfeil +Bolt = Bolzen +Mithril Bolt = Mitrilbolzen +Fire Bolt = Feuerbolzen diff --git a/mods/lottthrowing/locale/template.txt b/mods/lottthrowing/locale/template.txt new file mode 100644 index 00000000..feabdccb --- /dev/null +++ b/mods/lottthrowing/locale/template.txt @@ -0,0 +1,22 @@ +### init.lua +Alder Wood Bow = +Birch Wood Bow = +Galvorn Crossbow = +Gold Crossbow = +Lebethron Wood Bow = +Mallorn Bow = +Mithril Crossbow = +Normal Wood Bow = +Silver Crossbow = +Steel Crossbow = +Tin Crossbow = +Wooden Crossbow = + +### arrow.lua +Arrow = +Mithril Arrow = +Magical Arrow = +Fire Arrow = +Bolt = +Mithril Bolt = +Fire Bolt = diff --git a/mods/lottthrowing/mod.conf b/mods/lottthrowing/mod.conf index c947f9c1..ae144611 100644 --- a/mods/lottthrowing/mod.conf +++ b/mods/lottthrowing/mod.conf @@ -1,3 +1,4 @@ name = lottthrowing description = LOTT Game mod: lottthrowing - Adds bows, crossbows, arrows & throwing axes -depends = default, fire, farming, lottores, lottother \ No newline at end of file +depends = default, fire, farming, lottores, lottother +optional_depends = intllib diff --git a/mods/lottweapons/init.lua b/mods/lottweapons/init.lua index f6361db5..5e498662 100644 --- a/mods/lottweapons/init.lua +++ b/mods/lottweapons/init.lua @@ -1,3 +1,12 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + dofile(minetest.get_modpath("lottweapons") .. "/special.lua") dofile(minetest.get_modpath("lottweapons") .. "/crafting.lua") @@ -5,7 +14,7 @@ dofile(minetest.get_modpath("lottweapons") .. "/crafting.lua") -- Battle axes: minetest.register_tool("lottweapons:wood_battleaxe", { - description = "Training Battleaxe", + description = S("Training Battleaxe"), inventory_image = "lottweapons_wood_battleaxe.png", tool_capabilities = { full_punch_interval = 2, @@ -19,7 +28,7 @@ minetest.register_tool("lottweapons:wood_battleaxe", { }) minetest.register_tool("lottweapons:stone_battleaxe", { - description = "Stone Battleaxe", + description = S("Stone Battleaxe"), inventory_image = "lottweapons_stone_battleaxe.png", tool_capabilities = { full_punch_interval = 1.50, @@ -33,7 +42,7 @@ minetest.register_tool("lottweapons:stone_battleaxe", { }) minetest.register_tool("lottweapons:copper_battleaxe", { - description = "Copper Battleaxe", + description = S("Copper Battleaxe"), inventory_image = "lottweapons_copper_battleaxe.png", tool_capabilities = { full_punch_interval = 1.25, @@ -47,7 +56,7 @@ minetest.register_tool("lottweapons:copper_battleaxe", { }) minetest.register_tool("lottweapons:tin_battleaxe", { - description = "Tin Battleaxe", + description = S("Tin Battleaxe"), inventory_image = "lottweapons_tin_battleaxe.png", tool_capabilities = { full_punch_interval = 1.25, @@ -61,7 +70,7 @@ minetest.register_tool("lottweapons:tin_battleaxe", { }) minetest.register_tool("lottweapons:steel_battleaxe", { - description = "Steel Battleaxe", + description = S("Steel Battleaxe"), inventory_image = "lottweapons_steel_battleaxe.png", tool_capabilities = { full_punch_interval = 1.05, @@ -75,7 +84,7 @@ minetest.register_tool("lottweapons:steel_battleaxe", { }) minetest.register_tool("lottweapons:bronze_battleaxe", { - description = "Bronze Battleaxe", + description = S("Bronze Battleaxe"), inventory_image = "lottweapons_bronze_battleaxe.png", tool_capabilities = { full_punch_interval = 0.90, @@ -89,7 +98,7 @@ minetest.register_tool("lottweapons:bronze_battleaxe", { }) minetest.register_tool("lottweapons:silver_battleaxe", { - description = "Silver Battleaxe", + description = S("Silver Battleaxe"), inventory_image = "lottweapons_silver_battleaxe.png", tool_capabilities = { full_punch_interval = 1, @@ -103,7 +112,7 @@ minetest.register_tool("lottweapons:silver_battleaxe", { }) minetest.register_tool("lottweapons:gold_battleaxe", { - description = "Gold Battleaxe", + description = S("Gold Battleaxe"), inventory_image = "lottweapons_gold_battleaxe.png", tool_capabilities = { full_punch_interval = 0.75, @@ -117,7 +126,7 @@ minetest.register_tool("lottweapons:gold_battleaxe", { }) minetest.register_tool("lottweapons:galvorn_battleaxe", { - description = "Galvorn Battleaxe", + description = S("Galvorn Battleaxe"), inventory_image = "lottweapons_galvorn_battleaxe.png", groups = {forbidden=1}, tool_capabilities = { @@ -132,7 +141,7 @@ minetest.register_tool("lottweapons:galvorn_battleaxe", { }) minetest.register_tool("lottweapons:mithril_battleaxe", { - description = "Mithril Battleaxe", + description = S("Mithril Battleaxe"), inventory_image = "lottweapons_mithril_battleaxe.png", tool_capabilities = { full_punch_interval = .25, @@ -147,7 +156,7 @@ minetest.register_tool("lottweapons:mithril_battleaxe", { --Warhammers: minetest.register_tool("lottweapons:wood_warhammer", { - description = "Training Warhammer", + description = S("Training Warhammer"), inventory_image = "lottweapons_wood_warhammer.png", range = 2, tool_capabilities = { @@ -161,7 +170,7 @@ minetest.register_tool("lottweapons:wood_warhammer", { }) minetest.register_tool("lottweapons:stone_warhammer", { - description = "Stone Warhammer", + description = S("Stone Warhammer"), inventory_image = "lottweapons_stone_warhammer.png", range = 2, tool_capabilities = { @@ -175,7 +184,7 @@ minetest.register_tool("lottweapons:stone_warhammer", { }) minetest.register_tool("lottweapons:copper_warhammer", { - description = "Copper Warhammer", + description = S("Copper Warhammer"), inventory_image = "lottweapons_copper_warhammer.png", range = 2, tool_capabilities = { @@ -189,7 +198,7 @@ minetest.register_tool("lottweapons:copper_warhammer", { }) minetest.register_tool("lottweapons:tin_warhammer", { - description = "Tin Warhammer", + description = S("Tin Warhammer"), inventory_image = "lottweapons_tin_warhammer.png", range = 2, tool_capabilities = { @@ -203,7 +212,7 @@ minetest.register_tool("lottweapons:tin_warhammer", { }) minetest.register_tool("lottweapons:steel_warhammer", { - description = "Steel Warhammer", + description = S("Steel Warhammer"), inventory_image = "lottweapons_steel_warhammer.png", range = 2, tool_capabilities = { @@ -217,7 +226,7 @@ minetest.register_tool("lottweapons:steel_warhammer", { }) minetest.register_tool("lottweapons:bronze_warhammer", { - description = "Bronze Warhammer", + description = S("Bronze Warhammer"), inventory_image = "lottweapons_bronze_warhammer.png", range = 2, tool_capabilities = { @@ -231,7 +240,7 @@ minetest.register_tool("lottweapons:bronze_warhammer", { }) minetest.register_tool("lottweapons:silver_warhammer", { - description = "Silver Warhammer", + description = S("Silver Warhammer"), inventory_image = "lottweapons_silver_warhammer.png", range = 2, tool_capabilities = { @@ -245,7 +254,7 @@ minetest.register_tool("lottweapons:silver_warhammer", { }) minetest.register_tool("lottweapons:gold_warhammer", { - description = "Gold Warhammer", + description = S("Gold Warhammer"), inventory_image = "lottweapons_gold_warhammer.png", tool_capabilities = { full_punch_interval = 0.75, @@ -258,7 +267,7 @@ minetest.register_tool("lottweapons:gold_warhammer", { }) minetest.register_tool("lottweapons:galvorn_warhammer", { - description = "Galvorn Warhammer", + description = S("Galvorn Warhammer"), inventory_image = "lottweapons_galvorn_warhammer.png", range = 2, groups = {forbidden=1}, @@ -273,7 +282,7 @@ minetest.register_tool("lottweapons:galvorn_warhammer", { }) minetest.register_tool("lottweapons:mithril_warhammer", { - description = "Mithril Warhammer", + description = S("Mithril Warhammer"), inventory_image = "lottweapons_mithril_warhammer.png", range = 2, tool_capabilities = { @@ -288,7 +297,7 @@ minetest.register_tool("lottweapons:mithril_warhammer", { --Spears: minetest.register_tool("lottweapons:wood_spear", { - description = "Training Spear", + description = S("Training Spear"), inventory_image = "lottweapons_wood_spear.png", wield_image = "lottweapons_wood_spear.png^[transformFX", range = 7, @@ -303,7 +312,7 @@ minetest.register_tool("lottweapons:wood_spear", { }) minetest.register_tool("lottweapons:stone_spear", { - description = "Stone Spear", + description = S("Stone Spear"), inventory_image = "lottweapons_stone_spear.png", wield_image = "lottweapons_stone_spear.png^[transformFX", range = 7, @@ -318,7 +327,7 @@ minetest.register_tool("lottweapons:stone_spear", { }) minetest.register_tool("lottweapons:copper_spear", { - description = "Copper Spear", + description = S("Copper Spear"), inventory_image = "lottweapons_copper_spear.png", wield_image = "lottweapons_copper_spear.png^[transformFX", range = 7, @@ -333,7 +342,7 @@ minetest.register_tool("lottweapons:copper_spear", { }) minetest.register_tool("lottweapons:tin_spear", { - description = "Tin Spear", + description = S("Tin Spear"), inventory_image = "lottweapons_tin_spear.png", wield_image = "lottweapons_tin_spear.png^[transformFX", range = 7, @@ -348,7 +357,7 @@ minetest.register_tool("lottweapons:tin_spear", { }) minetest.register_tool("lottweapons:steel_spear", { - description = "Steel Spear", + description = S("Steel Spear"), inventory_image = "lottweapons_steel_spear.png", wield_image = "lottweapons_steel_spear.png^[transformFX", range = 7, @@ -363,7 +372,7 @@ minetest.register_tool("lottweapons:steel_spear", { }) minetest.register_tool("lottweapons:bronze_spear", { - description = "Bronze Spear", + description = S("Bronze Spear"), inventory_image = "lottweapons_bronze_spear.png", wield_image = "lottweapons_bronze_spear.png^[transformFX", range = 7, @@ -378,7 +387,7 @@ minetest.register_tool("lottweapons:bronze_spear", { }) minetest.register_tool("lottweapons:silver_spear", { - description = "Silver Spear", + description = S("Silver Spear"), inventory_image = "lottweapons_silver_spear.png", wield_image = "lottweapons_silver_spear.png^[transformFX", range = 7, @@ -393,7 +402,7 @@ minetest.register_tool("lottweapons:silver_spear", { }) minetest.register_tool("lottweapons:gold_spear", { - description = "Gold Spear", + description = S("Gold Spear"), inventory_image = "lottweapons_gold_spear.png", wield_image = "lottweapons_gold_spear.png^[transformFX", range = 7, @@ -408,7 +417,7 @@ minetest.register_tool("lottweapons:gold_spear", { }) minetest.register_tool("lottweapons:galvorn_spear", { - description = "Galvorn Spear", + description = S("Galvorn Spear"), inventory_image = "lottweapons_galvorn_spear.png", wield_image = "lottweapons_galvorn_spear.png^[transformFX", range = 7, @@ -424,7 +433,7 @@ minetest.register_tool("lottweapons:galvorn_spear", { }) minetest.register_tool("lottweapons:mithril_spear", { - description = "Mithril Spear", + description = S("Mithril Spear"), inventory_image = "lottweapons_mithril_spear.png", wield_image = "lottweapons_mithril_spear.png^[transformFX", range = 7, @@ -440,7 +449,7 @@ minetest.register_tool("lottweapons:mithril_spear", { --Daggers: minetest.register_tool("lottweapons:wood_dagger", { - description = "Training Dagger", + description = S("Training Dagger"), inventory_image = "lottweapons_wood_dagger.png", range = 3, tool_capabilities = { @@ -454,7 +463,7 @@ minetest.register_tool("lottweapons:wood_dagger", { }) minetest.register_tool("lottweapons:stone_dagger", { - description = "Stone Dagger", + description = S("Stone Dagger"), inventory_image = "lottweapons_stone_dagger.png", range = 3, tool_capabilities = { @@ -468,7 +477,7 @@ minetest.register_tool("lottweapons:stone_dagger", { }) minetest.register_tool("lottweapons:copper_dagger", { - description = "Copper Dagger", + description = S("Copper Dagger"), inventory_image = "lottweapons_copper_dagger.png", range = 3, tool_capabilities = { @@ -482,7 +491,7 @@ minetest.register_tool("lottweapons:copper_dagger", { }) minetest.register_tool("lottweapons:tin_dagger", { - description = "Tin Dagger", + description = S("Tin Dagger"), inventory_image = "lottweapons_tin_dagger.png", range = 3, tool_capabilities = { @@ -496,7 +505,7 @@ minetest.register_tool("lottweapons:tin_dagger", { }) minetest.register_tool("lottweapons:steel_dagger", { - description = "Steel Dagger", + description = S("Steel Dagger"), inventory_image = "lottweapons_steel_dagger.png", range = 3, tool_capabilities = { @@ -510,7 +519,7 @@ minetest.register_tool("lottweapons:steel_dagger", { }) minetest.register_tool("lottweapons:bronze_dagger", { - description = "Bronze Dagger", + description = S("Bronze Dagger"), inventory_image = "lottweapons_bronze_dagger.png", range = 3, tool_capabilities = { @@ -524,7 +533,7 @@ minetest.register_tool("lottweapons:bronze_dagger", { }) minetest.register_tool("lottweapons:silver_dagger", { - description = "Silver Dagger", + description = S("Silver Dagger"), inventory_image = "lottweapons_silver_dagger.png", range = 3, tool_capabilities = { @@ -538,7 +547,7 @@ minetest.register_tool("lottweapons:silver_dagger", { }) minetest.register_tool("lottweapons:gold_dagger", { - description = "Gold Dagger", + description = S("Gold Dagger"), inventory_image = "lottweapons_gold_dagger.png", range = 3, tool_capabilities = { @@ -552,7 +561,7 @@ minetest.register_tool("lottweapons:gold_dagger", { }) minetest.register_tool("lottweapons:galvorn_dagger", { - description = "Galvorn Dagger", + description = S("Galvorn Dagger"), inventory_image = "lottweapons_galvorn_dagger.png", range = 3, groups = {forbidden=1}, @@ -567,7 +576,7 @@ minetest.register_tool("lottweapons:galvorn_dagger", { }) minetest.register_tool("lottweapons:mithril_dagger", { - description = "Mithril Dagger", + description = S("Mithril Dagger"), inventory_image = "lottweapons_mithril_dagger.png", range = 3, tool_capabilities = { diff --git a/mods/lottweapons/intllib.lua b/mods/lottweapons/intllib.lua new file mode 100644 index 00000000..6669d720 --- /dev/null +++ b/mods/lottweapons/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/mods/lottweapons/locale/de.txt b/mods/lottweapons/locale/de.txt new file mode 100644 index 00000000..1637e1a6 --- /dev/null +++ b/mods/lottweapons/locale/de.txt @@ -0,0 +1,45 @@ +### init.lua +Bronze Battleaxe = Bronzestreitaxt +Bronze Dagger = Bronzedolch +Bronze Spear = Bronzespeer +Bronze Warhammer = Bronzekriegshammer +Copper Battleaxe = Kupferstreitaxt +Copper Dagger = Kupferdolch +Copper Spear = Kupferspeer +Copper Warhammer = Kupferkriegshammer +Galvorn Battleaxe = Galvornstreitaxt +Galvorn Dagger = Galvorndolch +Galvorn Spear = Galvornspeer +Galvorn Warhammer = Galvornkriegshammer +Gold Battleaxe = Goldstreitaxt +Gold Dagger = Golddolch +Gold Spear = Goldspeer +Gold Warhammer = Goldkriegshammer +Mithril Battleaxe = Mithrilstreitaxt +Mithril Dagger = Mithrildolch +Mithril Spear = Mithrilspeer +Mithril Warhammer = Mithrilkriegshammer +Silver Battleaxe = Silberstreitaxt +Silver Dagger = Silberdolch +Silver Spear = Silberspeer +Silver Warhammer = Silberkriegshammer +Steel Battleaxe = Stahlstreitaxt +Steel Dagger = Stahldolch +Steel Spear = Stahlspeer +Steel Warhammer = Stahlkriegshammer +Stone Battleaxe = Steinstreitaxt +Stone Dagger = Steindolch +Stone Spear = Steinspeer +Stone Warhammer = Steinkriegshammer +Tin Battleaxe = Zinnstreitaxt +Tin Dagger = Zinndolch +Tin Spear = Zinnspeer +Tin Warhammer = Zinnkriegshammer +Training Battleaxe = Trainingsstreitaxt +Training Dagger = Trainingsdolch +Training Spear = Trainingsspeer +Training Warhammer = Trainingskriegshammer + +### special.lua +Elven Sword = Elfenschwert +Orcish Sword = Orkschwert diff --git a/mods/lottweapons/locale/template.txt b/mods/lottweapons/locale/template.txt new file mode 100644 index 00000000..5a80813c --- /dev/null +++ b/mods/lottweapons/locale/template.txt @@ -0,0 +1,45 @@ +### init.lua +Bronze Battleaxe = +Bronze Dagger = +Bronze Spear = +Bronze Warhammer = +Copper Battleaxe = +Copper Dagger = +Copper Spear = +Copper Warhammer = +Galvorn Battleaxe = +Galvorn Dagger = +Galvorn Spear = +Galvorn Warhammer = +Gold Battleaxe = +Gold Dagger = +Gold Spear = +Gold Warhammer = +Mithril Battleaxe = +Mithril Dagger = +Mithril Spear = +Mithril Warhammer = +Silver Battleaxe = +Silver Dagger = +Silver Spear = +Silver Warhammer = +Steel Battleaxe = +Steel Dagger = +Steel Spear = +Steel Warhammer = +Stone Battleaxe = +Stone Dagger = +Stone Spear = +Stone Warhammer = +Tin Battleaxe = +Tin Dagger = +Tin Spear = +Tin Warhammer = +Training Battleaxe = +Training Dagger = +Training Spear = +Training Warhammer = + +### special.lua +Elven Sword = +Orcish Sword = diff --git a/mods/lottweapons/mod.conf b/mods/lottweapons/mod.conf index baa899f6..92477298 100644 --- a/mods/lottweapons/mod.conf +++ b/mods/lottweapons/mod.conf @@ -1,3 +1,4 @@ name = lottweapons description = LOTT Game mod: lottweapons - Adds various tools and weaponry -depends = default, lottores, screwdriver \ No newline at end of file +depends = default, lottores, screwdriver +optional_depends = intllib diff --git a/mods/lottweapons/special.lua b/mods/lottweapons/special.lua index d645a92e..3330cbfd 100644 --- a/mods/lottweapons/special.lua +++ b/mods/lottweapons/special.lua @@ -1,5 +1,14 @@ +local MP = minetest.get_modpath( + minetest.get_current_modname( + ) +) + +local S, NS = dofile( + MP .. "/intllib.lua" +) + minetest.register_tool("lottweapons:elven_sword", { - description = "Elven Sword", + description = S("Elven Sword"), inventory_image = "lottweapons_elven_sword.png", tool_capabilities = { full_punch_interval = 0.25, @@ -12,7 +21,7 @@ minetest.register_tool("lottweapons:elven_sword", { }) minetest.register_tool("lottweapons:orc_sword", { - description = "Orcish Sword", + description = S("Orcish Sword"), inventory_image = "lottweapons_orc_sword.png", tool_capabilities = { full_punch_interval = 0.75, diff --git a/mods/mobs/mod.conf b/mods/mobs/mod.conf index 8a4039d2..976f5f79 100644 --- a/mods/mobs/mod.conf +++ b/mods/mobs/mod.conf @@ -1,3 +1,4 @@ name = mobs description = Modified mobs redo API - Used for lottmobs -depends = default, lottclasses \ No newline at end of file +depends = default, lottclasses +optional_depends = intllib