Add french translation

Change translation system to use minetest builtin’s translation api,
which allow client side translation.
This commit is contained in:
Louis 2020-02-12 21:01:35 +01:00
parent 469ee9c208
commit 42456051e5
8 changed files with 26 additions and 92 deletions

View File

@ -1,7 +0,0 @@
default?
mcl_core?
mcl_sounds?
airtanks?
moretrees?
intllib?
doc?

View File

@ -1 +0,0 @@
A "floating" block that can be placed at the surface of a body of water without needing to build pilings first.

View File

@ -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 = {}

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

11
locale/pontoons.fr.tr Normal file
View File

@ -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 dacier creux conçu pour être construit à la surface des liquides. Résiste au magma.

View File

@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

11
locale/template.txt Normal file
View File

@ -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 <EMAIL@ADDRESS>, 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.=

View File

@ -1 +1,3 @@
name = pontoons
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