From d70a52c6f8bdbca068e5b5e178ff2a3795edd349 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 8 Aug 2023 17:03:11 +0100 Subject: [PATCH] remove intllib --- depends.txt | 7 ------- description.txt | 1 - init.lua | 25 ++++++++--------------- intllib.lua | 45 ---------------------------------------- locale/ru.po | 50 --------------------------------------------- locale/ru.txt | 15 -------------- locale/template.pot | 50 --------------------------------------------- mod.conf | 2 +- 8 files changed, 9 insertions(+), 186 deletions(-) delete mode 100644 depends.txt delete mode 100644 description.txt delete mode 100644 intllib.lua delete mode 100644 locale/ru.po delete mode 100644 locale/ru.txt delete mode 100644 locale/template.pot diff --git a/depends.txt b/depends.txt deleted file mode 100644 index dc30314..0000000 --- a/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -default? -tnt? -screwdriver? -intllib? -mcl_core? -mcl_sounds? -pova? diff --git a/description.txt b/description.txt deleted file mode 100644 index 60ce4ae..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -Adds lucky blocks into the game which may give good, bad, hurtful items when open :) \ No newline at end of file diff --git a/init.lua b/init.lua index 99884e1..ed7d95e 100644 --- a/init.lua +++ b/init.lua @@ -34,26 +34,17 @@ end -- translation support local S -if minetest.get_translator ~= nil then +if minetest.get_translator then S = minetest.get_translator("lucky_block") -- 5.x translation function -else - if minetest.get_modpath("intllib") then - dofile(minetest.get_modpath("intllib") .. "/init.lua") - if intllib.make_gettext_pair then - gettext, ngettext = intllib.make_gettext_pair() -- new gettext method - else - gettext = intllib.Getter() -- old text file method - end - S = gettext - else -- boilerplate function - S = function(str, ...) - local args = {...} - return str:gsub("@%d+", function(match) - return args[tonumber(match:sub(2))] - end) - end +else -- boilerplate function + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) end end + lucky_block.intllib = S diff --git a/intllib.lua b/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/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/locale/ru.po b/locale/ru.po deleted file mode 100644 index 2405290..0000000 --- a/locale/ru.po +++ /dev/null @@ -1,50 +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-05-14 08:34+0200\n" -"PO-Revision-Date: 2017-08-28 11:14+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: ru\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: init.lua -msgid "Stop hitting yourself!" -msgstr "Прекратите удары себя" - -#: init.lua -msgid "Dry shrub takeover!" -msgstr "Поглощение сухих кустов" - -#: init.lua -msgid "Random teleport!" -msgstr "Случайный телепорт!" - -#: init.lua -msgid "Lucky Block" -msgstr "Удачливый блок" - -#: init.lua -msgid "Super Lucky Block (use pick)" -msgstr "Супер удачливый блок (используйте кирку)" - -#: init.lua -msgid "[MOD] Lucky Blocks loaded (@1 in total)" -msgstr "[MOD] Удачливый блок нагруженный (Всего @1)" - -#: blocks.lua -msgid "Super Mega Magenta Ultra Screwdriver 2500\n(left-click to rotate face, right-click to rotates axis)" -msgstr "Пурпурная супер мега ультра отвёртка 2500\n(левая кнопка для вращения лицевой части, правая кнопка для вращения осей)" - -#: blocks.lua -msgid "Void Mirror (Place to see through solid walls during daytime" -msgstr "Пустое зеркало (Установите, чтобы видеть сквозь сплошные стены в дневное время)" diff --git a/locale/ru.txt b/locale/ru.txt deleted file mode 100644 index 974e13d..0000000 --- a/locale/ru.txt +++ /dev/null @@ -1,15 +0,0 @@ -# textdomain: lucky_block -# author: -# last update: 2017/Aug/28 - -### init.lua ### -Stop hitting yourself!=Прекратите удары себя -Dry shrub takeover!=Поглощение сухих кустов -Random teleport!=Случайный телепорт! -Lucky Block=Удачливый блок -Super Lucky Block (use pick)=Супер удачливый блок (используйте кирку) -[MOD] Lucky Blocks loaded (@1 in total)=[MOD] Удачливый блок нагруженный (Всего @1) - -### blocks.lua ### -Super Mega Magenta Ultra Screwdriver 2500\n(left-click to rotate face, right-click to rotates axis)"=Пурпурная супер мега ультра отвёртка 2500\n(левая кнопка для вращения лицевой части, правая кнопка для вращения осей) -Void Mirror (Place to see through solid walls during daytime=Пустое зеркало (Установите, чтобы видеть сквозь сплошные стены в дневное время) diff --git a/locale/template.pot b/locale/template.pot deleted file mode 100644 index 546877c..0000000 --- a/locale/template.pot +++ /dev/null @@ -1,50 +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-05-14 08:34+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 "Stop hitting yourself!" -msgstr "" - -#: init.lua -msgid "Dry shrub takeover!" -msgstr "" - -#: init.lua -msgid "Random teleport!" -msgstr "" - -#: init.lua -msgid "Lucky Block" -msgstr "" - -#: init.lua -msgid "Super Lucky Block (use pick)" -msgstr "" - -#: init.lua -msgid "[MOD] Lucky Blocks loaded (@1 in total)" -msgstr "" - -#: blocks.lua -msgid "Super Mega Magenta Ultra Screwdriver 2500\n(left-click to rotate face, right-click to rotates axis)" -msgstr "" - -#: blocks.lua -msgid "Void Mirror (Place to see through solid walls during daytime" -msgstr "" diff --git a/mod.conf b/mod.conf index 6f2ee87..84a1be9 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = lucky_block depends = -optional_depends = default, mcl_core, mcl_sounds, tnt, screwdriver, intllib, pova +optional_depends = default, mcl_core, mcl_sounds, tnt, screwdriver, pova description = Adds lucky blocks into the game which may give good, bad, hurtful items when open :)