From 79e93433314dfbc9af46bb2a6ab37b38122f3998 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 30 Mar 2019 14:00:31 +0100 Subject: [PATCH] Update to 5.0.0 translation system --- init.lua | 9 ++------- locale/de.txt | 2 -- locale/hbarmor.de.tr | 3 +++ locale/hbarmor.it.tr | 3 +++ locale/it.txt | 4 ---- locale/template.txt | 5 +++-- mod.conf | 1 - 7 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 locale/de.txt create mode 100644 locale/hbarmor.de.tr create mode 100644 locale/hbarmor.it.tr delete mode 100644 locale/it.txt diff --git a/init.lua b/init.lua index 21193f9..dd3699e 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,4 @@ -local S -if (minetest.get_modpath("intllib")) then - S = intllib.Getter() -else - S = function ( s ) return s end -end +local S = minetest.get_translator("hbarmor") if (not armor) or (not armor.def) then minetest.log("error", "[hbarmor] Outdated 3d_armor version. Please update your version of 3d_armor!") @@ -65,7 +60,7 @@ local function custom_hud(player) end --register and define armor HUD bar -hb.register_hudbar("armor", 0xFFFFFF, S("Armor"), { icon = "hbarmor_icon.png", bgicon = "hbarmor_bgicon.png", bar = "hbarmor_bar.png" }, 0, 100, hbarmor.autohide, S("%s: %d%%")) +hb.register_hudbar("armor", 0xFFFFFF, S("Armor"), { icon = "hbarmor_icon.png", bgicon = "hbarmor_bgicon.png", bar = "hbarmor_bar.png" }, 0, 100, hbarmor.autohide, S("@1: @2%")) function hbarmor.get_armor(player) if not player or not armor.def then diff --git a/locale/de.txt b/locale/de.txt deleted file mode 100644 index 5a6bacd..0000000 --- a/locale/de.txt +++ /dev/null @@ -1,2 +0,0 @@ -Armor = Panzerung -%s: %d%% = %s: %d%% diff --git a/locale/hbarmor.de.tr b/locale/hbarmor.de.tr new file mode 100644 index 0000000..1649802 --- /dev/null +++ b/locale/hbarmor.de.tr @@ -0,0 +1,3 @@ +# textdomain:hbarmor +Armor=Panzerung +@1: @2%=@1: @2% diff --git a/locale/hbarmor.it.tr b/locale/hbarmor.it.tr new file mode 100644 index 0000000..54601d5 --- /dev/null +++ b/locale/hbarmor.it.tr @@ -0,0 +1,3 @@ +# textdomain:hbarmor +Armor=Armatura +@1: @2%=@1:@2% diff --git a/locale/it.txt b/locale/it.txt deleted file mode 100644 index a2f704b..0000000 --- a/locale/it.txt +++ /dev/null @@ -1,4 +0,0 @@ -Armor = Armatura - -# Format string for displaying the armor. E.g. "Armor: 100%" -%s: %d%% = diff --git a/locale/template.txt b/locale/template.txt index d898abe..0f22286 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -1,4 +1,5 @@ -Armor = +# textdomain:hbarmor +Armor= # Format string for displaying the armor. E.g. "Armor: 100%" -%s: %d%% = +@1: @2%= diff --git a/mod.conf b/mod.conf index daa20c6..820500e 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,3 @@ name = hbarmor description = Adds a HUD bar displaying the current damage of the player's armor. depends = hudbars, 3d_armor -optional_depends = intllib