Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More translation API support / German translations #187

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
97ff696
add translations
Sep 17, 2018
cae8d37
add translations
Sep 18, 2018
09e5be9
add translations
Sep 18, 2018
b68c55d
need soft dependency for reliable intllib usage
Sep 19, 2018
ebcc42c
fix initial item giving
Sep 19, 2018
0c3a392
fix some translations
Sep 19, 2018
6c0a9c4
add missing translations
Sep 19, 2018
12cde08
add translations
Sep 24, 2018
8e0434d
add translations
Sep 24, 2018
4212e64
add translations
Sep 25, 2018
89df40d
add translations
Sep 25, 2018
7e85aec
add translations
Sep 26, 2018
31165f4
add translations
Sep 26, 2018
17ab07a
add translations
Sep 26, 2018
64ada44
add translations
Sep 27, 2018
5de2d52
add translations
Sep 27, 2018
c458a50
add translations
Sep 27, 2018
9f71169
add translations
Sep 28, 2018
f8bd5a6
add translations
Oct 1, 2018
91d5211
add translations
Oct 2, 2018
bcf734d
add translations
Oct 3, 2018
0c7b42a
add translations
Oct 3, 2018
3712251
add translations
Oct 3, 2018
7f2a45f
add translations
Oct 3, 2018
c2c616a
add translations
Oct 3, 2018
308e2ee
add translations
Oct 4, 2018
dd5a8ad
add translations
Oct 4, 2018
4da5ba4
add translations
Oct 5, 2018
41934fb
add translations
Oct 5, 2018
cab6731
add translations
Oct 5, 2018
3e514e0
add translations
Oct 5, 2018
38cb7f0
add translations
Oct 6, 2018
83a35d8
add translations
Oct 6, 2018
eb42526
add translations
Oct 6, 2018
bda4b8b
add translations
Oct 7, 2018
2cc4ba7
add translations
Oct 7, 2018
40ae3cf
add translations
Oct 11, 2018
93bcb8c
Merge branch 'master' into intllib
Oct 12, 2018
c1fd1a9
add translations
Oct 12, 2018
d78f638
add translations
Oct 12, 2018
1c740fa
add translations
Oct 13, 2018
e34d4d6
add translations
Oct 14, 2018
c70d6fe
add translations
Oct 14, 2018
cca4105
add translations
Oct 14, 2018
e821f2f
add translations
Oct 15, 2018
1bed244
add translations
Oct 27, 2018
e66e9dd
add translations
Oct 27, 2018
f4416af
replace deprecated function call
Dec 2, 2018
124a439
revert
Dec 3, 2018
df57d9e
upgrade intllib interface
Dec 31, 2018
931b9cb
Merge branch 'master' into intllib
Mar 25, 2020
b0fabce
Merge branch 'master' into intllib
Mar 27, 2023
3ee031a
initialize translation API
Mar 27, 2023
31c6a4b
add missing dependency declarations
Mar 27, 2023
8c5931c
add translations
Mar 27, 2023
70902af
add translations
Mar 27, 2023
874ec7b
add translations
Mar 27, 2023
a0a93b0
add translations
Mar 27, 2023
937b8cb
add translations
Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions mods/bones/init.lua
Original file line number Diff line number Diff line change
@@ -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;]"..
Expand All @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -302,7 +311,7 @@ minetest.register_craftitem("bones:bonedust", {
})

minetest.register_craftitem("bones:bone", {
description = "Bone",
description = S("Bone"),
inventory_image = "bones_bone.png",
})

Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
45 changes: 45 additions & 0 deletions mods/bones/intllib.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.

-- 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
8 changes: 8 additions & 0 deletions mods/bones/locale/de.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### init.lua
Bone = Knochen
Bone Dust = Knochenstaub
Bone Scythe = Knochensense
Gravestone = Grabstein
Skeleton = Skelett
Skeleton Head = Schädel

8 changes: 8 additions & 0 deletions mods/bones/locale/template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### init.lua
Bone =
Bone Dust =
Bone Scythe =
Gravestone =
Skeleton =
Skeleton Head =

3 changes: 2 additions & 1 deletion mods/bones/mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name = bones
description = Modified Minetest Game mod: bones - Add bones-related items and death mechanics
depends = default, lottfarming
depends = default, lottfarming
optional_depends = intllib
45 changes: 45 additions & 0 deletions mods/default/intllib.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.

-- 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
17 changes: 17 additions & 0 deletions mods/default/locale/de.txt
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions mods/default/locale/template.txt
Original file line number Diff line number Diff line change
@@ -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 =
3 changes: 2 additions & 1 deletion mods/default/mod.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
name = default
description = Modified Minetest Game mod: default - Modified to suit LOTT's needs, with outdated minetest_game code
description = Modified Minetest Game mod: default - Modified to suit LOTT's needs, with outdated minetest_game code
optional_depends = intllib
41 changes: 25 additions & 16 deletions mods/default/tools.lua
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Loading