Add intllib support and German translation

This commit is contained in:
Wuzzy 2016-08-08 08:07:46 +02:00
parent 512dbfd1fa
commit c324e71984
4 changed files with 25 additions and 6 deletions

View File

@ -1,2 +1,3 @@
mana?
intllib?
doc_items?

View File

@ -1,3 +1,11 @@
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
returnmirror = {}
returnmirror.cost_teleport = 200
returnmirror.cost_set = 20
@ -53,7 +61,7 @@ returnmirror.set_position_active = function(itemstack, user, pointed_thing)
end
minetest.register_tool("returnmirror:mirror_inactive", {
description = "Mirror of Returning",
description = S("Mirror of Returning"),
inventory_image = "returnmirror_mirror_inactive.png",
wield_image = "returnmirror_mirror_inactive.png",
tool_capabilities = {},
@ -66,7 +74,7 @@ minetest.register_tool("returnmirror:mirror_inactive", {
})
minetest.register_tool("returnmirror:mirror_active", {
description = "Mirror of Returning",
description = S("Mirror of Returning"),
stack_max = 1,
inventory_image = "returnmirror_mirror_active.png",
wield_image = "returnmirror_mirror_active.png",
@ -124,12 +132,12 @@ minetest.register_alias("returnmirror:mirror_inactive", "returnmirror:returnmirr
if minetest.get_modpath("doc_items") ~= nil then
local longdesc, usagehelp
usagehelp = "Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location."
usagehelp = S("Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location.")
if minetest.get_modpath("mana") ~= nil then
longdesc ="This item allows to teleport the user back to a previously set location, at the cost of mana."
usagehelp = usagehelp .. " " .. string.format("Setting the teleport location costs %d mana, teleporting costs %d mana.", returnmirror.cost_set, returnmirror.cost_teleport)
longdesc = S("This item allows to teleport the user back to a previously set location, at the cost of mana.")
usagehelp = usagehelp .. " " .. string.format(S("Setting the teleport location costs %d mana, teleporting costs %d mana."), returnmirror.cost_set, returnmirror.cost_teleport)
else
longdesc = "This item allows to teleport its user back to a previously set location."
longdesc = S("This item allows to teleport its user back to a previously set location.")
end
doc.sub.items.set_items_longdesc({

5
locale/de.txt Normal file
View File

@ -0,0 +1,5 @@
Mirror of Returning = Spiegel der Rückkehr
Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location. = Rechtsklicken, um die Teleportationsposition des Spiegels zu setzen. Linksklicken, um eine sofortige Teleportation zur Teleportationsposition des Spiegels vorzunehmen.
Setting the teleport location costs %d mana, teleporting costs %d mana. = Das Setzen der Teleportationsposition kostet %d Mana. Das Teleportieren kostet %d Mana.
This item allows to teleport its user back to a previously set location. = Dieser Gegenstand ermöglicht es seinem Benutzer, sich zu einer zuvor gesetzen Position zurück zu teleportieren.
This item allows to teleport the user back to a previously set location, at the cost of mana. = Dieser Gegenstand ermöglicht es dem Benutzer, sich auf Kosten von Mana zu einer zuvor gesetzten Position zurück zu teleportieren.

5
locale/template.txt Normal file
View File

@ -0,0 +1,5 @@
Mirror of Returning =
Rightclick to set the mirror's teleport location. Leftclick to immediately teleport back to the mirror's teleport location. =
Setting the teleport location costs %d mana, teleporting costs %d mana. =
This item allows to teleport its user back to a previously set location. =
This item allows to teleport the user back to a previously set location, at the cost of mana. =