diff options
author | Wuzzy <almikes@aol.com> | 2016-08-05 16:54:52 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-05 16:54:52 +0200 |
commit | 1786ae2cab4ab0e361911fa0dcafa85d12c4e982 (patch) | |
tree | ec9245f68cf46092de656ff2f4b20cadfe69334f | |
parent | f06e3c362f44a2338785098bb95b4e718a86c375 (diff) |
Add intllib support
-rw-r--r-- | depends.txt | 1 | ||||
-rw-r--r-- | init.lua | 12 | ||||
-rw-r--r-- | locale/de.txt | 2 | ||||
-rw-r--r-- | locale/template.txt | 2 |
4 files changed, 15 insertions, 2 deletions
diff --git a/depends.txt b/depends.txt index e69de29..77e8d97 100644 --- a/depends.txt +++ b/depends.txt @@ -0,0 +1 @@ +intllib? @@ -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 + hb = {} hb.hudtables = {} @@ -425,8 +433,8 @@ end --register built-in HUD bars if minetest.setting_getbool("enable_damage") or hb.settings.forceload_default_hudbars then - hb.register_hudbar("health", 0xFFFFFF, "Health", { bar = "hudbars_bar_health.png", icon = "hudbars_icon_health.png", bgicon = "hudbars_bgicon_health.png" }, 20, 20, false) - hb.register_hudbar("breath", 0xFFFFFF, "Breath", { bar = "hudbars_bar_breath.png", icon = "hudbars_icon_breath.png" }, 10, 10, true) + hb.register_hudbar("health", 0xFFFFFF, S("Health"), { bar = "hudbars_bar_health.png", icon = "hudbars_icon_health.png", bgicon = "hudbars_bgicon_health.png" }, 20, 20, false) + hb.register_hudbar("breath", 0xFFFFFF, S("Breath"), { bar = "hudbars_bar_breath.png", icon = "hudbars_icon_breath.png" }, 10, 10, true) end local function hide_builtin(player) diff --git a/locale/de.txt b/locale/de.txt new file mode 100644 index 0000000..08b8355 --- /dev/null +++ b/locale/de.txt @@ -0,0 +1,2 @@ +Health = Leben +Breath = Atem diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..c8aff8c --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,2 @@ +Health +Breath |