From 41da25f217b6556ff555ed4ed495363214f2b295 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 12:52:20 +0200 Subject: [PATCH 01/15] replace ABMs --- ontime_clocks/nodes.lua | 75 ++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua index 107d2e9..0f279b2 100644 --- a/ontime_clocks/nodes.lua +++ b/ontime_clocks/nodes.lua @@ -20,6 +20,17 @@ local S = ontime_clocks.intllib +local function clock_on_construct(pos) + local timer = minetest.get_node_timer(pos) + timer:start(5) + display_api.on_construct(pos) +end + +local function clock_on_timer(pos) + display_api.update_entities(pos) + return true +end + -- Green digital clock minetest.register_node("ontime_clocks:green_digital", { description = S("Green digital clock"), @@ -46,17 +57,12 @@ minetest.register_node("ontime_clocks:green_digital", { end }, }, on_place = display_api.on_place, - on_construct = display_api.on_construct, + on_construct = clock_on_construct, on_destruct = display_api.on_destruct, on_rotate = display_api.on_rotate, + on_timer = clock_on_timer, }) -minetest.register_abm({ - nodenames = {"ontime_clocks:green_digital"}, - interval = 5, - chance = 1, - action = display_api.update_entities, -}) -- Red digital clock minetest.register_node("ontime_clocks:red_digital", { @@ -84,16 +90,10 @@ minetest.register_node("ontime_clocks:red_digital", { end }, }, on_place = display_api.on_place, - on_construct = display_api.on_construct, + on_construct = clock_on_construct, on_destruct = display_api.on_destruct, on_rotate = display_api.on_rotate, -}) - -minetest.register_abm({ - nodenames = {"ontime_clocks:red_digital"}, - interval = 5, - chance = 1, - action = display_api.update_entities, + on_timer = clock_on_timer, }) @@ -122,17 +122,12 @@ minetest.register_node("ontime_clocks:white", { end }, }, on_place = display_api.on_place, - on_construct = display_api.on_construct, + on_construct = clock_on_construct, on_destruct = display_api.on_destruct, on_rotate = display_api.on_rotate, + on_timer = clock_on_timer, }) -minetest.register_abm({ - nodenames = {"ontime_clocks:white"}, - interval = 5, - chance = 1, - action = display_api.update_entities, -}) minetest.register_node("ontime_clocks:frameless_black", { description = S("Frameless clock"), @@ -159,17 +154,12 @@ minetest.register_node("ontime_clocks:frameless_black", { end }, }, on_place = display_api.on_place, - on_construct = display_api.on_construct, + on_construct = clock_on_construct, on_destruct = display_api.on_destruct, on_rotate = display_api.on_rotate, + on_timer = clock_on_timer, }) -minetest.register_abm({ - nodenames = {"ontime_clocks:frameless_black"}, - interval = 5, - chance = 1, - action = display_api.update_entities, -}) minetest.register_node("ontime_clocks:frameless_gold", { description = S("Frameless gold clock"), @@ -196,17 +186,12 @@ minetest.register_node("ontime_clocks:frameless_gold", { end }, }, on_place = display_api.on_place, - on_construct = display_api.on_construct, + on_construct = clock_on_construct, on_destruct = display_api.on_destruct, on_rotate = display_api.on_rotate, + on_timer = clock_on_timer, }) -minetest.register_abm({ - nodenames = {"ontime_clocks:frameless_gold"}, - interval = 5, - chance = 1, - action = display_api.update_entities, -}) minetest.register_node("ontime_clocks:frameless_white", { description = S("Frameless white clock"), @@ -233,14 +218,20 @@ minetest.register_node("ontime_clocks:frameless_white", { end }, }, on_place = display_api.on_place, - on_construct = display_api.on_construct, + on_construct = clock_on_construct, on_destruct = display_api.on_destruct, on_rotate = display_api.on_rotate, + on_timer = clock_on_timer, }) -minetest.register_abm({ - nodenames = {"ontime_clocks:frameless_white"}, - interval = 5, - chance = 1, - action = display_api.update_entities, + +minetest.register_lbm({ + name = "ontime_clocks:nodetimer_init", + nodenames = {"ontime_clocks:green_digital", "ontime_clocks:red_digital", "ontime_clocks:white", + "ontime_clocks:frameless_black", "ontime_clocks:frameless_gold", "ontime_clocks:frameless_white"}, + run_at_every_load = true, + action = function(pos) + local timer = minetest.get_node_timer(pos) + timer:start(5) + end }) From 49143feccbe5ac80efd208967b910b8ec3c6195e Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 12:58:29 +0200 Subject: [PATCH 02/15] use mt 5 translations --- boards/locale/boards.fr.tr | 3 ++ boards/locale/boards.ms.tr | 3 ++ boards/locale/fr.po | 40 ----------------- boards/locale/ms.po | 35 --------------- boards/locale/template.pot | 34 -------------- boards/locale/template.txt | 3 ++ ontime_clocks/locale/fr.po | 43 ------------------ ontime_clocks/locale/ms.po | 42 ------------------ ontime_clocks/locale/ontime_clocks.fr.tr | 7 +++ ontime_clocks/locale/ontime_clocks.ms.tr | 7 +++ ontime_clocks/locale/template.pot | 42 ------------------ ontime_clocks/locale/template.txt | 7 +++ signs/locale/fr.po | 54 ----------------------- signs/locale/ms.po | 51 --------------------- signs/locale/signs.fr.tr | 8 ++++ signs/locale/signs.ms.tr | 8 ++++ signs/locale/template.pot | 51 --------------------- signs/locale/template.txt | 8 ++++ signs_api/locale/fr.po | 49 --------------------- signs_api/locale/ms.po | 46 ------------------- signs_api/locale/signs_api.fr.tr | 10 +++++ signs_api/locale/signs_api.ms.tr | 9 ++++ signs_api/locale/template.pot | 31 ------------- signs_road/locale/fr.po | 56 ------------------------ signs_road/locale/ms.po | 54 ----------------------- signs_road/locale/signs_road.fr.tr | 15 +++++++ signs_road/locale/signs_road.ms.tr | 15 +++++++ signs_road/locale/template.pot | 54 ----------------------- signs_road/locale/template.txt | 15 +++++++ steles/locale/fr.po | 47 -------------------- steles/locale/ms.po | 46 ------------------- steles/locale/steles.fr.tr | 6 +++ steles/locale/steles.ms.tr | 6 +++ steles/locale/template.pot | 46 ------------------- steles/locale/template.txt | 6 +++ 35 files changed, 136 insertions(+), 821 deletions(-) create mode 100644 boards/locale/boards.fr.tr create mode 100644 boards/locale/boards.ms.tr delete mode 100644 boards/locale/fr.po delete mode 100644 boards/locale/ms.po delete mode 100644 boards/locale/template.pot create mode 100644 boards/locale/template.txt delete mode 100644 ontime_clocks/locale/fr.po delete mode 100644 ontime_clocks/locale/ms.po create mode 100644 ontime_clocks/locale/ontime_clocks.fr.tr create mode 100644 ontime_clocks/locale/ontime_clocks.ms.tr delete mode 100644 ontime_clocks/locale/template.pot create mode 100644 ontime_clocks/locale/template.txt delete mode 100644 signs/locale/fr.po delete mode 100644 signs/locale/ms.po create mode 100644 signs/locale/signs.fr.tr create mode 100644 signs/locale/signs.ms.tr delete mode 100644 signs/locale/template.pot create mode 100644 signs/locale/template.txt delete mode 100644 signs_api/locale/fr.po delete mode 100644 signs_api/locale/ms.po create mode 100644 signs_api/locale/signs_api.fr.tr create mode 100644 signs_api/locale/signs_api.ms.tr delete mode 100644 signs_api/locale/template.pot delete mode 100644 signs_road/locale/fr.po delete mode 100644 signs_road/locale/ms.po create mode 100644 signs_road/locale/signs_road.fr.tr create mode 100644 signs_road/locale/signs_road.ms.tr delete mode 100644 signs_road/locale/template.pot create mode 100644 signs_road/locale/template.txt delete mode 100644 steles/locale/fr.po delete mode 100644 steles/locale/ms.po create mode 100644 steles/locale/steles.fr.tr create mode 100644 steles/locale/steles.ms.tr delete mode 100644 steles/locale/template.pot create mode 100644 steles/locale/template.txt diff --git a/boards/locale/boards.fr.tr b/boards/locale/boards.fr.tr new file mode 100644 index 0000000..81c553d --- /dev/null +++ b/boards/locale/boards.fr.tr @@ -0,0 +1,3 @@ +# textdomain: boards +Black board=Tableau noir +Green board=Tableau vert diff --git a/boards/locale/boards.ms.tr b/boards/locale/boards.ms.tr new file mode 100644 index 0000000..095dd6d --- /dev/null +++ b/boards/locale/boards.ms.tr @@ -0,0 +1,3 @@ +# textdomain: boards +Black board=Papan hitam +Green board= diff --git a/boards/locale/fr.po b/boards/locale/fr.po deleted file mode 100644 index 1b081be..0000000 --- a/boards/locale/fr.po +++ /dev/null @@ -1,40 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-16 10:00+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: init.lua -msgid "Text" -msgstr "Texte" - -#: init.lua -msgid "Write" -msgstr "Ecrire" - -#: init.lua -msgid "Wipe" -msgstr "Effacer" - -#: init.lua -msgid "Black board" -msgstr "Tableau noir" - -#: init.lua -msgid "Green board" -msgstr "Tableau vert" - - diff --git a/boards/locale/ms.po b/boards/locale/ms.po deleted file mode 100644 index fe360aa..0000000 --- a/boards/locale/ms.po +++ /dev/null @@ -1,35 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) , 2020. -# -msgid "" -msgstr "" -"Project-Id-Version: Display Modpack\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-16 10:00+0200\n" -"PO-Revision-Date: 2020-07-05 11:31+0000\n" -"Language-Team: Malay \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.3\n" -"Last-Translator: Yaya MNH48 \n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language: ms\n" - -#: init.lua -msgid "Text" -msgstr "Teks" - -#: init.lua -msgid "Write" -msgstr "Tulis" - -#: init.lua -msgid "Wipe" -msgstr "Padam" - -#: init.lua -msgid "Black board" -msgstr "Papan hitam" diff --git a/boards/locale/template.pot b/boards/locale/template.pot deleted file mode 100644 index 8db98b8..0000000 --- a/boards/locale/template.pot +++ /dev/null @@ -1,34 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-16 10:00+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: init.lua -msgid "Text" -msgstr "" - -#: init.lua -msgid "Write" -msgstr "" - -#: init.lua -msgid "Wipe" -msgstr "" - -#: init.lua -msgid "Black board" -msgstr "" diff --git a/boards/locale/template.txt b/boards/locale/template.txt new file mode 100644 index 0000000..4f5d7c3 --- /dev/null +++ b/boards/locale/template.txt @@ -0,0 +1,3 @@ +# textdomain: boards +Black board= +Green board= diff --git a/ontime_clocks/locale/fr.po b/ontime_clocks/locale/fr.po deleted file mode 100644 index ed5d2b4..0000000 --- a/ontime_clocks/locale/fr.po +++ /dev/null @@ -1,43 +0,0 @@ -# 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 , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-05 09:50+0200\n" -"PO-Revision-Date: 2017-05-08 06:20+0200\n" -"Last-Translator: Peppy \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: nodes.lua -msgid "Green digital clock" -msgstr "Horloge numérique verte" - -#: nodes.lua -msgid "Red digital clock" -msgstr "Horloge numérique rouge" - -#: nodes.lua -msgid "White clock" -msgstr "Horloge blanche" - -#: nodes.lua -msgid "Frameless clock" -msgstr "Horloge sans cadre" - -#: nodes.lua -msgid "Frameless gold clock" -msgstr "Horloge dorée sans cadre" - -#: nodes.lua -msgid "Frameless white clock" -msgstr "Horloge blanche sans cadre" diff --git a/ontime_clocks/locale/ms.po b/ontime_clocks/locale/ms.po deleted file mode 100644 index 4d52ac2..0000000 --- a/ontime_clocks/locale/ms.po +++ /dev/null @@ -1,42 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) , 2017. -msgid "" -msgstr "" -"Project-Id-Version: Display Modpack\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:21+0200\n" -"PO-Revision-Date: 2020-07-05 11:32+0000\n" -"Last-Translator: Yaya MNH48 \n" -"Language-Team: Malay \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.3\n" - -#: nodes.lua -msgid "Green digital clock" -msgstr "Jam digital hijau" - -#: nodes.lua -msgid "Red digital clock" -msgstr "Jam digital merah" - -#: nodes.lua -msgid "White clock" -msgstr "Jam putih" - -#: nodes.lua -msgid "Frameless clock" -msgstr "Jam tanpa bingkai" - -#: nodes.lua -msgid "Frameless gold clock" -msgstr "Jam emas tanpa bingkai" - -#: nodes.lua -msgid "Frameless white clock" -msgstr "Jam putih tanpa bingkai" diff --git a/ontime_clocks/locale/ontime_clocks.fr.tr b/ontime_clocks/locale/ontime_clocks.fr.tr new file mode 100644 index 0000000..fdc8ccf --- /dev/null +++ b/ontime_clocks/locale/ontime_clocks.fr.tr @@ -0,0 +1,7 @@ +# textdomain: ontime_clocks +Green digital clock=Horloge numérique verte +Red digital clock=Horloge numérique rouge +White clock=Horloge blanche +Frameless clock=Horloge sans cadre +Frameless gold clock=Horloge dorée sans cadre +Frameless white clock=Horloge blanche sans cadre diff --git a/ontime_clocks/locale/ontime_clocks.ms.tr b/ontime_clocks/locale/ontime_clocks.ms.tr new file mode 100644 index 0000000..0478935 --- /dev/null +++ b/ontime_clocks/locale/ontime_clocks.ms.tr @@ -0,0 +1,7 @@ +# textdomain: ontime_clocks +Green digital clock=Jam digital hijau +Red digital clock=Jam digital merah +White clock=Jam putih +Frameless clock=Jam tanpa bingkai +Frameless gold clock=Jam emas tanpa bingkai +Frameless white clock=Jam putih tanpa bingkai diff --git a/ontime_clocks/locale/template.pot b/ontime_clocks/locale/template.pot deleted file mode 100644 index dca736f..0000000 --- a/ontime_clocks/locale/template.pot +++ /dev/null @@ -1,42 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:21+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: nodes.lua -msgid "Green digital clock" -msgstr "" - -#: nodes.lua -msgid "Red digital clock" -msgstr "" - -#: nodes.lua -msgid "White clock" -msgstr "" - -#: nodes.lua -msgid "Frameless clock" -msgstr "" - -#: nodes.lua -msgid "Frameless gold clock" -msgstr "" - -#: nodes.lua -msgid "Frameless white clock" -msgstr "" diff --git a/ontime_clocks/locale/template.txt b/ontime_clocks/locale/template.txt new file mode 100644 index 0000000..6db07cb --- /dev/null +++ b/ontime_clocks/locale/template.txt @@ -0,0 +1,7 @@ +# textdomain: ontime_clocks +Green digital clock= +Red digital clock= +White clock= +Frameless clock= +Frameless gold clock= +Frameless white clock= diff --git a/signs/locale/fr.po b/signs/locale/fr.po deleted file mode 100644 index 7a00544..0000000 --- a/signs/locale/fr.po +++ /dev/null @@ -1,54 +0,0 @@ -# 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 , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 13:20+0200\n" -"PO-Revision-Date: 2017-05-08 07:08+0200\n" -"Last-Translator: Peppy \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" - -#: common.lua nodes.lua -msgid "Text" -msgstr "Texte" - -#: common.lua nodes.lua -msgid "Write" -msgstr "Écrire" - -#: common.lua -#, lua-format -msgid " (first %s lines only)" -msgstr " (uniquement les %s premières lignes)" - -#: nodes.lua -msgid "Title" -msgstr "Titre" - -#: nodes.lua -msgid "Close" -msgstr "Fermer" - -#: nodes.lua -msgid "(right-click to read more text)" -msgstr "(Clic-droit pour afficher le texte entier)" - -#: nodes.lua -msgid "Wooden direction sign" -msgstr "Panneau de direction en bois" - -#: nodes.lua -msgid "Poster" -msgstr "Affiche" - -#~ msgid "Textd" -#~ msgstr "Texte" diff --git a/signs/locale/ms.po b/signs/locale/ms.po deleted file mode 100644 index defee7b..0000000 --- a/signs/locale/ms.po +++ /dev/null @@ -1,51 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) , 2017. -msgid "" -msgstr "" -"Project-Id-Version: Display Modpack\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 13:20+0200\n" -"PO-Revision-Date: 2020-07-05 11:34+0000\n" -"Last-Translator: Yaya MNH48 \n" -"Language-Team: Malay \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.3\n" - -#: common.lua nodes.lua -msgid "Text" -msgstr "Teks" - -#: common.lua nodes.lua -msgid "Write" -msgstr "Tulis" - -#: common.lua -#, lua-format -msgid " (first %s lines only)" -msgstr " (%s baris pertama sahaja)" - -#: nodes.lua -msgid "Title" -msgstr "Tajuk" - -#: nodes.lua -msgid "Close" -msgstr "Tutup" - -#: nodes.lua -msgid "(right-click to read more text)" -msgstr "(klik-kanan untuk baca teks penuh)" - -#: nodes.lua -msgid "Wooden direction sign" -msgstr "Papan tanda arah kayu" - -#: nodes.lua -msgid "Poster" -msgstr "Poster" diff --git a/signs/locale/signs.fr.tr b/signs/locale/signs.fr.tr new file mode 100644 index 0000000..af9b6b3 --- /dev/null +++ b/signs/locale/signs.fr.tr @@ -0,0 +1,8 @@ +# textdomain: signs +(right-click to read more text)=(Clic-droit pour afficher le texte entier) +Wooden sign= +Wooden long sign= +Wooden direction sign=Panneau de direction en bois +Poster=Affiche +Small label= +Label= diff --git a/signs/locale/signs.ms.tr b/signs/locale/signs.ms.tr new file mode 100644 index 0000000..34c055a --- /dev/null +++ b/signs/locale/signs.ms.tr @@ -0,0 +1,8 @@ +# textdomain: signs +(right-click to read more text)=(klik-kanan untuk baca teks penuh) +Wooden sign= +Wooden long sign= +Wooden direction sign=Papan tanda arah kayu +Poster=Poster +Small label= +Label= diff --git a/signs/locale/template.pot b/signs/locale/template.pot deleted file mode 100644 index a1fc065..0000000 --- a/signs/locale/template.pot +++ /dev/null @@ -1,51 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 13:20+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: common.lua nodes.lua -msgid "Text" -msgstr "" - -#: common.lua nodes.lua -msgid "Write" -msgstr "" - -#: common.lua -#, lua-format -msgid " (first %s lines only)" -msgstr "" - -#: nodes.lua -msgid "Title" -msgstr "" - -#: nodes.lua -msgid "Close" -msgstr "" - -#: nodes.lua -msgid "(right-click to read more text)" -msgstr "" - -#: nodes.lua -msgid "Wooden direction sign" -msgstr "" - -#: nodes.lua -msgid "Poster" -msgstr "" diff --git a/signs/locale/template.txt b/signs/locale/template.txt new file mode 100644 index 0000000..035a74e --- /dev/null +++ b/signs/locale/template.txt @@ -0,0 +1,8 @@ +# textdomain: signs +(right-click to read more text)= +Wooden sign= +Wooden long sign= +Wooden direction sign= +Poster= +Small label= +Label= diff --git a/signs_api/locale/fr.po b/signs_api/locale/fr.po deleted file mode 100644 index e490d1b..0000000 --- a/signs_api/locale/fr.po +++ /dev/null @@ -1,49 +0,0 @@ -# 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 , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-01 05:56+0100\n" -"PO-Revision-Date: 2017-05-08 07:08+0200\n" -"Last-Translator: Peppy \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" - -#: common.lua -msgid "Text" -msgstr "Texte" - -#: common.lua -msgid "Write" -msgstr "Écrire" - -#: common.lua -#, lua-format -msgid " (first %s lines only)" -msgstr " (uniquement les %s premières lignes)" - -#~ msgid "Title" -#~ msgstr "Titre" - -#~ msgid "Close" -#~ msgstr "Fermer" - -#~ msgid "(right-click to read more text)" -#~ msgstr "(Clic-droit pour afficher le texte entier)" - -#~ msgid "Wooden direction sign" -#~ msgstr "Panneau de direction en bois" - -#~ msgid "Poster" -#~ msgstr "Affiche" - -#~ msgid "Textd" -#~ msgstr "Texte" diff --git a/signs_api/locale/ms.po b/signs_api/locale/ms.po deleted file mode 100644 index 0d90222..0000000 --- a/signs_api/locale/ms.po +++ /dev/null @@ -1,46 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) , 2017. -msgid "" -msgstr "" -"Project-Id-Version: Display Modpack\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-01 05:56+0100\n" -"PO-Revision-Date: 2020-07-05 11:31+0000\n" -"Last-Translator: Yaya MNH48 \n" -"Language-Team: Malay \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.3\n" - -#: common.lua -msgid "Text" -msgstr "Teks" - -#: common.lua -msgid "Write" -msgstr "Tulis" - -#: common.lua -#, lua-format -msgid " (first %s lines only)" -msgstr " (%s baris pertama sahaja)" - -#~ msgid "Title" -#~ msgstr "Tajuk" - -#~ msgid "Close" -#~ msgstr "Tutup" - -#~ msgid "(right-click to read more text)" -#~ msgstr "(klik-kanan untuk baca teks penuh)" - -#~ msgid "Wooden direction sign" -#~ msgstr "Papan tanda arah kayu" - -#~ msgid "Poster" -#~ msgstr "Poster" diff --git a/signs_api/locale/signs_api.fr.tr b/signs_api/locale/signs_api.fr.tr new file mode 100644 index 0000000..8475ee2 --- /dev/null +++ b/signs_api/locale/signs_api.fr.tr @@ -0,0 +1,10 @@ + +Text=Texte +Write=Écrire + (first %s lines only)= (uniquement les %s premières lignes) +Title=Titre +Close=Fermer +(right-click to read more text)=(Clic-droit pour afficher le texte entier) +Wooden direction sign=Panneau de direction en bois +Poster=Affiche +Textd=Texte diff --git a/signs_api/locale/signs_api.ms.tr b/signs_api/locale/signs_api.ms.tr new file mode 100644 index 0000000..9aac35d --- /dev/null +++ b/signs_api/locale/signs_api.ms.tr @@ -0,0 +1,9 @@ + +Text=Teks +Write=Tulis + (first %s lines only)= (%s baris pertama sahaja) +Title=Tajuk +Close=Tutup +(right-click to read more text)=(klik-kanan untuk baca teks penuh) +Wooden direction sign=Papan tanda arah kayu +Poster=Poster diff --git a/signs_api/locale/template.pot b/signs_api/locale/template.pot deleted file mode 100644 index 6004024..0000000 --- a/signs_api/locale/template.pot +++ /dev/null @@ -1,31 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-01 05:56+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: common.lua -msgid "Text" -msgstr "" - -#: common.lua -msgid "Write" -msgstr "" - -#: common.lua -#, lua-format -msgid " (first %s lines only)" -msgstr "" diff --git a/signs_road/locale/fr.po b/signs_road/locale/fr.po deleted file mode 100644 index 833f115..0000000 --- a/signs_road/locale/fr.po +++ /dev/null @@ -1,56 +0,0 @@ -# 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 , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:26+0200\n" -"PO-Revision-Date: 2017-05-08 06:40+0200\n" -"Last-Translator: Peppy \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: nodes.lua -msgid "Blue street sign" -msgstr "Plaque de rue bleue" - -#: nodes.lua -msgid "Red and white town sign" -msgstr "Panneau de ville rouge et blanc" - -#: nodes.lua -msgid "White street sign" -msgstr "Panneau blanc" - -#: nodes.lua -msgid "Green street sign" -msgstr "Panneau vert" - -#: nodes.lua -msgid "Yellow street sign" -msgstr "Panneau jaune" - -#: nodes.lua -msgid "Black direction sign" -msgstr "Panneau de direction noir" - -#: nodes.lua -msgid "Green direction sign" -msgstr "Panneau de direction vert" - -#: nodes.lua -msgid "Yellow direction sign" -msgstr "Panneau de direction jaune" - -#: nodes.lua -msgid "White direction sign" -msgstr "Panneau de direction blanc" - diff --git a/signs_road/locale/ms.po b/signs_road/locale/ms.po deleted file mode 100644 index 30ba158..0000000 --- a/signs_road/locale/ms.po +++ /dev/null @@ -1,54 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) , 2017. -msgid "" -msgstr "" -"Project-Id-Version: Display Modpack\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:28+0200\n" -"PO-Revision-Date: 2020-07-05 11:32+0000\n" -"Last-Translator: Yaya MNH48 \n" -"Language-Team: Malay \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.3\n" - -#: nodes.lua -msgid "Blue street sign" -msgstr "Papan tanda jalan biru" - -#: nodes.lua -msgid "Red and white town sign" -msgstr "Papan tanda bandar merah dan putih" - -#: nodes.lua -msgid "White street sign" -msgstr "Papan tanda jalan putih" - -#: nodes.lua -msgid "Green street sign" -msgstr "Papan tanda jalan hijau" - -#: nodes.lua -msgid "Yellow street sign" -msgstr "Papan tanda jalan kuning" - -#: nodes.lua -msgid "Black direction sign" -msgstr "Papan tanda arah hitam" - -#: nodes.lua -msgid "Green direction sign" -msgstr "Papan tanda arah hijau" - -#: nodes.lua -msgid "Yellow direction sign" -msgstr "Papan tanda arah kuning" - -#: nodes.lua -msgid "White direction sign" -msgstr "Papan tanda arah putih" diff --git a/signs_road/locale/signs_road.fr.tr b/signs_road/locale/signs_road.fr.tr new file mode 100644 index 0000000..221a511 --- /dev/null +++ b/signs_road/locale/signs_road.fr.tr @@ -0,0 +1,15 @@ +# textdomain: signs_road +Blue street sign=Plaque de rue bleue +Large banner= +Red and white town sign=Panneau de ville rouge et blanc +White street sign=Panneau blanc +Blue road sign= +Green road sign= +Yellow road sign= +Red road sign= +Black direction sign=Panneau de direction noir +White direction sign=Panneau de direction blanc +Blue direction sign= +Green direction sign=Panneau de direction vert +Yellow direction sign=Panneau de direction jaune +Red direction sign= diff --git a/signs_road/locale/signs_road.ms.tr b/signs_road/locale/signs_road.ms.tr new file mode 100644 index 0000000..90e5bec --- /dev/null +++ b/signs_road/locale/signs_road.ms.tr @@ -0,0 +1,15 @@ +# textdomain: signs_road +Blue street sign=Papan tanda jalan biru +Large banner= +Red and white town sign=Papan tanda bandar merah dan putih +White street sign=Papan tanda jalan putih +Blue road sign= +Green road sign= +Yellow road sign= +Red road sign= +Black direction sign=Papan tanda arah hitam +White direction sign=Papan tanda arah putih +Blue direction sign= +Green direction sign=Papan tanda arah hijau +Yellow direction sign=Papan tanda arah kuning +Red direction sign= diff --git a/signs_road/locale/template.pot b/signs_road/locale/template.pot deleted file mode 100644 index b15ce94..0000000 --- a/signs_road/locale/template.pot +++ /dev/null @@ -1,54 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:28+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: nodes.lua -msgid "Blue street sign" -msgstr "" - -#: nodes.lua -msgid "Red and white town sign" -msgstr "" - -#: nodes.lua -msgid "White street sign" -msgstr "" - -#: nodes.lua -msgid "Green street sign" -msgstr "" - -#: nodes.lua -msgid "Yellow street sign" -msgstr "" - -#: nodes.lua -msgid "Black direction sign" -msgstr "" - -#: nodes.lua -msgid "Green direction sign" -msgstr "" - -#: nodes.lua -msgid "Yellow direction sign" -msgstr "" - -#: nodes.lua -msgid "White direction sign" -msgstr "" diff --git a/signs_road/locale/template.txt b/signs_road/locale/template.txt new file mode 100644 index 0000000..3a2611b --- /dev/null +++ b/signs_road/locale/template.txt @@ -0,0 +1,15 @@ +# textdomain: signs_road +Blue street sign= +Large banner= +Red and white town sign= +White street sign= +Blue road sign= +Green road sign= +Yellow road sign= +Red road sign= +Black direction sign= +White direction sign= +Blue direction sign= +Green direction sign= +Yellow direction sign= +Red direction sign= diff --git a/steles/locale/fr.po b/steles/locale/fr.po deleted file mode 100644 index 1785d8a..0000000 --- a/steles/locale/fr.po +++ /dev/null @@ -1,47 +0,0 @@ -# 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 , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-05 10:06+0200\n" -"PO-Revision-Date: 2017-08-05 09:03+0200\n" -"Last-Translator: fat115 \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.12\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: config.lua -msgid "Stone Stele" -msgstr "Stèle en pierre" - -#: config.lua -msgid "Sandstone Stele" -msgstr "Stèle en grès" - -#: config.lua -msgid "Desert Stone Stele" -msgstr "Stèle en pierre du désert" - -#: config.lua -msgid "Marble Stele" -msgstr "Stèle en marbre" - -#: config.lua -msgid "Granite Stele" -msgstr "Stèle en granit" - -#: nodes.lua -msgid "Displayed text (3 lines max)" -msgstr "Texte à afficher (3 lignes maxi.)" - -#: nodes.lua -msgid "Write" -msgstr "Écrire" diff --git a/steles/locale/ms.po b/steles/locale/ms.po deleted file mode 100644 index 1c58983..0000000 --- a/steles/locale/ms.po +++ /dev/null @@ -1,46 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Yaya (Nurul Azeera Hidayah @ Muhammad Nur Hidayat) , 2017. -msgid "" -msgstr "" -"Project-Id-Version: Display Modpack\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:29+0200\n" -"PO-Revision-Date: 2020-07-05 11:34+0000\n" -"Last-Translator: Yaya MNH48 \n" -"Language-Team: Malay \n" -"Language: ms\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.3\n" - -#: config.lua -msgid "Stone Stele" -msgstr "Tulisan Batu" - -#: config.lua -msgid "Sandstone Stele" -msgstr "Tulisan Batu Pasir" - -#: config.lua -msgid "Desert Stone Stele" -msgstr "Tulisan Batu Gurun" - -#: config.lua -msgid "Marble Stele" -msgstr "Tulisan Marmar" - -#: config.lua -msgid "Granite Stele" -msgstr "Tulisan Granit" - -#: nodes.lua -msgid "Displayed text (3 lines max)" -msgstr "Teks terpapar (maksimum 3 baris)" - -#: nodes.lua -msgid "Write" -msgstr "Tulis" diff --git a/steles/locale/steles.fr.tr b/steles/locale/steles.fr.tr new file mode 100644 index 0000000..186d7c4 --- /dev/null +++ b/steles/locale/steles.fr.tr @@ -0,0 +1,6 @@ +# textdomain: steles +Stone Stele=Stèle en pierre +Sandstone Stele=Stèle en grès +Desert Stone Stele=Stèle en pierre du désert +Marble Stele=Stèle en marbre +Granite Stele=Stèle en granit diff --git a/steles/locale/steles.ms.tr b/steles/locale/steles.ms.tr new file mode 100644 index 0000000..b3a1eff --- /dev/null +++ b/steles/locale/steles.ms.tr @@ -0,0 +1,6 @@ +# textdomain: steles +Stone Stele=Tulisan Batu +Sandstone Stele=Tulisan Batu Pasir +Desert Stone Stele=Tulisan Batu Gurun +Marble Stele=Tulisan Marmar +Granite Stele=Tulisan Granit diff --git a/steles/locale/template.pot b/steles/locale/template.pot deleted file mode 100644 index 0144ace..0000000 --- a/steles/locale/template.pot +++ /dev/null @@ -1,46 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-26 11:29+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: config.lua -msgid "Stone Stele" -msgstr "" - -#: config.lua -msgid "Sandstone Stele" -msgstr "" - -#: config.lua -msgid "Desert Stone Stele" -msgstr "" - -#: config.lua -msgid "Marble Stele" -msgstr "" - -#: config.lua -msgid "Granite Stele" -msgstr "" - -#: nodes.lua -msgid "Displayed text (3 lines max)" -msgstr "" - -#: nodes.lua -msgid "Write" -msgstr "" diff --git a/steles/locale/template.txt b/steles/locale/template.txt new file mode 100644 index 0000000..0cb2004 --- /dev/null +++ b/steles/locale/template.txt @@ -0,0 +1,6 @@ +# textdomain: steles +Stone Stele= +Sandstone Stele= +Desert Stone Stele= +Marble Stele= +Granite Stele= From a50f095ae5c3bd248c4063bd604036d91b0062a4 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 14:31:01 +0200 Subject: [PATCH 03/15] replace intllib --- boards/init.lua | 12 +++---- boards/intllib.lua | 45 ------------------------ boards/locale/boards.de.tr | 6 ++++ boards/locale/boards.fr.tr | 3 ++ boards/locale/boards.ms.tr | 3 ++ boards/locale/template.txt | 3 ++ ontime_clocks/init.lua | 5 ++- ontime_clocks/intllib.lua | 45 ------------------------ ontime_clocks/locale/ontime_clocks.de.tr | 7 ++++ ontime_clocks/mod.conf | 1 - ontime_clocks/nodes.lua | 2 +- signs/common.lua | 3 -- signs/init.lua | 5 ++- signs/intllib.lua | 45 ------------------------ signs/locale/signs.de.txt | 14 ++++++++ signs/locale/signs.fr.tr | 6 ++++ signs/locale/signs.ms.tr | 6 ++++ signs/locale/template.txt | 6 ++++ signs/mod.conf | 1 - signs/nodes.lua | 13 ++++--- signs_api/init.lua | 16 ++++----- signs_api/intllib.lua | 45 ------------------------ signs_api/locale/signs_api.de.tr | 5 +++ signs_api/locale/signs_api.fr.tr | 11 ++---- signs_api/locale/signs_api.ms.tr | 10 ++---- signs_api/locale/template.txt | 5 +++ signs_api/mod.conf | 1 - signs_road/init.lua | 5 ++- signs_road/intllib.lua | 45 ------------------------ signs_road/locale/signs_road.de.tr | 15 ++++++++ signs_road/mod.conf | 1 - signs_road/nodes.lua | 2 +- steles/config.lua | 2 +- steles/init.lua | 5 ++- steles/intllib.lua | 45 ------------------------ steles/locale/steles.de.tr | 9 +++++ steles/locale/steles.fr.tr | 3 ++ steles/locale/steles.ms.tr | 3 ++ steles/locale/template.txt | 3 ++ steles/mod.conf | 2 +- steles/nodes.lua | 7 ++-- 41 files changed, 136 insertions(+), 335 deletions(-) delete mode 100644 boards/intllib.lua create mode 100644 boards/locale/boards.de.tr delete mode 100644 ontime_clocks/intllib.lua create mode 100644 ontime_clocks/locale/ontime_clocks.de.tr delete mode 100644 signs/intllib.lua create mode 100644 signs/locale/signs.de.txt delete mode 100644 signs_api/intllib.lua create mode 100644 signs_api/locale/signs_api.de.tr create mode 100644 signs_api/locale/template.txt delete mode 100644 signs_road/intllib.lua create mode 100644 signs_road/locale/signs_road.de.tr delete mode 100644 steles/intllib.lua create mode 100644 steles/locale/steles.de.tr diff --git a/boards/init.lua b/boards/init.lua index 4126a6c..26ca94e 100644 --- a/boards/init.lua +++ b/boards/init.lua @@ -22,10 +22,8 @@ boards = {} boards.name = minetest.get_current_modname() boards.path = minetest.get_modpath(boards.name) --- Load support for intllib. -local S, NS = dofile(boards.path.."/intllib.lua") -boards.intllib = S -local F = function(...) return minetest.formspec_escape(S(...)) end +-- Translation support +local S = minetest.get_translator(boards.name) -- Load font dofile(boards.path.."/font_tinycurs.lua") @@ -34,9 +32,9 @@ local function set_formspec(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", "size[6,4]"..default.gui_bg..default.gui_bg_img..default.gui_slots.. - "textarea[0.5,0.7;5.5,3;display_text;"..F("Text")..";${display_text}]".. - "button_exit[3,3.5;2,1;ok;"..F("Write").."]".. - "button_exit[1,3.5;2,1;wipe;"..F("Wipe").."]") + "textarea[0.5,0.7;5.5,3;display_text;"..S("Text")..";${display_text}]".. + "button_exit[3,3.5;2,1;ok;"..S("Write").."]".. + "button_exit[1,3.5;2,1;wipe;"..S("Wipe").."]") end -- On boards, everyone is allowed to write and wipe diff --git a/boards/intllib.lua b/boards/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/boards/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/boards/locale/boards.de.tr b/boards/locale/boards.de.tr new file mode 100644 index 0000000..eaf9edb --- /dev/null +++ b/boards/locale/boards.de.tr @@ -0,0 +1,6 @@ +# textdomain: boards +Text=Text +Write=Schreiben +Wipe=Abwischen +Black board=Schwarze Tafel +Green board=Grüne Tafel diff --git a/boards/locale/boards.fr.tr b/boards/locale/boards.fr.tr index 81c553d..ad6f11b 100644 --- a/boards/locale/boards.fr.tr +++ b/boards/locale/boards.fr.tr @@ -1,3 +1,6 @@ # textdomain: boards +Text= +Write= +Wipe= Black board=Tableau noir Green board=Tableau vert diff --git a/boards/locale/boards.ms.tr b/boards/locale/boards.ms.tr index 095dd6d..7c5c629 100644 --- a/boards/locale/boards.ms.tr +++ b/boards/locale/boards.ms.tr @@ -1,3 +1,6 @@ # textdomain: boards +Text= +Write= +Wipe= Black board=Papan hitam Green board= diff --git a/boards/locale/template.txt b/boards/locale/template.txt index 4f5d7c3..fac8341 100644 --- a/boards/locale/template.txt +++ b/boards/locale/template.txt @@ -1,3 +1,6 @@ # textdomain: boards +Text= +Write= +Wipe= Black board= Green board= diff --git a/ontime_clocks/init.lua b/ontime_clocks/init.lua index d0ac334..97e7154 100644 --- a/ontime_clocks/init.lua +++ b/ontime_clocks/init.lua @@ -22,9 +22,8 @@ ontime_clocks = {} ontime_clocks.name = minetest.get_current_modname() ontime_clocks.path = minetest.get_modpath(ontime_clocks.name) --- Load support for intllib. -local S, NS = dofile(ontime_clocks.path.."/intllib.lua") -ontime_clocks.intllib = S +-- Translation support +ontime_clocks.S = minetest.get_translator(ontime_clocks.name) dofile(ontime_clocks.path.."/common.lua") dofile(ontime_clocks.path.."/nodes.lua") diff --git a/ontime_clocks/intllib.lua b/ontime_clocks/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/ontime_clocks/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/ontime_clocks/locale/ontime_clocks.de.tr b/ontime_clocks/locale/ontime_clocks.de.tr new file mode 100644 index 0000000..5bdb660 --- /dev/null +++ b/ontime_clocks/locale/ontime_clocks.de.tr @@ -0,0 +1,7 @@ +# textdomain: ontime_clocks +Green digital clock=Grüne Digitaluhr +Red digital clock=Rote Digitaluhr +White clock=Weiße Uhr +Frameless clock=Rahmenlose Uhr +Frameless gold clock=Rahmenlose goldene Uhr +Frameless white clock=Rahmenlose weiße Uhr diff --git a/ontime_clocks/mod.conf b/ontime_clocks/mod.conf index f6afbde..144b266 100644 --- a/ontime_clocks/mod.conf +++ b/ontime_clocks/mod.conf @@ -2,4 +2,3 @@ name = ontime_clocks title = Ontime Clocks description = Clocks displaing real ingame time depends = default,dye,display_api -optional_depends = intllib diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua index 0f279b2..c530e50 100644 --- a/ontime_clocks/nodes.lua +++ b/ontime_clocks/nodes.lua @@ -18,7 +18,7 @@ along with ontime_clocks. If not, see . --]] -local S = ontime_clocks.intllib +local S = ontime_clocks.S local function clock_on_construct(pos) local timer = minetest.get_node_timer(pos) diff --git a/signs/common.lua b/signs/common.lua index 733a44c..f40681f 100644 --- a/signs/common.lua +++ b/signs/common.lua @@ -18,9 +18,6 @@ along with signs. If not, see . --]] -local S = signs.intllib -local F = function(...) return minetest.formspec_escape(S(...)) end - -- Generic callback for show_formspec displayed formspecs of "sign" mod minetest.register_on_player_receive_fields(function(player, formname, fields) diff --git a/signs/init.lua b/signs/init.lua index 4f9239f..b2870c8 100644 --- a/signs/init.lua +++ b/signs/init.lua @@ -22,9 +22,8 @@ signs = {} signs.name = minetest.get_current_modname() signs.path = minetest.get_modpath(signs.name) --- Load support for intllib. -local S, NS = dofile(signs.path.."/intllib.lua") -signs.intllib = S +-- Translation support +signs.S = minetest.get_translator(signs.name) dofile(signs.path.."/common.lua") dofile(signs.path.."/nodes.lua") diff --git a/signs/intllib.lua b/signs/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/signs/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/signs/locale/signs.de.txt b/signs/locale/signs.de.txt new file mode 100644 index 0000000..4ea4239 --- /dev/null +++ b/signs/locale/signs.de.txt @@ -0,0 +1,14 @@ +# textdomain: signs +Close=Schließen +Edit=Bearbeiten +Title=Titel +Text=Text +Title font=Titel Schriftart +Write=Schreiben +(right-click to read more text)=(Rechtsklick für mehr Text) +Wooden sign=Hölzernes Schild +Wooden long sign=Langes hölzernes Schild +Wooden direction sign=Hölzerner Wegweiser +Poster=Poster +Small label=Kleines Etikett +Label=Etikett diff --git a/signs/locale/signs.fr.tr b/signs/locale/signs.fr.tr index af9b6b3..9f189f2 100644 --- a/signs/locale/signs.fr.tr +++ b/signs/locale/signs.fr.tr @@ -1,4 +1,10 @@ # textdomain: signs +Close= +Edit= +Title= +Text= +Title font= +Write= (right-click to read more text)=(Clic-droit pour afficher le texte entier) Wooden sign= Wooden long sign= diff --git a/signs/locale/signs.ms.tr b/signs/locale/signs.ms.tr index 34c055a..272234f 100644 --- a/signs/locale/signs.ms.tr +++ b/signs/locale/signs.ms.tr @@ -1,4 +1,10 @@ # textdomain: signs +Close= +Edit= +Title= +Text= +Title font= +Write= (right-click to read more text)=(klik-kanan untuk baca teks penuh) Wooden sign= Wooden long sign= diff --git a/signs/locale/template.txt b/signs/locale/template.txt index 035a74e..4545092 100644 --- a/signs/locale/template.txt +++ b/signs/locale/template.txt @@ -1,4 +1,10 @@ # textdomain: signs +Close= +Edit= +Title= +Text= +Title font= +Write= (right-click to read more text)= Wooden sign= Wooden long sign= diff --git a/signs/mod.conf b/signs/mod.conf index 1ef5d39..f437617 100644 --- a/signs/mod.conf +++ b/signs/mod.conf @@ -2,4 +2,3 @@ name = signs title = Signs description = Basic signs and posters with text display using signs_api depends = default,dye,signs_api -optional_depends = intllib diff --git a/signs/nodes.lua b/signs/nodes.lua index 7c238c4..9826930 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -18,8 +18,7 @@ along with signs. If not, see . --]] -local S = signs.intllib -local F = function(...) return minetest.formspec_escape(S(...)) end +local S = signs.S -- Poster specific formspec local function display_poster(pos, node, player) @@ -47,11 +46,11 @@ local function display_poster(pos, node, player) minetest.formspec_escape(meta:get_string("text")))) if minetest.is_protected(pos, player:get_player_name()) then - fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, F("Close")) + fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, S("Close")) else fs = string.format( "%sbutton[1,8;2,1;edit;%s]button_exit[4,8;2,1;ok;%s]", - fs, F("Edit"), F("Close")) + fs, S("Edit"), S("Close")) end minetest.show_formspec(player:get_player_name(), fname, fs) end @@ -70,10 +69,10 @@ local function edit_poster(pos, node, player) textarea[0.5,1.7;6,6;text;%s;%s] button[1.25,7;2,1;font;%s] button_exit[3.25,7;2,1;write;%s]]=], - default.gui_bg, default.gui_bg_img, default.gui_slots, F("Title"), + default.gui_bg, default.gui_bg_img, default.gui_slots, S("Title"), minetest.formspec_escape(meta:get_string("display_text")), - F("Text"), minetest.formspec_escape(meta:get_string("text")), - F("Title font"), F("Write")) + S("Text"), minetest.formspec_escape(meta:get_string("text")), + S("Title font"), S("Write")) minetest.show_formspec(player:get_player_name(), fname, fs) end end diff --git a/signs_api/init.lua b/signs_api/init.lua index 1bd00d6..e1ebee3 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -22,10 +22,8 @@ signs_api = {} signs_api.name = minetest.get_current_modname() signs_api.path = minetest.get_modpath(signs_api.name) --- Load support for intllib. -local S, NS = dofile(signs_api.path.."/intllib.lua") -signs_api.intllib = S -local F = function(...) return minetest.formspec_escape(S(...)) end +-- Translation support +local S = minetest.get_translator(signs_api.name) function signs_api.set_display_text(pos, text, font) local meta = minetest.get_meta(pos) @@ -50,22 +48,22 @@ function signs_api.set_formspec(pos) local fs, y if maxlines == 1 then - fs = "field[0.5,0.7;5.5,1;display_text;"..F("Text").. + fs = "field[0.5,0.7;5.5,1;display_text;"..S("Text").. ";${display_text}]" y = 1.2 else local extralabel = "" if maxlines then - extralabel = F(" (first %s lines only)"):format(maxlines) + extralabel = S(" (first %s lines only)"):format(maxlines) end - fs = "textarea[0.5,0.7;5.5,2;display_text;"..F("Text").."".. + fs = "textarea[0.5,0.7;5.5,2;display_text;"..S("Text").."".. extralabel..";${display_text}]" y = 2.4 end - fs = fs.."button[1,"..y..";2,1;font;"..F("Font").."]" - fs = fs.."button_exit[3,"..y..";2,1;ok;"..F("Write").."]" + fs = fs.."button[1,"..y..";2,1;font;"..S("Font").."]" + fs = fs.."button_exit[3,"..y..";2,1;ok;"..S("Write").."]" y = y + 0.8 fs = "size[6,"..y.."]"..default.gui_bg.. default.gui_bg_img..default.gui_slots..fs diff --git a/signs_api/intllib.lua b/signs_api/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/signs_api/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/signs_api/locale/signs_api.de.tr b/signs_api/locale/signs_api.de.tr new file mode 100644 index 0000000..b83fc77 --- /dev/null +++ b/signs_api/locale/signs_api.de.tr @@ -0,0 +1,5 @@ +# textdomain: signs_api +Text=Text + (first %s lines only)= (nur die ersten %s-Zeilen) +Font=Schriftart +Write=Schreiben diff --git a/signs_api/locale/signs_api.fr.tr b/signs_api/locale/signs_api.fr.tr index 8475ee2..eb55e5d 100644 --- a/signs_api/locale/signs_api.fr.tr +++ b/signs_api/locale/signs_api.fr.tr @@ -1,10 +1,5 @@ - +# textdomain: signs_api Text=Texte -Write=Écrire (first %s lines only)= (uniquement les %s premières lignes) -Title=Titre -Close=Fermer -(right-click to read more text)=(Clic-droit pour afficher le texte entier) -Wooden direction sign=Panneau de direction en bois -Poster=Affiche -Textd=Texte +Font= +Write=Écrire diff --git a/signs_api/locale/signs_api.ms.tr b/signs_api/locale/signs_api.ms.tr index 9aac35d..bed4a75 100644 --- a/signs_api/locale/signs_api.ms.tr +++ b/signs_api/locale/signs_api.ms.tr @@ -1,9 +1,5 @@ - +# textdomain: signs_api Text=Teks -Write=Tulis (first %s lines only)= (%s baris pertama sahaja) -Title=Tajuk -Close=Tutup -(right-click to read more text)=(klik-kanan untuk baca teks penuh) -Wooden direction sign=Papan tanda arah kayu -Poster=Poster +Font= +Write=Tulis diff --git a/signs_api/locale/template.txt b/signs_api/locale/template.txt new file mode 100644 index 0000000..7663323 --- /dev/null +++ b/signs_api/locale/template.txt @@ -0,0 +1,5 @@ +# textdomain: signs_api +Text= + (first %s lines only)= +Font= +Write= diff --git a/signs_api/mod.conf b/signs_api/mod.conf index f4f91b7..cdc6a10 100644 --- a/signs_api/mod.conf +++ b/signs_api/mod.conf @@ -2,4 +2,3 @@ name = signs_api title = Signs API description = A library providing various helper functions for registereing signs with text display depends = default,display_api,font_api -optional_depends = intllib diff --git a/signs_road/init.lua b/signs_road/init.lua index cd95c6c..67991ae 100644 --- a/signs_road/init.lua +++ b/signs_road/init.lua @@ -23,9 +23,8 @@ signs_road = {} signs_road.name = minetest.get_current_modname() signs_road.path = minetest.get_modpath(signs_road.name) --- Load support for intllib. -local S, NS = dofile(signs_road.path.."/intllib.lua") -signs_road.intllib = S +-- Translation support +signs_road.S = minetest.get_translator(signs_road.name) dofile(signs_road.path.."/nodes.lua") dofile(signs_road.path.."/crafts.lua") diff --git a/signs_road/intllib.lua b/signs_road/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/signs_road/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/signs_road/locale/signs_road.de.tr b/signs_road/locale/signs_road.de.tr new file mode 100644 index 0000000..324ace2 --- /dev/null +++ b/signs_road/locale/signs_road.de.tr @@ -0,0 +1,15 @@ +# textdomain: signs_road +Blue street sign=Blaues Straßenschild +Large banner=Großes Banner +Red and white town sign=Rot-weißes Ortsschild +White street sign=Weißes Straßenschild +Blue road sign=Blaues Straßenschild +Green road sign=Grünes Straßenschild +Yellow road sign=Gelbes Straßenschild +Red road sign=Rotes Straßenschild +Black direction sign=Schwarzer Wegweiser +White direction sign=Weißer Wegweiser +Blue direction sign=Blauer Wegweiser +Green direction sign=Grüner Wegweiser +Yellow direction sign=Gelber Wegweiser +Red direction sign=Roter Wegweiser diff --git a/signs_road/mod.conf b/signs_road/mod.conf index ae93f5a..6db7bcf 100644 --- a/signs_road/mod.conf +++ b/signs_road/mod.conf @@ -2,4 +2,3 @@ name = signs_road title = Signs Road description = Various road signs with text display using signs_api depends = default,dye,signs_api -optional_depends = intllib diff --git a/signs_road/nodes.lua b/signs_road/nodes.lua index 74eca23..1fc8061 100644 --- a/signs_road/nodes.lua +++ b/signs_road/nodes.lua @@ -19,7 +19,7 @@ along with signs_road. If not, see . --]] -local S = signs_road.intllib +local S = signs_road.S local models = { blue_street_sign = { diff --git a/steles/config.lua b/steles/config.lua index 551429d..6cd6c62 100644 --- a/steles/config.lua +++ b/steles/config.lua @@ -18,7 +18,7 @@ along with steles. If not, see . --]] -local S = steles.intllib +local S = steles.S steles.materials = { 'default:stone', diff --git a/steles/init.lua b/steles/init.lua index e5d2430..43d9eed 100644 --- a/steles/init.lua +++ b/steles/init.lua @@ -22,9 +22,8 @@ steles = {} steles.name = minetest.get_current_modname() steles.path = minetest.get_modpath(steles.name) --- Load support for intllib. -local S, NS = dofile(steles.path.."/intllib.lua") -steles.intllib = S +-- Translation support +steles.S = minetest.get_translator(steles.name) dofile(steles.path.."/config.lua") dofile(steles.path.."/nodes.lua") diff --git a/steles/intllib.lua b/steles/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/steles/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- Get the latest version of this file at: --- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua - -local function format(str, ...) - local args = { ... } - local function repl(escape, open, num, close) - if escape == "" then - local replacement = tostring(args[tonumber(num)]) - if open == "" then - replacement = replacement..close - end - return replacement - else - return "@"..open..num..close - end - end - return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) -end - -local gettext, ngettext -if minetest.get_modpath("intllib") then - if intllib.make_gettext_pair then - -- New method using gettext. - gettext, ngettext = intllib.make_gettext_pair() - else - -- Old method using text files. - gettext = intllib.Getter() - end -end - --- Fill in missing functions. - -gettext = gettext or function(msgid, ...) - return format(msgid, ...) -end - -ngettext = ngettext or function(msgid, msgid_plural, n, ...) - return format(n==1 and msgid or msgid_plural, ...) -end - -return gettext, ngettext diff --git a/steles/locale/steles.de.tr b/steles/locale/steles.de.tr new file mode 100644 index 0000000..10c32d6 --- /dev/null +++ b/steles/locale/steles.de.tr @@ -0,0 +1,9 @@ +# textdomain: steles +Stone Stele=Stein Stele +Sandstone Stele=Sandstein Stele +Desert Stone Stele=Wüstenstein Stele +Marble Stele=Mamor Stele +Granite Stele=Granit Stele +Displayed text (3 lines max)=Angezeigter Text (max. 3 Zeilen) +Font=Schriftart +Write=Schreiben diff --git a/steles/locale/steles.fr.tr b/steles/locale/steles.fr.tr index 186d7c4..7b0f91d 100644 --- a/steles/locale/steles.fr.tr +++ b/steles/locale/steles.fr.tr @@ -4,3 +4,6 @@ Sandstone Stele=Stèle en grès Desert Stone Stele=Stèle en pierre du désert Marble Stele=Stèle en marbre Granite Stele=Stèle en granit +Displayed text (3 lines max)= +Font= +Write= diff --git a/steles/locale/steles.ms.tr b/steles/locale/steles.ms.tr index b3a1eff..38d3b15 100644 --- a/steles/locale/steles.ms.tr +++ b/steles/locale/steles.ms.tr @@ -4,3 +4,6 @@ Sandstone Stele=Tulisan Batu Pasir Desert Stone Stele=Tulisan Batu Gurun Marble Stele=Tulisan Marmar Granite Stele=Tulisan Granit +Displayed text (3 lines max)= +Font= +Write= diff --git a/steles/locale/template.txt b/steles/locale/template.txt index 0cb2004..a8925b2 100644 --- a/steles/locale/template.txt +++ b/steles/locale/template.txt @@ -4,3 +4,6 @@ Sandstone Stele= Desert Stone Stele= Marble Stele= Granite Stele= +Displayed text (3 lines max)= +Font= +Write= diff --git a/steles/mod.conf b/steles/mod.conf index b3d5264..cfbc038 100644 --- a/steles/mod.conf +++ b/steles/mod.conf @@ -2,4 +2,4 @@ name = steles title = Steles description = Stone steles with text display on them depends = default,display_api,font_api -optional_depends = intllib,technic +optional_depends = technic diff --git a/steles/nodes.lua b/steles/nodes.lua index 2245e20..7764681 100644 --- a/steles/nodes.lua +++ b/steles/nodes.lua @@ -18,8 +18,7 @@ along with steles. If not, see . --]] -local S = steles.intllib -local F = function(...) return minetest.formspec_escape(S(...)) end +local S = steles.S display_api.register_display_entity("steles:text") @@ -69,8 +68,8 @@ for i, material in ipairs(steles.materials) do button[1,3;2,1;font;%s] button_exit[3,3;2,1;ok;%s]]=], default.gui_bg, default.gui_bg_img, default.gui_slots, - F("Displayed text (3 lines max)"), - F("Font"), F("Write"))) + S("Displayed text (3 lines max)"), + S("Font"), S("Write"))) display_api.on_construct(pos) end, on_destruct = display_api.on_destruct, From 0a3e3f8034e9ccf4bb92eec8784ba06a11ab8144 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 15:11:54 +0200 Subject: [PATCH 04/15] fix translation + remove old files --- boards/tools/updatepo.sh | 25 ------------------------- modpack.txt => modpack.conf | 0 ontime_clocks/tools/updatepo.sh | 25 ------------------------- signs/tools/updatepo.sh | 25 ------------------------- signs_api/init.lua | 2 +- signs_api/locale/signs_api.de.tr | 2 +- signs_api/locale/signs_api.fr.tr | 2 +- signs_api/locale/signs_api.ms.tr | 2 +- signs_api/locale/template.txt | 2 +- signs_api/tools/updatepo.sh | 25 ------------------------- signs_road/tools/updatepo.sh | 25 ------------------------- steles/tools/updatepo.sh | 25 ------------------------- 12 files changed, 5 insertions(+), 155 deletions(-) delete mode 100755 boards/tools/updatepo.sh rename modpack.txt => modpack.conf (100%) delete mode 100755 ontime_clocks/tools/updatepo.sh delete mode 100755 signs/tools/updatepo.sh delete mode 100755 signs_api/tools/updatepo.sh delete mode 100755 signs_road/tools/updatepo.sh delete mode 100755 steles/tools/updatepo.sh diff --git a/boards/tools/updatepo.sh b/boards/tools/updatepo.sh deleted file mode 100755 index feb2504..0000000 --- a/boards/tools/updatepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -# To create a new translation: -# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot - -cd "$(dirname "${BASH_SOURCE[0]}")/.."; - -# Extract translatable strings. -xgettext --from-code=UTF-8 \ - --language=Lua \ - --sort-by-file \ - --keyword=S \ - --keyword=NS:1,2 \ - --keyword=N_ \ - --keyword=F \ - --add-comments='Translators:' \ - --add-location=file \ - -o locale/template.pot \ - $(find . -name '*.lua') - -# Update translations. -find locale -name '*.po' | while read -r file; do - echo $file - msgmerge --update $file locale/template.pot; -done diff --git a/modpack.txt b/modpack.conf similarity index 100% rename from modpack.txt rename to modpack.conf diff --git a/ontime_clocks/tools/updatepo.sh b/ontime_clocks/tools/updatepo.sh deleted file mode 100755 index feb2504..0000000 --- a/ontime_clocks/tools/updatepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -# To create a new translation: -# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot - -cd "$(dirname "${BASH_SOURCE[0]}")/.."; - -# Extract translatable strings. -xgettext --from-code=UTF-8 \ - --language=Lua \ - --sort-by-file \ - --keyword=S \ - --keyword=NS:1,2 \ - --keyword=N_ \ - --keyword=F \ - --add-comments='Translators:' \ - --add-location=file \ - -o locale/template.pot \ - $(find . -name '*.lua') - -# Update translations. -find locale -name '*.po' | while read -r file; do - echo $file - msgmerge --update $file locale/template.pot; -done diff --git a/signs/tools/updatepo.sh b/signs/tools/updatepo.sh deleted file mode 100755 index feb2504..0000000 --- a/signs/tools/updatepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -# To create a new translation: -# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot - -cd "$(dirname "${BASH_SOURCE[0]}")/.."; - -# Extract translatable strings. -xgettext --from-code=UTF-8 \ - --language=Lua \ - --sort-by-file \ - --keyword=S \ - --keyword=NS:1,2 \ - --keyword=N_ \ - --keyword=F \ - --add-comments='Translators:' \ - --add-location=file \ - -o locale/template.pot \ - $(find . -name '*.lua') - -# Update translations. -find locale -name '*.po' | while read -r file; do - echo $file - msgmerge --update $file locale/template.pot; -done diff --git a/signs_api/init.lua b/signs_api/init.lua index e1ebee3..cdef1fe 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -54,7 +54,7 @@ function signs_api.set_formspec(pos) else local extralabel = "" if maxlines then - extralabel = S(" (first %s lines only)"):format(maxlines) + extralabel = S(" (first @1 lines only)", maxlines) end fs = "textarea[0.5,0.7;5.5,2;display_text;"..S("Text").."".. diff --git a/signs_api/locale/signs_api.de.tr b/signs_api/locale/signs_api.de.tr index b83fc77..12a389f 100644 --- a/signs_api/locale/signs_api.de.tr +++ b/signs_api/locale/signs_api.de.tr @@ -1,5 +1,5 @@ # textdomain: signs_api Text=Text - (first %s lines only)= (nur die ersten %s-Zeilen) + (first @1 lines only)= (nur die ersten @1 Zeilen) Font=Schriftart Write=Schreiben diff --git a/signs_api/locale/signs_api.fr.tr b/signs_api/locale/signs_api.fr.tr index eb55e5d..e47ecc9 100644 --- a/signs_api/locale/signs_api.fr.tr +++ b/signs_api/locale/signs_api.fr.tr @@ -1,5 +1,5 @@ # textdomain: signs_api Text=Texte - (first %s lines only)= (uniquement les %s premières lignes) + (first @1 lines only)= (uniquement les @1 premières lignes) Font= Write=Écrire diff --git a/signs_api/locale/signs_api.ms.tr b/signs_api/locale/signs_api.ms.tr index bed4a75..76f95f1 100644 --- a/signs_api/locale/signs_api.ms.tr +++ b/signs_api/locale/signs_api.ms.tr @@ -1,5 +1,5 @@ # textdomain: signs_api Text=Teks - (first %s lines only)= (%s baris pertama sahaja) + (first @1 lines only)= (@1 baris pertama sahaja) Font= Write=Tulis diff --git a/signs_api/locale/template.txt b/signs_api/locale/template.txt index 7663323..a3993b2 100644 --- a/signs_api/locale/template.txt +++ b/signs_api/locale/template.txt @@ -1,5 +1,5 @@ # textdomain: signs_api Text= - (first %s lines only)= + (first @1 lines only)= Font= Write= diff --git a/signs_api/tools/updatepo.sh b/signs_api/tools/updatepo.sh deleted file mode 100755 index feb2504..0000000 --- a/signs_api/tools/updatepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -# To create a new translation: -# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot - -cd "$(dirname "${BASH_SOURCE[0]}")/.."; - -# Extract translatable strings. -xgettext --from-code=UTF-8 \ - --language=Lua \ - --sort-by-file \ - --keyword=S \ - --keyword=NS:1,2 \ - --keyword=N_ \ - --keyword=F \ - --add-comments='Translators:' \ - --add-location=file \ - -o locale/template.pot \ - $(find . -name '*.lua') - -# Update translations. -find locale -name '*.po' | while read -r file; do - echo $file - msgmerge --update $file locale/template.pot; -done diff --git a/signs_road/tools/updatepo.sh b/signs_road/tools/updatepo.sh deleted file mode 100755 index feb2504..0000000 --- a/signs_road/tools/updatepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -# To create a new translation: -# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot - -cd "$(dirname "${BASH_SOURCE[0]}")/.."; - -# Extract translatable strings. -xgettext --from-code=UTF-8 \ - --language=Lua \ - --sort-by-file \ - --keyword=S \ - --keyword=NS:1,2 \ - --keyword=N_ \ - --keyword=F \ - --add-comments='Translators:' \ - --add-location=file \ - -o locale/template.pot \ - $(find . -name '*.lua') - -# Update translations. -find locale -name '*.po' | while read -r file; do - echo $file - msgmerge --update $file locale/template.pot; -done diff --git a/steles/tools/updatepo.sh b/steles/tools/updatepo.sh deleted file mode 100755 index feb2504..0000000 --- a/steles/tools/updatepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/bash - -# To create a new translation: -# msginit --locale=ll_CC -o locale/ll_CC.po -i locale/template.pot - -cd "$(dirname "${BASH_SOURCE[0]}")/.."; - -# Extract translatable strings. -xgettext --from-code=UTF-8 \ - --language=Lua \ - --sort-by-file \ - --keyword=S \ - --keyword=NS:1,2 \ - --keyword=N_ \ - --keyword=F \ - --add-comments='Translators:' \ - --add-location=file \ - -o locale/template.pot \ - $(find . -name '*.lua') - -# Update translations. -find locale -name '*.po' | while read -r file; do - echo $file - msgmerge --update $file locale/template.pot; -done From fbbfc07e1259966972a17361bcb74edc7ef21b12 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 15:13:28 +0200 Subject: [PATCH 05/15] fix boards formspec --- boards/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/init.lua b/boards/init.lua index 26ca94e..51e9f6f 100644 --- a/boards/init.lua +++ b/boards/init.lua @@ -77,6 +77,10 @@ models = { set_formspec(pos) display_api.on_construct(pos) end, + on_punch = function(pos) + set_formspec(pos) + display_api.update_entities(pos) + end, on_receive_fields = on_receive_fields, }, }, @@ -107,6 +111,10 @@ models = { set_formspec(pos) display_api.on_construct(pos) end, + on_punch = function(pos) + set_formspec(pos) + display_api.update_entities(pos) + end, on_receive_fields = on_receive_fields, }, }, From 72a9d1bb7dfc9fed7cdd08b18c0cb0246c31f99e Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 15:29:30 +0200 Subject: [PATCH 06/15] fix nil crashes in signs_api --- signs_api/init.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/signs_api/init.lua b/signs_api/init.lua index cdef1fe..4d0ac07 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -100,7 +100,7 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing) local ndir, test - if ndef.paramtype2 == "facedir" then + if ndef and ndef.paramtype2 == "facedir" then -- If legacy mode, only accept upright nodes if restriction and bdir.x == 0 and bdir.z == 0 then -- Ceiling or floor pointed (facedir chosen from player dir) @@ -113,7 +113,7 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing) test = { [0]=-pdir.x, pdir.z, pdir.x, -pdir.z, -pdir.x, [8]=pdir.x } end - if ndef.paramtype2 == "wallmounted" then + if ndef and ndef.paramtype2 == "wallmounted" then ndir = minetest.dir_to_wallmounted(bdir) -- If legacy mode, only accept upright nodes if restriction and (ndir == 0 or ndir == 1) then @@ -125,8 +125,10 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing) -- Only for direction signs -- TODO:Maybe improve ground and ceiling placement in every directions - if ndef.signs_other_dir then - if test[ndir] > 0 then + if ndef and ndef.signs_other_dir then + if not test[ndir] then -- https://github.com/pyrollo/display_modpack/issues/48 + return itemstack + elseif test[ndir] > 0 then itemstack:set_name(ndef.signs_other_dir) end itemstack = minetest.item_place(itemstack, placer, pointed_thing, ndir) @@ -145,7 +147,7 @@ signs_api.on_rotate = function(pos, node, player, mode, new_param2) -- each rotation. if mode == 1 then local ndef = minetest.registered_nodes[node.name] - if ndef.signs_other_dir then + if ndef and ndef.signs_other_dir then -- Switch direction node = {name = ndef.signs_other_dir, param1 = node.param1, param2 = node.param2} @@ -171,7 +173,7 @@ if display_api.is_rotation_restricted() then -- Otherwise use display_api's on_rotate function. if mode == 2 then local ndef = minetest.registered_nodes[node.name] - if ndef.signs_other_dir then + if ndef and ndef.signs_other_dir then minetest.swap_node(pos, {name = ndef.signs_other_dir, param1 = node.param1, param2 = node.param2}) display_api.update_entities(pos) @@ -210,7 +212,7 @@ function signs_api.register_sign(mod, name, model) on_construct = function(pos) local ndef = minetest.registered_nodes[minetest.get_node(pos).name] local meta = minetest.get_meta(pos) - meta:set_string("font", ndef.display_entities.font_name or + meta:set_string("font", ndef and ndef.display_entities.font_name or font_api.get_default_font_name()) signs_api.set_formspec(pos) display_api.on_construct(pos) From 1f31515cddb61d3a8bf589457deb2f33ced330a3 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 20:13:08 +0200 Subject: [PATCH 07/15] luacheck, remove old compatibility stuff --- .github/workflows/luacheck.yml | 10 +++++++++ .luacheckrc | 25 +++++++++++++++++++++++ boards/font_tinycurs.lua | 4 ++-- boards/init.lua | 6 +++--- display_api/deprecation.lua | 8 ++++---- display_api/display.lua | 37 +++------------------------------- font_api/deprecation.lua | 2 +- font_api/fallbacks.lua | 1 + font_api/font.lua | 12 +++++------ font_api/registry.lua | 1 + font_metro/init.lua | 8 ++++---- ontime_clocks/common.lua | 6 +++--- ontime_clocks/crafts.lua | 2 +- ontime_clocks/init.lua | 2 +- ontime_clocks/nodes.lua | 2 +- signs_api/init.lua | 35 ++------------------------------ steles/config.lua | 6 +++--- 17 files changed, 71 insertions(+), 96 deletions(-) create mode 100644 .github/workflows/luacheck.yml create mode 100644 .luacheckrc diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml new file mode 100644 index 0000000..5d79609 --- /dev/null +++ b/.github/workflows/luacheck.yml @@ -0,0 +1,10 @@ +name: luacheck +on: [push, pull_request] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: Roang-zero1/factorio-mod-luacheck@master + with: + luacheckrc_url: "" \ No newline at end of file diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..0439e78 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,25 @@ +unused_args = false + +ignore = { + "431", -- Shadowing an upvalue + "432", -- Shadowing an upvalue argument +} + +read_globals = { + "minetest", + "string", + "table", + "vector", + "default" +} + +globals = { + "boards", + "display_api", + "font_api", + "ontime_clocks", + "signs", + "signs_api", + "signs_road", + "steles" +} \ No newline at end of file diff --git a/boards/font_tinycurs.lua b/boards/font_tinycurs.lua index a9a323a..ec30ac2 100644 --- a/boards/font_tinycurs.lua +++ b/boards/font_tinycurs.lua @@ -7,7 +7,7 @@ released under CC-BY-SA license https://fontstruct.com/fontstructions/show/63155/tiny_cursive - + Derivative texture are under CC-BY-SA license Code is under LGPL v3 license --]] @@ -19,7 +19,7 @@ font_api.register_font('tinycurs', marginbottom = -2, linespacing = -4, height = 19, - widths = { + widths = { [0]=9, [32]=9, [33]=6, [34]=7, [35]=10, [36]=14, [37]=14, [38]=12, [39]=3, [40]=6, [41]=6, [42]=9, [43]=8, [44]=3, [45]=7, [46]=3, [47]=9, [48]=9, [49]=7, [50]=10, [51]=9, [52]=9, [53]=10, [54]=10, [55]=9, [56]=10, [57]=8, [58]=5, [59]=5, [60]=8, [61]=8, [62]=8, [63]=8, [64]=12, [65]=9, [66]=7, [67]=9, [68]=10, [69]=8, [70]=8, [71]=8, [72]=10, [73]=7, [74]=8, [75]=9, [76]=9, [77]=12, [78]=10, [79]=9, [80]=9, [81]=9, [82]=11, [83]=11, [84]=8, [85]=11, [86]=11, [87]=12, [88]=12, [89]=11, [90]=11, [91]=8, [92]=5, [93]=8, [94]=8, [95]=8, [96]=5, [97]=6, [98]=6, [99]=6, [100]=7, [101]=6, [102]=5, [103]=6, [104]=6, [105]=4, [106]=5, [107]=7, [108]=5, [109]=9, [110]=8, [111]=6, [112]=9, [113]=8, [114]=7, [115]=7, [116]=6, [117]=8, [118]=8, [119]=11, [120]=10, [121]=8, [122]=8, [123]=8, [124]=6, [125]=9, [126]=10, [8216]=4, [8217]=4, [8220]=6, [8221]=6 }, } diff --git a/boards/init.lua b/boards/init.lua index 51e9f6f..6d1155e 100644 --- a/boards/init.lua +++ b/boards/init.lua @@ -49,7 +49,7 @@ local function on_receive_fields(pos, formname, fields, player) end end -models = { +local models = { black_board = { depth = 1/16, width = 1, height = 1, entity_fields = { @@ -132,7 +132,7 @@ minetest.register_craft( output = "boards:black_board", recipe = { {"group:wood", "group:stone", "dye:black"}, - } + } }) minetest.register_craft( @@ -140,6 +140,6 @@ minetest.register_craft( output = "boards:green_board", recipe = { {"group:wood", "group:stone", "dye:dark_green"}, - } + } }) diff --git a/display_api/deprecation.lua b/display_api/deprecation.lua index b041f6f..36e1ecd 100644 --- a/display_api/deprecation.lua +++ b/display_api/deprecation.lua @@ -19,17 +19,17 @@ -- Deprecation -function deprecated_group(deprecated_group, replacement_group) +local function deprecated_group(old_group, replacement_group) for name, ndef in pairs(minetest.registered_nodes) do - if ndef.groups and ndef.groups[deprecated_group] then + if ndef.groups and ndef.groups[old_group] then minetest.log("warning", string.format( 'Node %s belongs to deprecated "%s" group which should be replaced with new "%s" group.', - name, deprecated_group, replacement_group)) + name, old_group, replacement_group)) end end end -function deprecated_global_table(deprecated_global_name, replacement_global_name) +local function deprecated_global_table(deprecated_global_name, replacement_global_name) assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.") assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.") assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.") diff --git a/display_api/display.lua b/display_api/display.lua index fa7c854..a88cbb1 100644 --- a/display_api/display.lua +++ b/display_api/display.lua @@ -65,9 +65,7 @@ local function compute_values(r) for _ = 1, r.x do d, w, h = rx(d), rx(w), rx(h) end for _ = 1, r.y do d, w, h = ry(d), ry(w), ry(h) end - return { - rotation=r, depth=d, width=w, height=h, - restricted=(r.x==0 and r.z==0) } + return {rotation=r, depth=d, width=w, height=h} end for i, r in pairs(facedir_rotations) do @@ -78,25 +76,6 @@ for i, r in pairs(wallmounted_rotations) do wallmounted_values[i] = compute_values(r) end --- Detect rotation restriction -local rotation_restricted = nil -minetest.register_entity('display_api:dummy_entity', { - collisionbox = { 0, 0, 0, 0, 0, 0 }, - visual = "upright_sprite", - textures = {} }) - -function display_api.is_rotation_restricted() - if rotation_restricted == nil then - local objref = minetest.add_entity( - {x=0, y=0, z=0}, 'display_api:dummy_entity') - if objref then - rotation_restricted = objref.set_rotation == nil - objref:remove() - end - end - return rotation_restricted -end - -- Clip position property to maximum entity position local function clip_pos_prop(posprop) @@ -243,16 +222,6 @@ function display_api.on_place(itemstack, placer, pointed_thing, override_param2) z = pointed_thing.under.z - pointed_thing.above.z, } - local rotation_restriction = display_api.is_rotation_restricted() - - if rotation_restriction then - -- If item is not placed on a wall, use the player's view direction instead - if dir.x == 0 and dir.z == 0 then - dir = placer:get_look_dir() - end - dir.y = 0 - end - local param2 = 0 if ndef then if ndef.paramtype2 == "wallmounted" or @@ -261,7 +230,7 @@ function display_api.on_place(itemstack, placer, pointed_thing, override_param2) elseif ndef.paramtype2 == "facedir" or ndef.paramtype2 == "colorfacedir" then - param2 = minetest.dir_to_facedir(dir, not rotation_restriction) + param2 = minetest.dir_to_facedir(dir, true) end end return minetest.item_place(itemstack, placer, pointed_thing, @@ -291,7 +260,7 @@ function display_api.on_rotate(pos, node, user, _, new_param2) return end - if ov.restricted or not display_api.is_rotation_restricted() then + if ov.restricted then minetest.swap_node(pos, node) display_api.update_entities(pos) return true diff --git a/font_api/deprecation.lua b/font_api/deprecation.lua index 1ffed11..93cf365 100644 --- a/font_api/deprecation.lua +++ b/font_api/deprecation.lua @@ -18,7 +18,7 @@ -- Deprecation -function deprecated_global_table(deprecated_global_name, replacement_global_name) +local function deprecated_global_table(deprecated_global_name, replacement_global_name) assert(type(deprecated_global_name) == 'string', "deprecated_global_name should be a string.") assert(type(replacement_global_name) == 'string', "replacement_global_name should be a string.") assert(deprecated_global_name ~= '', "deprecated_global_name should not be empty.") diff --git a/font_api/fallbacks.lua b/font_api/fallbacks.lua index da3ff03..a801f7b 100644 --- a/font_api/fallbacks.lua +++ b/font_api/fallbacks.lua @@ -19,6 +19,7 @@ -- This is the unicode char fallback map. If a char is not present in -- font, this maps indicates which char to try to use instead next. +-- luacheck: ignore return { -- Lowercase chars ['a'] = 'A', ['b'] = 'B', ['c'] = 'C', ['d'] = 'D', diff --git a/font_api/font.lua b/font_api/font.lua index 5794867..d7b67d7 100644 --- a/font_api/font.lua +++ b/font_api/font.lua @@ -212,7 +212,7 @@ end -- @return Texture string function Font:render(text, texturew, textureh, style) - local style = style or {} + style = style or {} -- Split text into lines (and limit to style.lines # of lines) local lines = {} @@ -243,17 +243,17 @@ function Font:render(text, texturew, textureh, style) y = y + (self.margintop or 0) - for _, line in pairs(lines) do + for _, l in pairs(lines) do if style.halign == "left" then x = 0 elseif style.halign == "right" then - x = texturew - line.width + x = texturew - l.width else - x = (texturew - line.width) / 2 + x = (texturew - l.width) / 2 end - while line.text ~= '' do - codepoint, line.text = self:get_next_char(line.text) + while l.text ~= '' do + codepoint, l.text = self:get_next_char(l.text) if codepoint == nil then return '' end -- UTF Error -- Add image only if it is visible (at least partly) diff --git a/font_api/registry.lua b/font_api/registry.lua index e183675..b760502 100644 --- a/font_api/registry.lua +++ b/font_api/registry.lua @@ -60,6 +60,7 @@ local function get_default_font() -- If failed, chose first font if default_font == nil then + -- luacheck: ignore 512 for _, font in pairs(font_api.registered_fonts) do default_font = font break diff --git a/font_metro/init.lua b/font_metro/init.lua index ec9a918..c708027 100644 --- a/font_metro/init.lua +++ b/font_metro/init.lua @@ -1,11 +1,11 @@ --[[ Metro font for Font API - - Original font Metro Sans - by Christian Munk (CMunk) + + Original font Metro Sans + by Christian Munk (CMunk) released under CC-BY-SA license - + https://fontstruct.com/fontstructions/show/723864/metro_sans Derivative textures and code are under CC-BY-SA license diff --git a/ontime_clocks/common.lua b/ontime_clocks/common.lua index cced299..2c7639f 100644 --- a/ontime_clocks/common.lua +++ b/ontime_clocks/common.lua @@ -1,5 +1,5 @@ --[[ - ontime_clocks mod for Minetest - Clock nodes displaying ingame time + ontime_clocks mod for Minetest - Clock nodes displaying ingame time (c) Pierre-Yves Rollo This file is part of ontime_clocks. @@ -34,7 +34,7 @@ function ontime_clocks.get_m12() end function ontime_clocks.get_digital_properties(color_off, color_on, hour, minute) - return + return { textures={"ontime_clocks_digital_background.png^[colorize:"..color_off .."^([combine:21x7" @@ -51,7 +51,7 @@ end function ontime_clocks.get_needles_properties(color, size, hour, minute) return { - textures={"[combine:"..size.."x"..size + textures={"[combine:"..size.."x"..size ..":0,"..(-size*hour).."=ontime_clocks_needle_h"..size..".png" ..":0,"..(-size*minute).."=ontime_clocks_needle_m"..size..".png" .."^[colorize:"..color}, diff --git a/ontime_clocks/crafts.lua b/ontime_clocks/crafts.lua index c94352a..9eab3a9 100644 --- a/ontime_clocks/crafts.lua +++ b/ontime_clocks/crafts.lua @@ -1,5 +1,5 @@ --[[ - ontime_clocks mod for Minetest - Clock nodes displaying ingame time + ontime_clocks mod for Minetest - Clock nodes displaying ingame time (c) Pierre-Yves Rollo This file is part of ontime_clocks. diff --git a/ontime_clocks/init.lua b/ontime_clocks/init.lua index 97e7154..83edcdb 100644 --- a/ontime_clocks/init.lua +++ b/ontime_clocks/init.lua @@ -1,5 +1,5 @@ --[[ - ontime_clocks mod for Minetest - Clock nodes displaying ingame time + ontime_clocks mod for Minetest - Clock nodes displaying ingame time (c) Pierre-Yves Rollo This file is part of ontime_clocks. diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua index c530e50..a84ee16 100644 --- a/ontime_clocks/nodes.lua +++ b/ontime_clocks/nodes.lua @@ -227,7 +227,7 @@ minetest.register_node("ontime_clocks:frameless_white", { minetest.register_lbm({ name = "ontime_clocks:nodetimer_init", - nodenames = {"ontime_clocks:green_digital", "ontime_clocks:red_digital", "ontime_clocks:white", + nodenames = {"ontime_clocks:green_digital", "ontime_clocks:red_digital", "ontime_clocks:white", "ontime_clocks:frameless_black", "ontime_clocks:frameless_gold", "ontime_clocks:frameless_white"}, run_at_every_load = true, action = function(pos) diff --git a/signs_api/init.lua b/signs_api/init.lua index 4d0ac07..5622a3b 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -89,7 +89,6 @@ end function signs_api.on_place_direction(itemstack, placer, pointed_thing) local name = itemstack:get_name() local ndef = minetest.registered_nodes[name] - local restriction = display_api.is_rotation_restricted() local bdir = { x = pointed_thing.under.x - pointed_thing.above.x, @@ -101,24 +100,14 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing) local ndir, test if ndef and ndef.paramtype2 == "facedir" then - -- If legacy mode, only accept upright nodes - if restriction and bdir.x == 0 and bdir.z == 0 then - -- Ceiling or floor pointed (facedir chosen from player dir) - ndir = minetest.dir_to_facedir({x=pdir.x, y=0, z=pdir.z}) - else - -- Wall pointed or no rotation restriction - ndir = minetest.dir_to_facedir(bdir, not restriction) - end + -- Wall pointed + ndir = minetest.dir_to_facedir(bdir, true) test = { [0]=-pdir.x, pdir.z, pdir.x, -pdir.z, -pdir.x, [8]=pdir.x } end if ndef and ndef.paramtype2 == "wallmounted" then ndir = minetest.dir_to_wallmounted(bdir) - -- If legacy mode, only accept upright nodes - if restriction and (ndir == 0 or ndir == 1) then - ndir = minetest.dir_to_wallmounted({x=pdir.x, y=0, z=pdir.z}) - end test = { [0]=-pdir.x, -pdir.x, pdir.z, -pdir.z, -pdir.x, pdir.x} end @@ -141,7 +130,6 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing) end -- Handles screwdriver rotation --- (see "if" block below for rotation restriction mode). signs_api.on_rotate = function(pos, node, player, mode, new_param2) -- If rotation mode is 1 and sign is directional, swap direction between -- each rotation. @@ -165,25 +153,6 @@ signs_api.on_rotate = function(pos, node, player, mode, new_param2) return display_api.on_rotate(pos, node, player, mode, new_param2) end --- Legacy mode with rotation restriction --- TODO:When MT < 5.0 no more in use, to be removed -if display_api.is_rotation_restricted() then - signs_api.on_rotate = function(pos, node, player, mode, new_param2) - -- If rotation mode is 2 and sign is directional, swap direction. - -- Otherwise use display_api's on_rotate function. - if mode == 2 then - local ndef = minetest.registered_nodes[node.name] - if ndef and ndef.signs_other_dir then - minetest.swap_node(pos, {name = ndef.signs_other_dir, - param1 = node.param1, param2 = node.param2}) - display_api.update_entities(pos) - return true - end - end - return display_api.on_rotate(pos, node, player, mode, new_param2) - end -end - function signs_api.register_sign(mod, name, model) -- Default fields local fields = { diff --git a/steles/config.lua b/steles/config.lua index 6cd6c62..e53d9be 100644 --- a/steles/config.lua +++ b/steles/config.lua @@ -21,10 +21,10 @@ local S = steles.S steles.materials = { - 'default:stone', - 'default:sandstone', + 'default:stone', + 'default:sandstone', 'default:desert_stone', - 'technic:marble', + 'technic:marble', 'technic:granite', } From d8b128961f60df803accfb45dbd20a645311e58d Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 20:15:01 +0200 Subject: [PATCH 08/15] ignore too long lines --- .luacheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.luacheckrc b/.luacheckrc index 0439e78..d151f68 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -3,6 +3,7 @@ unused_args = false ignore = { "431", -- Shadowing an upvalue "432", -- Shadowing an upvalue argument + "631", -- Line is too long } read_globals = { From 877861a204db9a9d5f0f3829eb74360d3a0af0b9 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 20:58:18 +0200 Subject: [PATCH 09/15] escape formspecs correctly --- boards/init.lua | 7 ++++--- boards/locale/boards.de.tr | 4 ++-- boards/locale/boards.fr.tr | 4 ++-- boards/locale/boards.ms.tr | 4 ++-- boards/locale/template.txt | 4 ++-- signs/locale/signs.de.txt | 12 ++++++------ signs/locale/signs.fr.tr | 12 ++++++------ signs/locale/signs.ms.tr | 12 ++++++------ signs/locale/template.txt | 12 ++++++------ signs/nodes.lua | 13 +++++++------ signs_api/init.lua | 11 ++++++----- steles/nodes.lua | 5 +++-- 12 files changed, 52 insertions(+), 48 deletions(-) diff --git a/boards/init.lua b/boards/init.lua index 6d1155e..b413276 100644 --- a/boards/init.lua +++ b/boards/init.lua @@ -24,6 +24,7 @@ boards.path = minetest.get_modpath(boards.name) -- Translation support local S = minetest.get_translator(boards.name) +local FS = function(...) return minetest.formspec_escape(S(...)) end -- Load font dofile(boards.path.."/font_tinycurs.lua") @@ -32,9 +33,9 @@ local function set_formspec(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", "size[6,4]"..default.gui_bg..default.gui_bg_img..default.gui_slots.. - "textarea[0.5,0.7;5.5,3;display_text;"..S("Text")..";${display_text}]".. - "button_exit[3,3.5;2,1;ok;"..S("Write").."]".. - "button_exit[1,3.5;2,1;wipe;"..S("Wipe").."]") + "textarea[0.5,0.7;5.5,3;display_text;"..FS("Text")..";${display_text}]".. + "button_exit[3,3.5;2,1;ok;"..FS("Write").."]".. + "button_exit[1,3.5;2,1;wipe;"..FS("Wipe").."]") end -- On boards, everyone is allowed to write and wipe diff --git a/boards/locale/boards.de.tr b/boards/locale/boards.de.tr index eaf9edb..ab81fd3 100644 --- a/boards/locale/boards.de.tr +++ b/boards/locale/boards.de.tr @@ -1,6 +1,6 @@ # textdomain: boards +Black board=Schwarze Tafel +Green board=Grüne Tafel Text=Text Write=Schreiben Wipe=Abwischen -Black board=Schwarze Tafel -Green board=Grüne Tafel diff --git a/boards/locale/boards.fr.tr b/boards/locale/boards.fr.tr index ad6f11b..6553436 100644 --- a/boards/locale/boards.fr.tr +++ b/boards/locale/boards.fr.tr @@ -1,6 +1,6 @@ # textdomain: boards +Black board=Tableau noir +Green board=Tableau vert Text= Write= Wipe= -Black board=Tableau noir -Green board=Tableau vert diff --git a/boards/locale/boards.ms.tr b/boards/locale/boards.ms.tr index 7c5c629..49bdbee 100644 --- a/boards/locale/boards.ms.tr +++ b/boards/locale/boards.ms.tr @@ -1,6 +1,6 @@ # textdomain: boards +Black board=Papan hitam +Green board= Text= Write= Wipe= -Black board=Papan hitam -Green board= diff --git a/boards/locale/template.txt b/boards/locale/template.txt index fac8341..104a8e6 100644 --- a/boards/locale/template.txt +++ b/boards/locale/template.txt @@ -1,6 +1,6 @@ # textdomain: boards +Black board= +Green board= Text= Write= Wipe= -Black board= -Green board= diff --git a/signs/locale/signs.de.txt b/signs/locale/signs.de.txt index 4ea4239..a5b7cc5 100644 --- a/signs/locale/signs.de.txt +++ b/signs/locale/signs.de.txt @@ -1,4 +1,10 @@ # textdomain: signs +Wooden sign= +Wooden long sign= +Wooden direction sign= +Poster= +Small label= +Label= Close=Schließen Edit=Bearbeiten Title=Titel @@ -6,9 +12,3 @@ Text=Text Title font=Titel Schriftart Write=Schreiben (right-click to read more text)=(Rechtsklick für mehr Text) -Wooden sign=Hölzernes Schild -Wooden long sign=Langes hölzernes Schild -Wooden direction sign=Hölzerner Wegweiser -Poster=Poster -Small label=Kleines Etikett -Label=Etikett diff --git a/signs/locale/signs.fr.tr b/signs/locale/signs.fr.tr index 9f189f2..4d753b8 100644 --- a/signs/locale/signs.fr.tr +++ b/signs/locale/signs.fr.tr @@ -1,4 +1,10 @@ # textdomain: signs +Wooden sign= +Wooden long sign= +Wooden direction sign=Panneau de direction en bois +Poster=Affiche +Small label= +Label= Close= Edit= Title= @@ -6,9 +12,3 @@ Text= Title font= Write= (right-click to read more text)=(Clic-droit pour afficher le texte entier) -Wooden sign= -Wooden long sign= -Wooden direction sign=Panneau de direction en bois -Poster=Affiche -Small label= -Label= diff --git a/signs/locale/signs.ms.tr b/signs/locale/signs.ms.tr index 272234f..5b63ffa 100644 --- a/signs/locale/signs.ms.tr +++ b/signs/locale/signs.ms.tr @@ -1,4 +1,10 @@ # textdomain: signs +Wooden sign= +Wooden long sign= +Wooden direction sign=Papan tanda arah kayu +Poster=Poster +Small label= +Label= Close= Edit= Title= @@ -6,9 +12,3 @@ Text= Title font= Write= (right-click to read more text)=(klik-kanan untuk baca teks penuh) -Wooden sign= -Wooden long sign= -Wooden direction sign=Papan tanda arah kayu -Poster=Poster -Small label= -Label= diff --git a/signs/locale/template.txt b/signs/locale/template.txt index 4545092..c0ff5ec 100644 --- a/signs/locale/template.txt +++ b/signs/locale/template.txt @@ -1,4 +1,10 @@ # textdomain: signs +Wooden sign= +Wooden long sign= +Wooden direction sign= +Poster= +Small label= +Label= Close= Edit= Title= @@ -6,9 +12,3 @@ Text= Title font= Write= (right-click to read more text)= -Wooden sign= -Wooden long sign= -Wooden direction sign= -Poster= -Small label= -Label= diff --git a/signs/nodes.lua b/signs/nodes.lua index 9826930..7f5b88c 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -19,6 +19,7 @@ --]] local S = signs.S +local FS = function(...) return minetest.formspec_escape(S(...)) end -- Poster specific formspec local function display_poster(pos, node, player) @@ -46,11 +47,11 @@ local function display_poster(pos, node, player) minetest.formspec_escape(meta:get_string("text")))) if minetest.is_protected(pos, player:get_player_name()) then - fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, S("Close")) + fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, FS("Close")) else fs = string.format( "%sbutton[1,8;2,1;edit;%s]button_exit[4,8;2,1;ok;%s]", - fs, S("Edit"), S("Close")) + fs, FS("Edit"), FS("Close")) end minetest.show_formspec(player:get_player_name(), fname, fs) end @@ -69,10 +70,10 @@ local function edit_poster(pos, node, player) textarea[0.5,1.7;6,6;text;%s;%s] button[1.25,7;2,1;font;%s] button_exit[3.25,7;2,1;write;%s]]=], - default.gui_bg, default.gui_bg_img, default.gui_slots, S("Title"), + default.gui_bg, default.gui_bg_img, default.gui_slots, FS("Title"), minetest.formspec_escape(meta:get_string("display_text")), - S("Text"), minetest.formspec_escape(meta:get_string("text")), - S("Title font"), S("Write")) + FS("Text"), minetest.formspec_escape(meta:get_string("text")), + FS("Title font"), FS("Write")) minetest.show_formspec(player:get_player_name(), fname, fs) end end @@ -94,7 +95,7 @@ local function on_receive_fields_poster(pos, formname, fields, player) meta:set_string("display_text", fields.display_text) meta:set_string("text", fields.text) meta:set_string("infotext", "\""..fields.display_text - .."\"\n"..S("(right-click to read more text)")) + .."\"\n"..FS("(right-click to read more text)")) display_api.update_entities(pos) end if (fields.write or fields.key_enter) then diff --git a/signs_api/init.lua b/signs_api/init.lua index 5622a3b..325ba78 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -24,6 +24,7 @@ signs_api.path = minetest.get_modpath(signs_api.name) -- Translation support local S = minetest.get_translator(signs_api.name) +local FS = function(...) return minetest.formspec_escape(S(...)) end function signs_api.set_display_text(pos, text, font) local meta = minetest.get_meta(pos) @@ -48,22 +49,22 @@ function signs_api.set_formspec(pos) local fs, y if maxlines == 1 then - fs = "field[0.5,0.7;5.5,1;display_text;"..S("Text").. + fs = "field[0.5,0.7;5.5,1;display_text;"..FS("Text").. ";${display_text}]" y = 1.2 else local extralabel = "" if maxlines then - extralabel = S(" (first @1 lines only)", maxlines) + extralabel = FS(" (first @1 lines only)", maxlines) end - fs = "textarea[0.5,0.7;5.5,2;display_text;"..S("Text").."".. + fs = "textarea[0.5,0.7;5.5,2;display_text;"..FS("Text").."".. extralabel..";${display_text}]" y = 2.4 end - fs = fs.."button[1,"..y..";2,1;font;"..S("Font").."]" - fs = fs.."button_exit[3,"..y..";2,1;ok;"..S("Write").."]" + fs = fs.."button[1,"..y..";2,1;font;"..FS("Font").."]" + fs = fs.."button_exit[3,"..y..";2,1;ok;"..FS("Write").."]" y = y + 0.8 fs = "size[6,"..y.."]"..default.gui_bg.. default.gui_bg_img..default.gui_slots..fs diff --git a/steles/nodes.lua b/steles/nodes.lua index 7764681..a2aaa7d 100644 --- a/steles/nodes.lua +++ b/steles/nodes.lua @@ -19,6 +19,7 @@ --]] local S = steles.S +local FS = function(...) return minetest.formspec_escape(S(...)) end display_api.register_display_entity("steles:text") @@ -68,8 +69,8 @@ for i, material in ipairs(steles.materials) do button[1,3;2,1;font;%s] button_exit[3,3;2,1;ok;%s]]=], default.gui_bg, default.gui_bg_img, default.gui_slots, - S("Displayed text (3 lines max)"), - S("Font"), S("Write"))) + FS("Displayed text (3 lines max)"), + FS("Font"), FS("Write"))) display_api.on_construct(pos) end, on_destruct = display_api.on_destruct, From 14394b2a0fc375c5757d108b68f650adec881f19 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sun, 11 Jun 2023 21:33:13 +0200 Subject: [PATCH 10/15] fix filename... --- signs/locale/{signs.de.txt => signs.de.tr} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename signs/locale/{signs.de.txt => signs.de.tr} (51%) diff --git a/signs/locale/signs.de.txt b/signs/locale/signs.de.tr similarity index 51% rename from signs/locale/signs.de.txt rename to signs/locale/signs.de.tr index a5b7cc5..10f1100 100644 --- a/signs/locale/signs.de.txt +++ b/signs/locale/signs.de.tr @@ -1,10 +1,10 @@ # textdomain: signs -Wooden sign= -Wooden long sign= -Wooden direction sign= -Poster= -Small label= -Label= +Wooden sign=Hölzernes Schild +Wooden long sign=Langes hölzernes Schild +Wooden direction sign=Hölzerner Wegweiser +Poster=Poster +Small label=Kleines Etikett +Label=Etikett Close=Schließen Edit=Bearbeiten Title=Titel From 78218051f4a16eef636044bd2f48331e20ee892d Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Mon, 12 Jun 2023 18:41:45 +0200 Subject: [PATCH 11/15] add translation support to font formspec --- font_api/fontform.lua | 7 +++++-- font_api/init.lua | 3 +++ font_api/locale/font_api.de.tr | 2 ++ font_api/locale/template.txt | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 font_api/locale/font_api.de.tr create mode 100644 font_api/locale/template.txt diff --git a/font_api/fontform.lua b/font_api/fontform.lua index b7e6724..d019fba 100644 --- a/font_api/fontform.lua +++ b/font_api/fontform.lua @@ -16,6 +16,9 @@ along with this program. If not, see . --]] +local S = font_api.S +local FS = function(...) return minetest.formspec_escape(S(...)) end + local modname = minetest.get_current_modname() local contexts = {} @@ -101,9 +104,9 @@ local function show_font_formspec(playername) table.sort(fonts) local fs = string.format( - "size[4,%s]%s%s%sbutton_exit[0,%s;4,1;cancel;Cancel]", + "size[4,%s]%s%s%sbutton_exit[0,%s;4,1;cancel;%s]", #fonts + 0.8, default.gui_bg, default.gui_bg_img, default.gui_slots, - #fonts) + #fonts, FS("Cancel")) for line = 1, #fonts do local font = font_api.get_font(fonts[line]) diff --git a/font_api/init.lua b/font_api/init.lua index c5858f4..a0a2969 100644 --- a/font_api/init.lua +++ b/font_api/init.lua @@ -23,6 +23,9 @@ font_api = {} font_api.name = minetest.get_current_modname() font_api.path = minetest.get_modpath(font_api.name) +-- Translation support +font_api.S = minetest.get_translator(font_api.name) + -- Inclusions ------------- diff --git a/font_api/locale/font_api.de.tr b/font_api/locale/font_api.de.tr new file mode 100644 index 0000000..5536527 --- /dev/null +++ b/font_api/locale/font_api.de.tr @@ -0,0 +1,2 @@ +# textdomain: font_api +Cancel=Schließen diff --git a/font_api/locale/template.txt b/font_api/locale/template.txt new file mode 100644 index 0000000..a2ffa72 --- /dev/null +++ b/font_api/locale/template.txt @@ -0,0 +1,2 @@ +# textdomain: font_api +Cancel= From d6a86c30e7a97d602606150722c52e033eff6189 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Mon, 12 Jun 2023 21:16:24 +0200 Subject: [PATCH 12/15] fix signs:wooden_right_sign collisionbox --- signs/nodes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signs/nodes.lua b/signs/nodes.lua index 7f5b88c..e98b690 100644 --- a/signs/nodes.lua +++ b/signs/nodes.lua @@ -168,7 +168,7 @@ local models = { drawtype = "mesh", mesh = "signs_dir_right.obj", selection_box = { type="fixed", fixed = {-0.5, -7/32, 0.5, 7/16, 7/32, 7/16}}, - collision_box = { type="fixed", fixed = {-0,5, -7/32, 0.5, 7/16, 7/32, 7/16}}, + collision_box = { type="fixed", fixed = {-7/16, -7/32, 0.5, 0.5, 7/32, 7/16}}, groups= { dig_immediate = 2 }, }, }, From 596e6d74908a6c7e212d43e0785339625d4b9f49 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Mon, 12 Jun 2023 21:29:11 +0200 Subject: [PATCH 13/15] fix boards preview in itemframes --- boards/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/init.lua b/boards/init.lua index b413276..e27e8da 100644 --- a/boards/init.lua +++ b/boards/init.lua @@ -66,6 +66,7 @@ local models = { tiles = { "default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png", "board_black_front.png" }, + _itemframe_texture = "board_black_front.png", drawtype = "nodebox", node_box = { type = "fixed", @@ -101,6 +102,7 @@ local models = { "default_wood.png", "default_wood.png", "default_wood.png", "board_green_front.png" }, drawtype = "nodebox", + _itemframe_texture = "board_green_front.png", node_box = { type = "fixed", fixed = { From 1714a3d998a556498af3b19d03dffcc88cfab42d Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Tue, 13 Jun 2023 18:15:29 +0200 Subject: [PATCH 14/15] fix node rotation --- display_api/display.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/display_api/display.lua b/display_api/display.lua index a88cbb1..2baef11 100644 --- a/display_api/display.lua +++ b/display_api/display.lua @@ -260,13 +260,9 @@ function display_api.on_rotate(pos, node, user, _, new_param2) return end - if ov.restricted then - minetest.swap_node(pos, node) - display_api.update_entities(pos) - return true - else - return false - end + minetest.swap_node(pos, node) + display_api.update_entities(pos) + return true end --- Creates display entity with some fields and the on_activate callback From 3590f5656791f3a7860f5de24d2bb7de89229971 Mon Sep 17 00:00:00 2001 From: Niklp09 <89982526+Niklp09@users.noreply.github.com> Date: Sat, 8 Jul 2023 10:29:35 +0200 Subject: [PATCH 15/15] don't run LBM always --- ontime_clocks/nodes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua index a84ee16..b924086 100644 --- a/ontime_clocks/nodes.lua +++ b/ontime_clocks/nodes.lua @@ -229,7 +229,7 @@ minetest.register_lbm({ name = "ontime_clocks:nodetimer_init", nodenames = {"ontime_clocks:green_digital", "ontime_clocks:red_digital", "ontime_clocks:white", "ontime_clocks:frameless_black", "ontime_clocks:frameless_gold", "ontime_clocks:frameless_white"}, - run_at_every_load = true, + run_at_every_load = false, action = function(pos) local timer = minetest.get_node_timer(pos) timer:start(5)