diff --git a/init.lua b/init.lua index 636e45e..9b03ec4 100644 --- a/init.lua +++ b/init.lua @@ -1,10 +1,8 @@ +local S = minetest.get_translator("axinite") + axinite = {} --- Load support for intllib. -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") - -axinite.intllib = S +axinite.get_translator = S local path = minetest.get_modpath("axinite") dofile(path.."/nodes.lua") diff --git a/intllib.lua b/intllib.lua deleted file mode 100644 index 6669d72..0000000 --- a/intllib.lua +++ /dev/null @@ -1,45 +0,0 @@ - --- Fallback functions for when `intllib` is not installed. --- Code released under Unlicense . - --- 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 diff --git a/locale/axinite.fr.tr b/locale/axinite.fr.tr new file mode 100644 index 0000000..c1e05ea --- /dev/null +++ b/locale/axinite.fr.tr @@ -0,0 +1,10 @@ +# textdomain: axinite + +Can use /setpoint and /point=Est autorisé à utiliser /setpoint et /point +Teleport you to your second_home point=Vous téléporte à votre l'emplacement de votre seconde maison +Teleported to point!=Téléporté à votre seconde maison ! +Set a point using /setpoint=Définissez d'abord l'emplacement de votre seconde maison avec /setpoint +Set your point=Définit l'emplacement de votre seconde maison +Point set!=L'emplacement de votre seconde maison est enregistré ! +Teleport you to spawn point.=Vous téléporte à l'emplacement de votre seconde maison. +Teleported to spawn!=Téléporté au point de départ ! diff --git a/locale/fr.po b/locale/fr.po deleted file mode 100644 index 5e4f006..0000000 --- a/locale/fr.po +++ /dev/null @@ -1,51 +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 , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: Axinite\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-02 10:03+0200\n" -"PO-Revision-Date: 2018-04-02 10:08+0200\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.4\n" -"Last-Translator: Peppy \n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"Language: fr\n" - -#: utilities.lua -msgid "Can use /setpoint and /point" -msgstr "Est autorisé à utiliser /setpoint et /point" - -#: utilities.lua -msgid "Teleport you to your second_home point" -msgstr "Vous téléporte à votre l'emplacement de votre seconde maison" - -#: utilities.lua -msgid "Teleported to point!" -msgstr "Téléporté à votre seconde maison !" - -#: utilities.lua -msgid "Set a point using /setpoint" -msgstr "Définissez d'abord l'emplacement de votre seconde maison avec /setpoint" - -#: utilities.lua -msgid "Set your point" -msgstr "Définit l'emplacement de votre seconde maison" - -#: utilities.lua -msgid "Point set!" -msgstr "L'emplacement de votre seconde maison est enregistré !" - -#: utilities.lua -msgid "Teleport you to spawn point." -msgstr "Vous téléporte à l'emplacement de votre seconde maison." - -#: utilities.lua -msgid "Teleported to spawn!" -msgstr "Téléporté au point de départ !" diff --git a/locale/template b/locale/template new file mode 100644 index 0000000..0f8337a --- /dev/null +++ b/locale/template @@ -0,0 +1,10 @@ +# textdomain: axinite + +Can use /setpoint and /point= +Teleport you to your second_home point= +Teleported to point!= +Set a point using /setpoint= +Set your point= +Point set!= +Teleport you to spawn point.= +Teleported to spawn!= diff --git a/locale/template.pot b/locale/template.pot deleted file mode 100644 index 0d83f09..0000000 --- a/locale/template.pot +++ /dev/null @@ -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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Axinite\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-02 10:03+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.4\n" - -#: utilities.lua -msgid "Can use /setpoint and /point" -msgstr "" - -#: utilities.lua -msgid "Teleport you to your second_home point" -msgstr "" - -#: utilities.lua -msgid "Teleported to point!" -msgstr "" - -#: utilities.lua -msgid "Set a point using /setpoint" -msgstr "" - -#: utilities.lua -msgid "Set your point" -msgstr "" - -#: utilities.lua -msgid "Point set!" -msgstr "" - -#: utilities.lua -msgid "Teleport you to spawn point." -msgstr "" - -#: utilities.lua -msgid "Teleported to spawn!" -msgstr "" diff --git a/utilities.lua b/utilities.lua index 8e4fd8a..841c8b6 100644 --- a/utilities.lua +++ b/utilities.lua @@ -1,4 +1,4 @@ -local S = axinite.intllib +local S = axinite.get_translator ----------- SET POINT