1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-14 16:25:20 +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:
Niklp
2023-07-24 09:59:26 +02:00
committed by GitHub
parent e0e0305836
commit 1440f35fa6
91 changed files with 415 additions and 1465 deletions

10
.github/workflows/luacheck.yml vendored Normal file
View File

@@ -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: ""

19
.luacheckrc Normal file
View File

@@ -0,0 +1,19 @@
unused_args = false
read_globals = {
"minetest",
"table",
"vector",
"default"
}
globals = {
"boards",
"display_api",
"font_api",
"ontime_clocks",
"signs",
"signs_api",
"signs_road",
"steles"
}

View File

@@ -1,7 +1,9 @@
# Display Modpack
Version 1.3.1
This modpack provides mods with dynamic display. Mods are :
Requires Minetest 5.0+
This modpack provides mods with dynamic display. Mods are:
- **[display_api](https://github.com/pyrollo/display_modpack/tree/master/display_api)**: A library for adding display entities to nodes;
- **[font_api](https://github.com/pyrollo/display_modpack/tree/master/font_api)**: A library for displaying fonts on entities;

View File

@@ -7,11 +7,13 @@
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
--]]
-- widths is not split into several lines, because the font is generated by 'make_font_lua.sh'
-- luacheck: ignore
font_api.register_font('tinycurs',
{
default = false, -- Don't register this font as a possible default font
@@ -19,7 +21,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
},
}

View File

@@ -22,10 +22,9 @@ 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)
local FS = function(...) return minetest.formspec_escape(S(...)) end
-- Load font
dofile(boards.path.."/font_tinycurs.lua")
@@ -34,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;"..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;"..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
@@ -51,7 +50,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 = {
@@ -67,6 +66,7 @@ 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",
@@ -79,6 +79,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,
},
},
@@ -98,6 +102,7 @@ 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 = {
@@ -109,6 +114,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,
},
},
@@ -126,7 +135,7 @@ minetest.register_craft(
output = "boards:black_board",
recipe = {
{"group:wood", "group:stone", "dye:black"},
}
}
})
minetest.register_craft(
@@ -134,6 +143,6 @@ minetest.register_craft(
output = "boards:green_board",
recipe = {
{"group:wood", "group:stone", "dye:dark_green"},
}
}
})

View File

@@ -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

View File

@@ -0,0 +1,6 @@
# textdomain: boards
Black board=Schwarze Tafel
Green board=Grüne Tafel
Text=Text
Write=Schreiben
Wipe=Abwischen

View File

@@ -0,0 +1,6 @@
# textdomain: boards
Black board=Tableau noir
Green board=Tableau vert
Text=
Write=
Wipe=

View File

@@ -0,0 +1,6 @@
# textdomain: boards
Black board=Papan hitam
Green board=
Text=
Write=
Wipe=

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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"
#: 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"

View File

@@ -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) <translation@mnh48.moe>, 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 <translation@mnh48.moe>\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 <translation@mnh48.moe>\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"

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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"
#: init.lua
msgid "Text"
msgstr ""
#: init.lua
msgid "Write"
msgstr ""
#: init.lua
msgid "Wipe"
msgstr ""
#: init.lua
msgid "Black board"
msgstr ""

View File

@@ -0,0 +1,6 @@
# textdomain: boards
Black board=
Green board=
Text=
Write=
Wipe=

View File

@@ -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

View File

@@ -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.")

View File

@@ -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,13 +260,9 @@ function display_api.on_rotate(pos, node, user, _, new_param2)
return
end
if ov.restricted or not display_api.is_rotation_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

View File

@@ -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.")

View File

@@ -53,7 +53,7 @@ return {
['×'] = 'x', ['Ý'] = 'Y',
-- Lower case accents
['à'] = 'a', ['à'] = 'a', ['á'] = 'a', ['â'] = 'a',
['à'] = 'a', ['á'] = 'a', ['â'] = 'a',
['ã'] = 'a', ['ä'] = 'a', ['å'] = 'a',
['æ'] = 'ae', ['ç'] = 'c',
['è'] = 'e', ['é'] = 'e', ['ê'] = 'e', ['ë'] = 'e',

View File

@@ -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)

View File

@@ -16,6 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
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])

View File

@@ -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
-------------

View File

@@ -0,0 +1,2 @@
# textdomain: font_api
Cancel=Schließen

View File

@@ -0,0 +1,2 @@
# textdomain: font_api
Cancel=

View File

@@ -58,12 +58,9 @@ local function get_default_font()
end
end
-- If failed, chose first font
-- If failed, choose the first registered font
if default_font == nil then
for _, font in pairs(font_api.registered_fonts) do
default_font = font
break
end
default_font = next(font_api.registered_fonts)
end
-- Error, no font registered

View File

@@ -1,16 +1,18 @@
--[[
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
--]]
-- widths is not split into several lines, because the font is generated by 'make_font_lua.sh'
-- luacheck: ignore
font_api.register_font(
'metro',
{

View File

@@ -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},

View File

@@ -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.

View File

@@ -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.
@@ -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")

View File

@@ -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

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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"
"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"

View File

@@ -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) <translation@mnh48.moe>, 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 <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"
#: 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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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"
#: 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 ""

View File

@@ -0,0 +1,7 @@
# textdomain: ontime_clocks
Green digital clock=
Red digital clock=
White clock=
Frameless clock=
Frameless gold clock=
Frameless white clock=

View File

@@ -2,4 +2,3 @@ name = ontime_clocks
title = Ontime Clocks
description = Clocks displaing real ingame time
depends = default,dye,display_api
optional_depends = intllib

View File

@@ -18,7 +18,18 @@
along with ontime_clocks. If not, see <http://www.gnu.org/licenses/>.
--]]
local S = ontime_clocks.intllib
local S = ontime_clocks.S
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", {
@@ -30,9 +41,9 @@ minetest.register_node("ontime_clocks:green_digital", {
drawtype = "nodebox",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
wall_top = { -7/16, 0.5, -7/32, 7/16, 13/32, 3/16 },
wall_bottom = { -7/16, -0.5, -3/16, 7/16, -13/32, 7/32 },
wall_side = {-0.5, -3/16, -7/16, -13/32, 7/32, 7/16},
wall_bottom = {-7/16, -0.5, -3/16, 7/16, -13/32, 7/32},
wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16}
},
tiles = {"ontime_clocks_digital.png"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
@@ -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", {
@@ -68,9 +74,9 @@ minetest.register_node("ontime_clocks:red_digital", {
drawtype = "nodebox",
node_box = {
type = "wallmounted",
wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
wall_side = {-0.5, -3/16, -7/16, -13/32, 7/32, 7/16},
wall_bottom = {-7/16, -0.5, -3/16, 7/16, -13/32, 7/32},
wall_top = {-7/16, 0.5, -7/32, 7/16, 13/32, 3/16}
},
tiles = {"ontime_clocks_digital.png"},
groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1},
@@ -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 = false,
action = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(5)
end
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 164 B

View File

@@ -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

View File

@@ -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)

View File

@@ -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")

View File

@@ -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

View File

@@ -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"

View File

@@ -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
View 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
View 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
View 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)

View File

@@ -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
View 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)=

View File

@@ -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

View File

@@ -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 },
},
},

View File

@@ -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

View File

@@ -22,10 +22,9 @@ 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)
local FS = function(...) return minetest.formspec_escape(S(...)) end
function signs_api.set_display_text(pos, text, font)
local meta = minetest.get_meta(pos)
@@ -50,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;"..F("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 = F(" (first %s lines only)"):format(maxlines)
extralabel = FS(" (first @1 lines only)", 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;"..FS("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;"..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
@@ -91,7 +90,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,
@@ -102,33 +100,25 @@ function signs_api.on_place_direction(itemstack, placer, pointed_thing)
local ndir, test
if 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
if ndef and ndef.paramtype2 == "facedir" then
-- 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.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
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
-- 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)
@@ -141,13 +131,12 @@ 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.
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}
@@ -165,25 +154,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.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 = {
@@ -212,7 +182,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)

View File

@@ -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

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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
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"

View File

@@ -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) <translation@mnh48.moe>, 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 <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
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"

View File

@@ -0,0 +1,5 @@
# textdomain: signs_api
Text=Text
(first @1 lines only)= (nur die ersten @1 Zeilen)
Font=Schriftart
Write=Schreiben

View File

@@ -0,0 +1,5 @@
# textdomain: signs_api
Text=Texte
(first @1 lines only)= (uniquement les @1 premières lignes)
Font=
Write=Écrire

View File

@@ -0,0 +1,5 @@
# textdomain: signs_api
Text=Teks
(first @1 lines only)= (@1 baris pertama sahaja)
Font=
Write=Tulis

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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
msgid "Text"
msgstr ""
#: common.lua
msgid "Write"
msgstr ""
#: common.lua
#, lua-format
msgid " (first %s lines only)"
msgstr ""

View File

@@ -0,0 +1,5 @@
# textdomain: signs_api
Text=
(first @1 lines only)=
Font=
Write=

View File

@@ -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

View File

@@ -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

View File

@@ -195,7 +195,8 @@ minetest.register_craft({
})
minetest.register_craft({
type = "shapeless",
output = 'signs_road:large_street_sign',
recipe = {'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign', 'signs_road:white_street_sign'},
type = "shapeless",
output = 'signs_road:large_street_sign',
recipe = {'signs_road:white_street_sign', 'signs_road:white_street_sign',
'signs_road:white_street_sign', 'signs_road:white_street_sign'},
})

View File

@@ -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")

View File

@@ -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

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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"
"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"

View File

@@ -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) <translation@mnh48.moe>, 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 <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"
#: 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"

View File

@@ -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

View File

@@ -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=

View File

@@ -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=

View File

@@ -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.
#
#, 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 <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"
#: 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 ""

View File

@@ -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=

View File

@@ -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

View File

@@ -19,7 +19,7 @@
along with signs_road. If not, see <http://www.gnu.org/licenses/>.
--]]
local S = signs_road.intllib
local S = signs_road.S
local models = {
blue_street_sign = {

View File

@@ -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

View File

@@ -18,13 +18,13 @@
along with steles. If not, see <http://www.gnu.org/licenses/>.
--]]
local S = steles.intllib
local S = steles.S
steles.materials = {
'default:stone',
'default:sandstone',
'default:stone',
'default:sandstone',
'default:desert_stone',
'technic:marble',
'technic:marble',
'technic:granite',
}

View File

@@ -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")

View File

@@ -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

View File

@@ -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 <EMAIL@ADDRESS>, 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 <fat115@framasoft.org>\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"

View File

@@ -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) <translation@mnh48.moe>, 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 <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"
#: 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"

View File

@@ -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

View File

@@ -0,0 +1,9 @@
# 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
Displayed text (3 lines max)=
Font=
Write=

View File

@@ -0,0 +1,9 @@
# 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
Displayed text (3 lines max)=
Font=
Write=

View File

@@ -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 <EMAIL@ADDRESS>, 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 <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"
#: 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 ""

View File

@@ -0,0 +1,9 @@
# textdomain: steles
Stone Stele=
Sandstone Stele=
Desert Stone Stele=
Marble Stele=
Granite Stele=
Displayed text (3 lines max)=
Font=
Write=

View File

@@ -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

View File

@@ -18,8 +18,8 @@
along with steles. If not, see <http://www.gnu.org/licenses/>.
--]]
local S = steles.intllib
local F = function(...) return minetest.formspec_escape(S(...)) end
local S = steles.S
local FS = function(...) return minetest.formspec_escape(S(...)) end
display_api.register_display_entity("steles:text")
@@ -69,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,
F("Displayed text (3 lines max)"),
F("Font"), F("Write")))
FS("Displayed text (3 lines max)"),
FS("Font"), FS("Write")))
display_api.on_construct(pos)
end,
on_destruct = display_api.on_destruct,

View File

@@ -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