Completely drop intllib
This commit is contained in:
parent
5ffe0dfa16
commit
eb3a2687b9
5
LICENSE
5
LICENSE
@ -1,5 +0,0 @@
|
||||
License for code: LGPL 3.0
|
||||
License for media and all other assets: CC-by-SA 4.0
|
||||
|
||||
These licenses apply to all modules and components in this modpack,
|
||||
unless otherwise stated.
|
@ -1,4 +1,4 @@
|
||||
Mod written by Felfa under LGPL 3.0 for code and CC-by-SA 4.0 for models and textures. More info about these licenses at LICENSE file.
|
||||
Mod written by Felfa under LGPL 3.0 for code and CC-by-SA 4.0 for models and textures.
|
||||
|
||||
Basic models for the banisters and nodeboxes definitions
|
||||
were taken from VanessaE's homedecor mod:
|
||||
@ -7,3 +7,9 @@ were taken from VanessaE's homedecor mod:
|
||||
The algorithm in the function banister.on_place_side was
|
||||
originally implemented by pyrollo in display_modpack:
|
||||
- https://github.com/pyrollo/display_modpack
|
||||
|
||||
License for code: LGPL 3.0
|
||||
License for media and all other assets: CC-by-SA 4.0
|
||||
|
||||
These licenses apply to all modules and components in this modpack,
|
||||
unless otherwise stated.
|
@ -1,2 +0,0 @@
|
||||
default
|
||||
ethereal?
|
@ -1 +0,0 @@
|
||||
Adds straight and diagonal banisters for stairs railings.
|
7
init.lua
7
init.lua
@ -20,11 +20,10 @@
|
||||
]]
|
||||
|
||||
banisters = {
|
||||
version = "0.2b",
|
||||
version = "0.3",
|
||||
}
|
||||
local path = minetest.get_modpath("banisters")
|
||||
local S = minetest.get_translator and minetest.get_translator("banisters") or dofile(path .. "/intllib.lua")
|
||||
banisters.intllib = S
|
||||
banisters.intllib = minetest.get_translator and minetest.get_translator("banisters")
|
||||
|
||||
local path = minetest.get_modpath("banisters")
|
||||
dofile(minetest.get_modpath("banisters").."/register.lua")
|
||||
dofile(minetest.get_modpath("banisters").."/crafts.lua")
|
||||
|
45
intllib.lua
45
intllib.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
|
Loading…
x
Reference in New Issue
Block a user