mirror of
https://github.com/pyrollo/display_modpack.git
synced 2025-10-21 03:05:23 +02:00
Add luacheck, update translations, replace ABMs, bug fixes (#1)
* luacheck, mt 5 translation, german translation, maintenance * fix luacheck warnings * Fix digital clock nodebox and texture * Fix luacheck usage * Add comment why fonts are not split into several lines
This commit is contained in:
@@ -18,9 +18,6 @@
|
||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||
--]]
|
||||
|
||||
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)
|
||||
|
@@ -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")
|
||||
|
@@ -1,45 +0,0 @@
|
||||
|
||||
-- Fallback functions for when `intllib` is not installed.
|
||||
-- Code released under Unlicense <http://unlicense.org>.
|
||||
|
||||
-- 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
|
@@ -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 <EMAIL@ADDRESS>, 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 <peppy@twang-factory.com>\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"
|
@@ -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) <translation@mnh48.moe>, 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 <translation@mnh48.moe>\n"
|
||||
"Language-Team: Malay <translation@mnh48.moe>\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"
|
14
signs/locale/signs.de.tr
Normal file
14
signs/locale/signs.de.tr
Normal file
@@ -0,0 +1,14 @@
|
||||
# textdomain: signs
|
||||
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
|
||||
Text=Text
|
||||
Title font=Titel Schriftart
|
||||
Write=Schreiben
|
||||
(right-click to read more text)=(Rechtsklick für mehr Text)
|
14
signs/locale/signs.fr.tr
Normal file
14
signs/locale/signs.fr.tr
Normal file
@@ -0,0 +1,14 @@
|
||||
# textdomain: signs
|
||||
Wooden sign=
|
||||
Wooden long sign=
|
||||
Wooden direction sign=Panneau de direction en bois
|
||||
Poster=Affiche
|
||||
Small label=
|
||||
Label=
|
||||
Close=
|
||||
Edit=
|
||||
Title=
|
||||
Text=
|
||||
Title font=
|
||||
Write=
|
||||
(right-click to read more text)=(Clic-droit pour afficher le texte entier)
|
14
signs/locale/signs.ms.tr
Normal file
14
signs/locale/signs.ms.tr
Normal file
@@ -0,0 +1,14 @@
|
||||
# textdomain: signs
|
||||
Wooden sign=
|
||||
Wooden long sign=
|
||||
Wooden direction sign=Papan tanda arah kayu
|
||||
Poster=Poster
|
||||
Small label=
|
||||
Label=
|
||||
Close=
|
||||
Edit=
|
||||
Title=
|
||||
Text=
|
||||
Title font=
|
||||
Write=
|
||||
(right-click to read more text)=(klik-kanan untuk baca teks penuh)
|
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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 ""
|
14
signs/locale/template.txt
Normal file
14
signs/locale/template.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
# textdomain: signs
|
||||
Wooden sign=
|
||||
Wooden long sign=
|
||||
Wooden direction sign=
|
||||
Poster=
|
||||
Small label=
|
||||
Label=
|
||||
Close=
|
||||
Edit=
|
||||
Title=
|
||||
Text=
|
||||
Title font=
|
||||
Write=
|
||||
(right-click to read more text)=
|
@@ -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
|
||||
|
@@ -18,8 +18,8 @@
|
||||
along with signs. If not, see <http://www.gnu.org/licenses/>.
|
||||
--]]
|
||||
|
||||
local S = signs.intllib
|
||||
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||
local S = signs.S
|
||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
||||
|
||||
-- Poster specific formspec
|
||||
local function display_poster(pos, node, player)
|
||||
@@ -47,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, F("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, F("Edit"), F("Close"))
|
||||
fs, FS("Edit"), FS("Close"))
|
||||
end
|
||||
minetest.show_formspec(player:get_player_name(), fname, fs)
|
||||
end
|
||||
@@ -70,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, F("Title"),
|
||||
default.gui_bg, default.gui_bg_img, default.gui_slots, FS("Title"),
|
||||
minetest.formspec_escape(meta:get_string("display_text")),
|
||||
F("Text"), minetest.formspec_escape(meta:get_string("text")),
|
||||
F("Title font"), F("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
|
||||
@@ -95,17 +95,17 @@ 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
|
||||
display_poster(pos, node, player)
|
||||
elseif (fields.font) then
|
||||
font_api.show_font_list(player, pos, function (playername, pos)
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
local node = minetest.get_node(pos)
|
||||
if player and node then
|
||||
edit_poster(pos, node, player)
|
||||
font_api.show_font_list(player, pos, function (playername, npos)
|
||||
local user = minetest.get_player_by_name(playername)
|
||||
local node2 = minetest.get_node(npos)
|
||||
if user and node2 then
|
||||
edit_poster(npos, node2, user)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -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 },
|
||||
},
|
||||
},
|
||||
|
@@ -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
|
Reference in New Issue
Block a user