diff --git a/hot_rock.lua b/hot_rock.lua index c459797..5ef56c4 100644 --- a/hot_rock.lua +++ b/hot_rock.lua @@ -1,7 +1,6 @@ if magma_conduits.config.glowing_rock then -local modpath = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(modpath.."/intllib.lua") +local S = magma_conduits.S local simple_copy simple_copy = function(t) diff --git a/init.lua b/init.lua index 74e99ad..7483eab 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,10 @@ magma_conduits = {} -local modpath = minetest.get_modpath(minetest.get_current_modname()) +local modname = minetest.get_current_modname() + +magma_conduits.S = minetest.get_translator(modname) + +local modpath = minetest.get_modpath(modname) dofile(modpath.."/config.lua") dofile(modpath.."/voxelarea_iterator.lua") dofile(modpath.."/hot_rock.lua") 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/template.pot b/locale/template.pot deleted file mode 100644 index 15f206a..0000000 --- a/locale/template.pot +++ /dev/null @@ -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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-22 00:26-0600\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" - -#: hot_rock.lua:7 -msgid "Hot Cobble" -msgstr "" - -#: hot_rock.lua:8 -msgid "Hot stone riven with cracks and seeping traces of lava." -msgstr "" - -#: hot_rock.lua:9 -msgid "" -"When normal stone is heated by lava it is converted into this. Beware when " -"digging here!" -msgstr "" - -#: hot_rock.lua:19 -msgid "Hot Obsidian" -msgstr "" - -#: hot_rock.lua:20 -msgid "Obsidian heated to a dull red glow." -msgstr "" - -#: hot_rock.lua:21 -msgid "" -"When normal obsidian is heated by lava it is converted into this. Beware " -"when digging here!" -msgstr "" diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..9a4e78b --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,12 @@ +Allows players to use a console command to find volcanoes= +Hot @1= +Hot Cobble= +Hot Obsidian= +Hot stone riven with cracks and seeping traces of lava.= +No volcanoes near @1= +Obsidian heated to a dull red glow.= +When normal obsidian is heated by lava it is converted into this. Beware when digging here!= +When normal stone is heated by lava it is converted into this. Beware when digging here!= +You need the findvolcano privilege to use this command.= +a volcano= +find the volcanoes near the player's map region, or in the map region containing pos if provided= \ No newline at end of file diff --git a/locale/update.bat b/locale/update.bat deleted file mode 100644 index e87d44c..0000000 --- a/locale/update.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off -setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION -cd .. -set LIST= -for /r %%X in (*.lua) do set LIST=!LIST! %%X -..\intllib\tools\xgettext.bat %LIST% \ No newline at end of file diff --git a/mod.conf b/mod.conf index 0d28d80..5ab712d 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = magma_conduits description = Removes default mapgen lava and adds widely-spaced volcanoes and lava "veins". depends = default -optional_depends = namegen, intllib, doc, named_waypoints \ No newline at end of file +optional_depends = namegen, doc, named_waypoints \ No newline at end of file diff --git a/sounds/license.txt b/sounds/license.txt deleted file mode 100644 index 103943d..0000000 --- a/sounds/license.txt +++ /dev/null @@ -1 +0,0 @@ -magma_conduits_chime01.ogg is from https://freesound.org/people/Andromadax24/sounds/186719/ by Andromadax24 under the CC-BY-3.0 license \ No newline at end of file diff --git a/sounds/magma_conduits_chime01.ogg b/sounds/magma_conduits_chime01.ogg deleted file mode 100644 index aa3bb94..0000000 Binary files a/sounds/magma_conduits_chime01.ogg and /dev/null differ diff --git a/volcanoes.lua b/volcanoes.lua index b2ee25a..5d6085e 100644 --- a/volcanoes.lua +++ b/volcanoes.lua @@ -7,7 +7,7 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) dofile(modpath .. "/volcano_lava.lua") -- https://github.com/minetest/minetest/issues/7864, https://github.com/minetest/minetest/issues/7878 -local S, NS = dofile(modpath.."/intllib.lua") +local S = magma_conduits.S local named_waypoints_modpath = minetest.get_modpath("named_waypoints") if named_waypoints_modpath then @@ -382,7 +382,7 @@ end) ---------------------------------------------------------------------------------------------- -- Debugging and sightseeing commands -minetest.register_privilege("findvolcano", { description = "Allows players to use a console command to find volcanoes", give_to_singleplayer = false}) +minetest.register_privilege("findvolcano", { description = S("Allows players to use a console command to find volcanoes"), give_to_singleplayer = false}) function round(val, decimal) if (decimal) then @@ -430,7 +430,7 @@ end minetest.register_chatcommand("findvolcano", { params = "pos", -- Short parameter description - description = "find the volcanoes near the player's map region, or in the map region containing pos if provided", + description = S("find the volcanoes near the player's map region, or in the map region containing pos if provided"), func = function(name, param) if minetest.check_player_privs(name, {findvolcano = true}) then local pos = {} @@ -440,7 +440,7 @@ minetest.register_chatcommand("findvolcano", { pos.z = tonumber(pos.z) if pos.x and pos.y and pos.z then if not send_nearby_states(pos, name) then - minetest.chat_send_player(name, "No volcanoes near " .. minetest.pos_to_string(pos)) + minetest.chat_send_player(name, S("No volcanoes near @1", minetest.pos_to_string(pos))) end return true else @@ -450,12 +450,12 @@ minetest.register_chatcommand("findvolcano", { pos.x = math.floor(pos.x) pos.y = math.floor(pos.y) pos.z = math.floor(pos.z) - minetest.chat_send_player(name, "No volcanoes near " .. minetest.pos_to_string(pos)) + minetest.chat_send_player(name, S("No volcanoes near @1", minetest.pos_to_string(pos))) end return true end else - return false, "You need the findvolcano privilege to use this command." + return false, S("You need the findvolcano privilege to use this command.") end end, })