1
0
Fork 0

Not much to translate here, but why not. Internationalization library support.

mineclone_compatibility
FaceDeer 2017-02-02 20:27:54 -07:00
parent cf90db8544
commit 9623aec62e
7 changed files with 153 additions and 3 deletions

View File

@ -1 +1,2 @@
default?
default?
intllib?

View File

@ -1,5 +1,9 @@
dynamic_liquid = {} -- global table to expose liquid_abm for other mods' usage
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- By making this giant table of all possible permutations of horizontal direction we can avoid
-- lots of redundant calculations.
local all_direction_permutations = {
@ -134,7 +138,7 @@ end
-- register damp clay whether we're going to set the ABM or not, if the user disables this feature we don't want existing
-- spring clay to turn into unknown nodes.
local clay_def = duplicate_def("default:clay")
clay_def.description = "Damp Clay"
clay_def.description = S("Damp Clay")
if not springs then
clay_def.groups.not_in_creative_inventory = 1 -- take it out of creative inventory though
end
@ -190,7 +194,7 @@ if springs then
-- This is a creative-mode only node that produces a modest amount of water continuously no matter where it is.
-- Allow this one to turn into "unknown node" when this feature is disabled, since players had to explicitly place it.
minetest.register_node("dynamic_liquid:spring", {
description = "Spring",
description = S("Spring"),
drops = "default:gravel",
tiles = {"default_cobble.png^[combine:16x80:0,-48=crack_anylength.png",
"default_cobble.png","default_cobble.png","default_cobble.png","default_cobble.png","default_cobble.png",

45
intllib.lua Normal file
View File

@ -0,0 +1,45 @@
-- 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

25
locale/de.po Normal file
View File

@ -0,0 +1,25 @@
# Dynamic liquid Minetest mod.
# Copyright (C) 2017
# This file is distributed under the same license as the dynamic_liquid package.
# FaceDeer
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-02 20:18-0700\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua:141
msgid "Damp Clay"
msgstr "Feuchten Lehm"
#: init.lua:197
msgid "Spring"
msgstr "Quelle"

25
locale/es.po Normal file
View File

@ -0,0 +1,25 @@
# Dynamic liquid Minetest mod.
# Copyright (C) 2017
# This file is distributed under the same license as the dynamic_liquid package.
# FaceDeer
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-02 20:18-0700\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua:141
msgid "Damp Clay"
msgstr "Arcilla húmeda"
#: init.lua:197
msgid "Spring"
msgstr "Manantial"

25
locale/fr.po Normal file
View File

@ -0,0 +1,25 @@
# Dynamic liquid Minetest mod.
# Copyright (C) 2017
# This file is distributed under the same license as the dynamic_liquid package.
# FaceDeer
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-02 20:18-0700\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua:141
msgid "Damp Clay"
msgstr "Argile humide"
#: init.lua:197
msgid "Spring"
msgstr "Source"

25
locale/template.pot Normal file
View File

@ -0,0 +1,25 @@
# Dynamic liquid Minetest mod.
# Copyright (C) 2017
# This file is distributed under the same license as the dynamic_liquid package.
# FaceDeer
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-02 20:18-0700\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: init.lua:141
msgid "Damp Clay"
msgstr ""
#: init.lua:197
msgid "Spring"
msgstr ""