From 42456051e573f5b9d0ec5ccf95a670ddc41174c2 Mon Sep 17 00:00:00 2001 From: Louis <55180044+louisroyer@users.noreply.github.com> Date: Wed, 12 Feb 2020 21:01:35 +0100 Subject: [PATCH] Add french translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change translation system to use minetest builtin’s translation api, which allow client side translation. --- depends.txt | 7 ------- description.txt | 1 - init.lua | 4 +--- intllib.lua | 45 ------------------------------------------- locale/pontoons.fr.tr | 11 +++++++++++ locale/template.pot | 35 --------------------------------- locale/template.txt | 11 +++++++++++ mod.conf | 4 +++- 8 files changed, 26 insertions(+), 92 deletions(-) delete mode 100644 depends.txt delete mode 100644 description.txt delete mode 100644 intllib.lua create mode 100644 locale/pontoons.fr.tr delete mode 100644 locale/template.pot create mode 100644 locale/template.txt diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 4f6312e..0000000 --- a/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -default? -mcl_core? -mcl_sounds? -airtanks? -moretrees? -intllib? -doc? diff --git a/description.txt b/description.txt deleted file mode 100644 index 772802e..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -A "floating" block that can be placed at the surface of a body of water without needing to build pilings first. \ No newline at end of file diff --git a/init.lua b/init.lua index caf3902..a2fdab7 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,4 @@ --- internationalization boilerplate -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = minetest.get_translator("pontoons") -- MCL2 compatibility local moditems = {} 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/pontoons.fr.tr b/locale/pontoons.fr.tr new file mode 100644 index 0000000..df8998b --- /dev/null +++ b/locale/pontoons.fr.tr @@ -0,0 +1,11 @@ +# textdomain: pontoons + +# French translation +# Copyright (C) 2020, Louis Royer +# This file is distributed under the same license as the pontoons package. +# Louis Royer <55180044+louisroyer@users.noreply.github.com>, 2020 +# +Wood Pontoon=Ponton en bois +A hollow wooden block designed to be built on the surface of liquids.=Un bloc de bois creux conçu pour être construit à la surface des liquides. +Steel Pontoon=Ponton en acier +A hollow steel block designed to be built on the surface of liquids. Magma-safe.=Un bloc d’acier creux conçu pour être construit à la surface des liquides. Résiste au magma. diff --git a/locale/template.pot b/locale/template.pot deleted file mode 100644 index b66e0a6..0000000 --- a/locale/template.pot +++ /dev/null @@ -1,35 +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: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-12 12:54-0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: init.lua:57 -msgid "Wood Pontoon" -msgstr "" - -#: init.lua:58 -msgid "A hollow wooden block designed to be built on the surface of liquids." -msgstr "" - -#: init.lua:96 -msgid "Steel Pontoon" -msgstr "" - -#: init.lua:97 -msgid "" -"A hollow steel block designed to be built on the surface of liquids. Magma-" -"safe." -msgstr "" diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..ade45d7 --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,11 @@ +# textdomain: pontoons + +# 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. +# +Wood Pontoon= +A hollow wooden block designed to be built on the surface of liquids.= +Steel Pontoon= +A hollow steel block designed to be built on the surface of liquids. Magma-safe.= diff --git a/mod.conf b/mod.conf index 8818902..80c5f6c 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ -name = pontoons \ No newline at end of file +name = pontoons +description = A "floating" block that can be placed at the surface of a body of water without needing to build pilings first. +optional_depends = default, mcl_core, mcl_sounds, airtanks, moretrees, doc