summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-05 16:58:00 +0200
committerWuzzy <almikes@aol.com>2016-08-05 16:58:00 +0200
commit7e084c50d2fb71b07002e5061d3edb28597a6a28 (patch)
tree1eba0a6fcd02c43898e02abd518b4d98e9f5c6e1
parent5ea402b3f83313f8efb167dc28cc7e737ed2d9c0 (diff)
Add intllib support and German
-rw-r--r--depends.txt1
-rw-r--r--init.lua10
-rw-r--r--locale/de.txt1
-rw-r--r--locale/template.txt1
4 files changed, 12 insertions, 1 deletions
diff --git a/depends.txt b/depends.txt
index 03053ad..0367a67 100644
--- a/depends.txt
+++ b/depends.txt
@@ -1,4 +1,5 @@
hudbars
+intllib?
default?
flowers?
animalmaterials?
diff --git a/init.lua b/init.lua
index 46158ac..70efb75 100644
--- a/init.lua
+++ b/init.lua
@@ -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
+
if minetest.setting_getbool("enable_damage") then
hbhunger = {}
@@ -39,7 +47,7 @@ end
dofile(minetest.get_modpath("hbhunger").."/hunger.lua")
-- register satiation hudbar
-hb.register_hudbar("satiation", 0xFFFFFF, "Satiation", { icon = "hbhunger_icon.png", bgicon = "hbhunger_bgicon.png", bar = "hbhunger_bar.png" }, 20, 30, false)
+hb.register_hudbar("satiation", 0xFFFFFF, S("Satiation"), { icon = "hbhunger_icon.png", bgicon = "hbhunger_bgicon.png", bar = "hbhunger_bar.png" }, 20, 30, false)
-- update hud elemtens if value has changed
local function update_hud(player)
diff --git a/locale/de.txt b/locale/de.txt
new file mode 100644
index 0000000..3a06d93
--- /dev/null
+++ b/locale/de.txt
@@ -0,0 +1 @@
+Satiation = Sättigung
diff --git a/locale/template.txt b/locale/template.txt
new file mode 100644
index 0000000..37a578d
--- /dev/null
+++ b/locale/template.txt
@@ -0,0 +1 @@
+Satiation