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,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 oil_desc
local oil_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,40 +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-03-26 00:49-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"
#: dfcaverns\oil\init.lua:8
msgid ""
"Liquid hydrocarbons formed from the detritus of long dead plants and animals "
"processed by heat and pressure deep within the earth."
msgstr ""
#: dfcaverns\oil\init.lua:9
msgid "Buckets of oil can be used as fuel."
msgstr ""
#: dfcaverns\oil\init.lua:15
msgid "Oil"
msgstr ""
#: dfcaverns\oil\init.lua:65
msgid "Flowing Oil"
msgstr ""
#: dfcaverns\oil\init.lua:194
msgid "Oil Bucket"
msgstr ""

5
oil/locale/template.txt Normal file
View File

@ -0,0 +1,5 @@
Buckets of oil can be used as fuel.=
Flowing Oil=
Liquid hydrocarbons formed from the detritus of long dead plants and animals processed by heat and pressure deep within the earth.=
Oil=
Oil Bucket=

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%