switch over to native translation system

This commit is contained in:
FaceDeer
2020-02-17 22:36:53 -07:00
parent a9559bcbcf
commit d59bc8d489
113 changed files with 984 additions and 4066 deletions

View File

@ -1,7 +1,8 @@
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
local modpath = minetest.get_modpath(modname)
dofile(MP.."/wisp.lua")
dofile(modpath.."/wisp.lua")
local gas_desc
local gas_usage

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,68 +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: 2019-08-05 20:30-0600\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"
#: mine_gas\init.lua:13
msgid ""
"Gaseous hydrocarbons formed from the detritus of long dead plants and "
"animals processed by heat and pressure deep within the earth."
msgstr ""
#: mine_gas\init.lua:14
msgid ""
"Gas is highly hazardous. Heavier than air, it pools in deep caverns and "
"asphyxiates the unwary."
msgstr ""
#: mine_gas\init.lua:16
msgid ""
"When exposed to air and an ignition source it can produce a deadly explosion."
msgstr ""
#: mine_gas\init.lua:19
msgid "Some coal deposits have cracks that seep a steady flow of mine gas."
msgstr ""
#: mine_gas\init.lua:20
msgid "Mining out such a deposit seals the crack."
msgstr ""
#: mine_gas\init.lua:28
msgid "Mine Gas"
msgstr ""
#: mine_gas\init.lua:48
msgid "Gas Seep"
msgstr ""
#: mine_gas\wisp.lua:8
msgid ""
"Mysterious blue flames may occasionally be found flickering on the edges of "
"oil lakes, burning without oxygen and seeming to maintain their size as they "
"drift about through the unbreathable atmosphere."
msgstr ""
#: mine_gas\wisp.lua:9
msgid ""
"Gas Wisps have no known use, and fortunately they are not hostile or very "
"dangerous."
msgstr ""
#: mine_gas\wisp.lua:13
msgid "Gas Wisp"
msgstr ""

View File

@ -0,0 +1,10 @@
Gas Seep=
Gas Wisp=
Gas Wisps have no known use, and fortunately they are not hostile or very dangerous.=
Gas is highly hazardous. Heavier than air, it pools in deep caverns and asphyxiates the unwary.=
Gaseous hydrocarbons formed from the detritus of long dead plants and animals processed by heat and pressure deep within the earth.=
Mine Gas=
Mining out such a deposit seals the crack.=
Mysterious blue flames may occasionally be found flickering on the edges of oil lakes, burning without oxygen and seeming to maintain their size as they drift about through the unbreathable atmosphere.=
Some coal deposits have cracks that seep a steady flow of mine gas.=
When exposed to air and an ignition source it can produce a deadly explosion.=

View File

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

View File

@ -1,5 +1,5 @@
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
local wisp_desc
local wisp_usage