mirror of
				https://github.com/FaceDeer/dfcaverns.git
				synced 2025-11-04 10:05:29 +01:00 
			
		
		
		
	switch over to native translation system
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -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
									
								
							
							
						
						
									
										5
									
								
								oil/locale/template.txt
									
									
									
									
									
										Normal 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=
 | 
			
		||||
@@ -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%
 | 
			
		||||
		Reference in New Issue
	
	Block a user