forked from mtcontrib/minetest_mana
Add intllib support
This commit is contained in:
parent
f2e6e6e8ad
commit
7b0ef7204b
@ -1 +1,2 @@
|
|||||||
hudbars?
|
hudbars?
|
||||||
|
intllib?
|
||||||
|
12
init.lua
12
init.lua
@ -9,6 +9,14 @@ License: WTFPL
|
|||||||
Initialization
|
Initialization
|
||||||
]===]
|
]===]
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
mana = {}
|
mana = {}
|
||||||
mana.playerlist = {}
|
mana.playerlist = {}
|
||||||
|
|
||||||
@ -269,7 +277,7 @@ end)
|
|||||||
]===]
|
]===]
|
||||||
|
|
||||||
if minetest.get_modpath("hudbars") ~= nil then
|
if minetest.get_modpath("hudbars") ~= nil then
|
||||||
hb.register_hudbar("mana", 0xFFFFFF, "Mana", { bar = "mana_bar.png", icon = "mana_icon.png", bgicon = "mana_bgicon.png" }, 0, mana.settings.default_max, false)
|
hb.register_hudbar("mana", 0xFFFFFF, S("Mana"), { bar = "mana_bar.png", icon = "mana_icon.png", bgicon = "mana_bgicon.png" }, 0, mana.settings.default_max, false)
|
||||||
|
|
||||||
function mana.hud_update(playername)
|
function mana.hud_update(playername)
|
||||||
local player = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
@ -283,7 +291,7 @@ if minetest.get_modpath("hudbars") ~= nil then
|
|||||||
|
|
||||||
else
|
else
|
||||||
function mana.manastring(playername)
|
function mana.manastring(playername)
|
||||||
return string.format("Mana: %d/%d", mana.get(playername), mana.getmax(playername))
|
return string.format(S("Mana: %d/%d"), mana.get(playername), mana.getmax(playername))
|
||||||
end
|
end
|
||||||
|
|
||||||
function mana.hud_add(playername)
|
function mana.hud_add(playername)
|
||||||
|
2
locale/de.txt
Normal file
2
locale/de.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Mana = Mana
|
||||||
|
Mana: %d/%d = Mana: %d/%d
|
2
locale/template.txt
Normal file
2
locale/template.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Mana
|
||||||
|
Mana: %d/%d
|
Loading…
Reference in New Issue
Block a user