mirror of
https://github.com/pyrollo/display_modpack.git
synced 2025-07-19 08:20:24 +02:00
replace intllib
This commit is contained in:
@ -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")
|
||||
|
@ -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
|
15
signs_road/locale/signs_road.de.tr
Normal file
15
signs_road/locale/signs_road.de.tr
Normal 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
|
@ -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
|
||||
|
@ -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 = {
|
||||
|
Reference in New Issue
Block a user