Cleanup locales (#155)

* use localization function in formspecs

* remove unused translations

* remove F keyword from updatepo tool

* add tool readme
This commit is contained in:
Eugen Wesseloh 2018-07-26 21:05:50 +02:00 committed by stujones11
parent 838867a6bc
commit c96ba7ef34
10 changed files with 74 additions and 431 deletions

View File

@ -1,13 +1,3 @@
-- support for i18n
armor_i18n = { }
local MP = minetest.get_modpath(minetest.get_current_modname())
armor_i18n.gettext, armor_i18n.ngettext = dofile(MP.."/intllib.lua")
-- escaping formspec
armor_i18n.fgettext = function(...) return minetest.formspec_escape(armor_i18n.gettext(...)) end
-- local functions
local S = armor_i18n.gettext
local F = armor_i18n.fgettext
local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname)
local worldpath = minetest.get_worldpath()
@ -15,6 +5,14 @@ local last_punch_time = {}
local pending_players = {}
local timer = 0
-- support for i18n
armor_i18n = { }
armor_i18n.gettext, armor_i18n.ngettext = dofile(modpath.."/intllib.lua")
-- local functions
local S = armor_i18n.gettext
local F = minetest.formspec_escape
dofile(modpath.."/api.lua")
-- Legacy Config Support
@ -68,7 +66,7 @@ end
if minetest.get_modpath("technic") then
armor.formspec = armor.formspec..
"label[5,2.5;"..F("Radiation")..": armor_group_radiation]"
"label[5,2.5;"..F(S("Radiation"))..": armor_group_radiation]"
armor:register_armor_group("radiation")
end
local skin_mods = {"skins", "u_skins", "simple_skins", "wardrobe"}
@ -96,10 +94,10 @@ dofile(modpath.."/armor.lua")
-- Armor Initialization
armor.formspec = armor.formspec..
"label[5,1;"..F("Level")..": armor_level]"..
"label[5,1.5;"..F("Heal")..": armor_attr_heal]"
"label[5,1;"..F(S("Level"))..": armor_level]"..
"label[5,1.5;"..F(S("Heal"))..": armor_attr_heal]"
if armor.config.fire_protect then
armor.formspec = armor.formspec.."label[5,2;"..F("Fire")..": armor_attr_fire]"
armor.formspec = armor.formspec.."label[5,2;"..F(S("Fire"))..": armor_attr_fire]"
end
armor:register_on_destroy(function(player, index, stack)
local name = player:get_player_name()

View File

@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# French translation for 3D ARMOR MOD
# Copyright (C) 2018 by Stuart Jones
# This file is distributed under the same license as the 3D ARMOR MOD package.
# fat115 <fat115@framasoft.org>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-06 18:20+0200\n"
"PO-Revision-Date: 2017-08-06 18:20+0200\n"
"POT-Creation-Date: 2018-07-23 21:24+0200\n"
"PO-Revision-Date: 2018-07-23 21:30+0200\n"
"Last-Translator: fat115 <fat115@framasoft.org>\n"
"Language-Team: \n"
"Language: fr\n"
@ -18,22 +18,18 @@ msgstr ""
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr "3d_armor : Référence au joueur non trouvée @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player name is nil @1"
msgstr "3d_armor : Nom du joueur non trouvé @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player inventory is nil @1"
msgstr "3d_armor : Inventaire du joueur non trouvé @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Detached armor inventory is nil @1"
msgstr "3d_armor : Inventaire détaché pour l'armure non trouvé @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr "3d_armor : Référence au joueur non trouvée @1"
#: ../3d_armor/armor.lua
msgid "Admin Helmet"
msgstr "Casque d'admin"
@ -254,34 +250,6 @@ msgstr "Armure 3d"
msgid "Armor not initialized!"
msgstr "Armure non initialisée !"
#: ../hazmat_suit/init.lua
msgid "hazmat_suit: Mod loaded but unused."
msgstr "hazmat_suit : Mod chargé mais non utilisé."
#: ../hazmat_suit/init.lua
msgid "Hazmat Helmet"
msgstr "Casque 'Hazmat'"
#: ../hazmat_suit/init.lua
msgid "Hazmat Chestplate"
msgstr "Cuirasse 'Hazmat'"
#: ../hazmat_suit/init.lua
msgid "Hazmat Sleeve"
msgstr "Manches 'Hazmat'"
#: ../hazmat_suit/init.lua
msgid "Hazmat Leggins"
msgstr "Jambières 'Hazmat'"
#: ../hazmat_suit/init.lua
msgid "Hazmat Boots"
msgstr "Bottes 'Hazmat'"
#: ../hazmat_suit/init.lua
msgid "Hazmat Suit"
msgstr "Combinaison 'Hazmat'"
#: ../shields/init.lua
msgid "Admin Shield"
msgstr "Bouclier d'admin"
@ -325,60 +293,3 @@ msgstr "Bouclier en mithril"
#: ../shields/init.lua
msgid "Crystal Shield"
msgstr "Bouclier en cristal"
#: ../technic_armor/init.lua
msgid "technic_armor: Mod loaded but unused."
msgstr "technic_armor : Mod chargé mais non utilisé."
#: ../technic_armor/init.lua
msgid "Lead"
msgstr "plomb"
#: ../technic_armor/init.lua
msgid "Brass"
msgstr "laiton"
#: ../technic_armor/init.lua
msgid "Cast Iron"
msgstr "fonte"
#: ../technic_armor/init.lua
msgid "Carbon Steel"
msgstr "acier au carbone"
#: ../technic_armor/init.lua
msgid "Stainless Steel"
msgstr "acier inoxydable"
#: ../technic_armor/init.lua
msgid "Tin"
msgstr "étain"
#: ../technic_armor/init.lua
msgid "Silver"
msgstr "argent"
#: ../technic_armor/init.lua
msgid "Helmet"
msgstr "Casque"
#: ../technic_armor/init.lua
msgid "Chestplate"
msgstr "Cuirasse"
#: ../technic_armor/init.lua
msgid "Leggings"
msgstr "Jambières"
#: ../technic_armor/init.lua
msgid "Boots"
msgstr "Bottes"
#: ../technic_armor/init.lua
msgid "Shield"
msgstr "Bouclier"
#. Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string)
#: ../technic_armor/init.lua
msgid "@1 @2"
msgstr "@2 en @1"

View File

@ -1,14 +1,14 @@
# ITALIAN LOCALE FILE FOR THE 3D ARMOR MODULE
# Copyright (C) 2012-2017 Stuart Jones
# This file is distributed under the same license as the 3D ARMOR package.
# Italian translation for 3D ARMOR MOD
# Copyright (C) 2018 by Stuart Jones
# This file is distributed under the same license as the 3D ARMOR MOD package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Italian localization file for the 3D Armor module\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-06 18:20+0200\n"
"PO-Revision-Date: 2017-08-18 00:36+0100\n"
"POT-Creation-Date: 2018-07-23 21:24+0200\n"
"PO-Revision-Date: 2018-07-23 21:30+0200\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: ITALIANO\n"
"Language: it\n"
@ -18,22 +18,18 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.10\n"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr "3d_armor: Il riferimento alla/al giocatrice/tore è nullo @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player name is nil @1"
msgstr "3d_armor: Il nome della/del gicatrice/tore è nullo @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player inventory is nil @1"
msgstr "3d_armor: L'inventario della/del giocatrice/tore è nullo @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Detached armor inventory is nil @1"
msgstr "3d_armor: L'inventario staccato dell'armatura è nullo @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr "3d_armor: Il riferimento alla/al giocatrice/tore è nullo @1"
#: ../3d_armor/armor.lua
msgid "Admin Helmet"
msgstr "Elmo dell'amministratrice/tore"
@ -254,34 +250,6 @@ msgstr "Armatura 3D"
msgid "Armor not initialized!"
msgstr "Armatura non inizializzata!"
#: ../hazmat_suit/init.lua
msgid "hazmat_suit: Mod loaded but unused."
msgstr "hazmat_suit: Mod caricato ma inutilizzato."
#: ../hazmat_suit/init.lua
msgid "Hazmat Helmet"
msgstr "Elmo hazmat"
#: ../hazmat_suit/init.lua
msgid "Hazmat Chestplate"
msgstr "Corazza hazmat"
#: ../hazmat_suit/init.lua
msgid "Hazmat Sleeve"
msgstr "Manica hazmat"
#: ../hazmat_suit/init.lua
msgid "Hazmat Leggins"
msgstr "Gambali hazmat"
#: ../hazmat_suit/init.lua
msgid "Hazmat Boots"
msgstr "Stivali hazmat"
#: ../hazmat_suit/init.lua
msgid "Hazmat Suit"
msgstr "Completo hazmat"
#: ../shields/init.lua
msgid "Admin Shield"
msgstr "Scudo dell'amministratrice/tore"
@ -325,60 +293,3 @@ msgstr "Scudo di mithril"
#: ../shields/init.lua
msgid "Crystal Shield"
msgstr "Scudo di cristallo"
#: ../technic_armor/init.lua
msgid "technic_armor: Mod loaded but unused."
msgstr "technic_armor: Mod caricato ma inutilizzato."
#: ../technic_armor/init.lua
msgid "Lead"
msgstr "Piombo"
#: ../technic_armor/init.lua
msgid "Brass"
msgstr "Ottone"
#: ../technic_armor/init.lua
msgid "Cast Iron"
msgstr "Ghisa"
#: ../technic_armor/init.lua
msgid "Carbon Steel"
msgstr "Acciaio al carbonio"
#: ../technic_armor/init.lua
msgid "Stainless Steel"
msgstr "Acciaio inossidabile"
#: ../technic_armor/init.lua
msgid "Tin"
msgstr "Stagno"
#: ../technic_armor/init.lua
msgid "Silver"
msgstr "Argento"
#: ../technic_armor/init.lua
msgid "Helmet"
msgstr "Elmo"
#: ../technic_armor/init.lua
msgid "Chestplate"
msgstr "Corazza"
#: ../technic_armor/init.lua
msgid "Leggings"
msgstr "Gambali"
#: ../technic_armor/init.lua
msgid "Boots"
msgstr "Stivali"
#: ../technic_armor/init.lua
msgid "Shield"
msgstr "Scudo"
#. Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string)
#: ../technic_armor/init.lua
msgid "@1 @2"
msgstr "@2 di @1"

View File

@ -1,39 +1,35 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# Malay translation for 3D ARMOR MOD
# Copyright (C) 2018 by Stuart Jones
# This file is distributed under the same license as the 3D ARMOR MOD package.
# MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-06 18:20+0200\n"
"PO-Revision-Date: 2018-02-07 13:25+0800\n"
"POT-Creation-Date: 2018-07-23 21:21+0200\n"
"PO-Revision-Date: 2018-07-23 21:30+0200\n"
"Last-Translator: MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>\n"
"Language-Team: \n"
"Language: ms\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"
"Last-Translator: MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ms\n"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr "3d_armor: Rujukan pemain tiada nilai @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player name is nil @1"
msgstr "3d_armor: Nama pemain tiada nilai @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player inventory is nil @1"
msgstr "3d_armor: Inventori pemain tiada nilai @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Detached armor inventory is nil @1"
msgstr "3d_armor: Inventori perisai terpisah tiada nilai @1"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr "3d_armor: Rujukan pemain tiada nilai @1"
#: ../3d_armor/armor.lua
msgid "Admin Helmet"
msgstr "Helmet Pentadbir"
@ -255,34 +251,6 @@ msgstr "Perisai 3d"
msgid "Armor not initialized!"
msgstr "Perisai tidak diasalkan!"
#: ../hazmat_suit/init.lua
msgid "hazmat_suit: Mod loaded but unused."
msgstr "hazmat_suit: Mods dimuatkan tetapi tidak digunakan."
#: ../hazmat_suit/init.lua
msgid "Hazmat Helmet"
msgstr "Helmet Keselamatan"
#: ../hazmat_suit/init.lua
msgid "Hazmat Chestplate"
msgstr "Perisai Dada Keselamatan"
#: ../hazmat_suit/init.lua
msgid "Hazmat Sleeve"
msgstr "Perisai Tangan Keselamatan"
#: ../hazmat_suit/init.lua
msgid "Hazmat Leggins"
msgstr "Perisai Kaki Keselamatan"
#: ../hazmat_suit/init.lua
msgid "Hazmat Boots"
msgstr "But Keselamatan"
#: ../hazmat_suit/init.lua
msgid "Hazmat Suit"
msgstr "Pakaian Keselamatan"
#: ../shields/init.lua
msgid "Admin Shield"
msgstr "Perisai Pegang Pentadbir"
@ -326,61 +294,3 @@ msgstr "Perisai Pegang Mithril"
#: ../shields/init.lua
msgid "Crystal Shield"
msgstr "Perisai Pegang Kristal"
#: ../technic_armor/init.lua
msgid "technic_armor: Mod loaded but unused."
msgstr "technic_armor: Mods dimuatkan tetapi tidak digunakan."
# 'Lead' here is the chemical compound so the translation is 'plumbum', not 'pimpin' (act of leading).
#: ../technic_armor/init.lua
msgid "Lead"
msgstr "Plumbum"
#: ../technic_armor/init.lua
msgid "Brass"
msgstr "Loyang"
#: ../technic_armor/init.lua
msgid "Cast Iron"
msgstr "Besi Tuang"
#: ../technic_armor/init.lua
msgid "Carbon Steel"
msgstr "Keluli Karbon"
#: ../technic_armor/init.lua
msgid "Stainless Steel"
msgstr "Keluli Tahan Karat"
#: ../technic_armor/init.lua
msgid "Tin"
msgstr "Timah"
#: ../technic_armor/init.lua
msgid "Silver"
msgstr "Perak"
#: ../technic_armor/init.lua
msgid "Helmet"
msgstr "Helmet"
#: ../technic_armor/init.lua
msgid "Chestplate"
msgstr "Perisai Dada"
#: ../technic_armor/init.lua
msgid "Leggings"
msgstr "Perisai Kaki"
#: ../technic_armor/init.lua
msgid "Boots"
msgstr "But"
#: ../technic_armor/init.lua
msgid "Shield"
msgstr "Perisai Pegang"
#. Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string)
#: ../technic_armor/init.lua
msgid "@1 @2"
msgstr "@2 @1"

View File

@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: 3d_armor\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-22 18:48+0200\n"
"PO-Revision-Date: \n"
"POT-Creation-Date: 2018-07-23 21:21+0200\n"
"PO-Revision-Date: 2018-07-23 21:30+0200\n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: ru\n"
@ -173,19 +173,19 @@ msgstr "кристалловые гамаши"
msgid "Crystal Boots"
msgstr "кристалловые ботинки"
#: ../3d_armor_ui/init.lua
#: ../3d_armor/init.lua ../3d_armor_ui/init.lua
msgid "Radiation"
msgstr "излучение"
#: ../3d_armor_ui/init.lua
#: ../3d_armor/init.lua ../3d_armor_ui/init.lua
msgid "Level"
msgstr "уровень"
#: ../3d_armor_ui/init.lua
#: ../3d_armor/init.lua ../3d_armor_ui/init.lua
msgid "Heal"
msgstr "исцеление"
#: ../3d_armor_ui/init.lua
#: ../3d_armor/init.lua ../3d_armor_ui/init.lua
msgid "Fire"
msgstr "огонь"
@ -209,7 +209,7 @@ msgstr "3d_armor_ip: мод загружен но не используется.
msgid "Back"
msgstr "назад"
#: ../3d_armor_ui/init.lua
#: ../3d_armor_ip/init.lua ../3d_armor_sfinv/init.lua ../3d_armor_ui/init.lua
msgid "Armor"
msgstr "бронь"
@ -249,10 +249,6 @@ msgstr "3D бронь"
msgid "Armor not initialized!"
msgstr "бронь не подготовлена!"
#: ../hazmat_suit/init.lua
msgid "hazmat_suit: Mod loaded but unused."
msgstr "hazmat_suit: мод загружен но не используется."
#: ../shields/init.lua
msgid "Admin Shield"
msgstr "щит админа"

View File

@ -1,6 +1,6 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# LANGUAGE translation for 3D ARMOR MOD
# Copyright (C) 2018 by Stuart Jones
# This file is distributed under the same license as the 3D ARMOR MOD package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-06 18:20+0200\n"
"POT-Creation-Date: 2018-07-23 21:24+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,22 +17,18 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr ""
#: ../3d_armor/api.lua
msgid "3d_armor: Player name is nil @1"
msgstr ""
#: ../3d_armor/api.lua
msgid "3d_armor: Player inventory is nil @1"
msgstr ""
#: ../3d_armor/api.lua
msgid "3d_armor: Detached armor inventory is nil @1"
msgstr ""
#: ../3d_armor/api.lua
msgid "3d_armor: Player reference is nil @1"
msgstr ""
#: ../3d_armor/armor.lua
msgid "Admin Helmet"
msgstr ""
@ -253,34 +249,6 @@ msgstr ""
msgid "Armor not initialized!"
msgstr ""
#: ../hazmat_suit/init.lua
msgid "hazmat_suit: Mod loaded but unused."
msgstr ""
#: ../hazmat_suit/init.lua
msgid "Hazmat Helmet"
msgstr ""
#: ../hazmat_suit/init.lua
msgid "Hazmat Chestplate"
msgstr ""
#: ../hazmat_suit/init.lua
msgid "Hazmat Sleeve"
msgstr ""
#: ../hazmat_suit/init.lua
msgid "Hazmat Leggins"
msgstr ""
#: ../hazmat_suit/init.lua
msgid "Hazmat Boots"
msgstr ""
#: ../hazmat_suit/init.lua
msgid "Hazmat Suit"
msgstr ""
#: ../shields/init.lua
msgid "Admin Shield"
msgstr ""
@ -324,60 +292,3 @@ msgstr ""
#: ../shields/init.lua
msgid "Crystal Shield"
msgstr ""
#: ../technic_armor/init.lua
msgid "technic_armor: Mod loaded but unused."
msgstr ""
#: ../technic_armor/init.lua
msgid "Lead"
msgstr ""
#: ../technic_armor/init.lua
msgid "Brass"
msgstr ""
#: ../technic_armor/init.lua
msgid "Cast Iron"
msgstr ""
#: ../technic_armor/init.lua
msgid "Carbon Steel"
msgstr ""
#: ../technic_armor/init.lua
msgid "Stainless Steel"
msgstr ""
#: ../technic_armor/init.lua
msgid "Tin"
msgstr ""
#: ../technic_armor/init.lua
msgid "Silver"
msgstr ""
#: ../technic_armor/init.lua
msgid "Helmet"
msgstr ""
#: ../technic_armor/init.lua
msgid "Chestplate"
msgstr ""
#: ../technic_armor/init.lua
msgid "Leggings"
msgstr ""
#: ../technic_armor/init.lua
msgid "Boots"
msgstr ""
#: ../technic_armor/init.lua
msgid "Shield"
msgstr ""
#. Translators: @1 stands for material and @2 for part of the armor, so that you could use a conjunction if in your language part name comes first then material (e.g. in french 'Silver Boots' is translated in 'Bottes en argent' by using '@2 en @1' as translated string)
#: ../technic_armor/init.lua
msgid "@1 @2"
msgstr ""

7
3d_armor/tools/README.md Normal file
View File

@ -0,0 +1,7 @@
# Intllib tool
please consider using the intllib tool to update locale files:
```../../intllib/tools/xgettext.sh ../**/*.lua```
make sure you are in `3d_armor` derectory before running this command

View File

@ -12,7 +12,6 @@ xgettext --from-code=UTF-8 \
--keyword=S \
--keyword=NS:1,2 \
--keyword=N_ \
--keyword=F \
--add-comments='Translators:' \
--add-location=file \
-o locale/template.pot \

View File

@ -1,13 +1,13 @@
-- support for i18n
local S = armor_i18n.gettext
local F = armor_i18n.fgettext
local F = minetest.formspec_escape
if not minetest.global_exists("inventory_plus") then
minetest.log("warning", S("3d_armor_ip: Mod loaded but unused."))
return
end
armor.formspec = "size[8,8.5]button[6,0;2,0.5;main;"..F("Back").."]"..armor.formspec
armor.formspec = "size[8,8.5]button[6,0;2,0.5;main;"..F(S("Back")).."]"..armor.formspec
armor:register_on_update(function(player)
local name = player:get_player_name()
local formspec = armor:get_armor_formspec(name, true)

View File

@ -1,6 +1,6 @@
-- support for i18n
local S = armor_i18n.gettext
local F = armor_i18n.fgettext
local F = minetest.formspec_escape
local has_technic = minetest.get_modpath("technic") ~= nil
if not minetest.global_exists("unified_inventory") then
@ -30,23 +30,23 @@ unified_inventory.register_page("armor", {
local fy = perplayer_formspec.formspec_y
local name = player:get_player_name()
if armor.def[name].init_time == 0 then
return {formspec="label[0,0;"..F("Armor not initialized!").."]"}
return {formspec="label[0,0;"..F(S("Armor not initialized!")).."]"}
end
local formspec = "background[0.06,"..fy..";7.92,7.52;3d_armor_ui_form.png]"..
"label[0,0;"..F("Armor").."]"..
"label[0,0;"..F(S("Armor")).."]"..
"list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]"..
"image[2.5,"..(fy - 0.25)..";2,4;"..armor:get_preview(name).."]"..
"label[5.0,"..(fy + 0.0)..";"..F("Level")..": "..armor.def[name].level.."]"..
"label[5.0,"..(fy + 0.5)..";"..F("Heal")..": "..armor.def[name].heal.."]"..
"label[5.0,"..(fy + 0.0)..";"..F(S("Level"))..": "..armor.def[name].level.."]"..
"label[5.0,"..(fy + 0.5)..";"..F(S("Heal"))..": "..armor.def[name].heal.."]"..
"listring[current_player;main]"..
"listring[detached:"..name.."_armor;armor]"
if armor.config.fire_protect then
formspec = formspec.."label[5.0,"..(fy + 1.0)..";"..
F("Fire")..": "..armor.def[name].fire.."]"
F(S("Fire"))..": "..armor.def[name].fire.."]"
end
if has_technic then
formspec = formspec.."label[5.0,"..(fy + 1.5)..";"..
F("Radiation")..": "..armor.def[name].groups["radiation"].."]"
F(S("Radiation"))..": "..armor.def[name].groups["radiation"].."]"
end
return {formspec=formspec}
end,