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,6 +1,5 @@
-- internationalization boilerplate
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 ice_sprite_desc
local ice_sprite_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,50 +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: 2018-12-24 16:51-0700\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"
#: ice_sprites\init.lua:11
msgid ""
"Ice sprites are mysterious glowing insect-like creatures that appear to be "
"made partly of crystalized water."
msgstr ""
#: ice_sprites\init.lua:14
msgid ""
"Ice sprites can be caught with nets and placed in bottles as sources of "
"light and freezing cold."
msgstr ""
#: ice_sprites\init.lua:16
msgid "A bottle containing a captured ice sprite."
msgstr ""
#: ice_sprites\init.lua:17
msgid "Ice sprites radiate both light and freezing cold."
msgstr ""
#: ice_sprites\init.lua:22
msgid "Ice Sprite"
msgstr ""
#: ice_sprites\init.lua:71
msgid "Hidden Ice Sprite"
msgstr ""
#: ice_sprites\init.lua:109
msgid "Ice Sprite in a Bottle"
msgstr ""

View File

@ -0,0 +1,7 @@
A bottle containing a captured ice sprite.=
Hidden Ice Sprite=
Ice Sprite=
Ice Sprite in a Bottle=
Ice sprites are mysterious glowing insect-like creatures that appear to be made partly of crystalized water.=
Ice sprites can be caught with nets and placed in bottles as sources of light and freezing cold.=
Ice sprites radiate both light and freezing cold.=

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,4 +1,4 @@
name = ice_sprites
description = Glowing blue firefly-like nodes
depends =
optional_depends = fireflies, vessels, doc, intllib
optional_depends = fireflies, vessels, doc