From 3e30f7fff4219affc171b45d4ca31402577b0c7d Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 17 Aug 2017 16:34:01 +0100 Subject: [PATCH] intllib updated (thanks BrunoMine) --- init.lua | 7 +- intllib.lua | 45 ++++++++ locale/de.po | 262 ++++++++++++++++++++++++++++++++++++++++++++ locale/de.txt | 104 ------------------ locale/template.pot | 258 +++++++++++++++++++++++++++++++++++++++++++ locale/template.txt | 102 ----------------- 6 files changed, 566 insertions(+), 212 deletions(-) create mode 100644 intllib.lua create mode 100644 locale/de.po delete mode 100644 locale/de.txt create mode 100644 locale/template.pot delete mode 100644 locale/template.txt diff --git a/init.lua b/init.lua index bd90551..c2e9f1b 100644 --- a/init.lua +++ b/init.lua @@ -19,12 +19,7 @@ local statistics = dofile(farming.path.."/statistics.lua") -- Intllib -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end +local S = dofile(farming.path.."/intllib.lua") farming.intllib = S -- Utility Functions diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/intllib.lua @@ -0,0 +1,45 @@ + +-- 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/de.po b/locale/de.po new file mode 100644 index 0000000..1db5d72 --- /dev/null +++ b/locale/de.po @@ -0,0 +1,262 @@ +# German Translation for farming mod. +# Copyright (C) 2017 +# This file is distributed under the same license as the farming package. +# Xanthin. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-31 HO:MI+ZONE\n" +"PO-Revision-Date: 2016-03-31 HO:MI+ZONE\n" +"Last-Translator: Xanthin\n" +"Language-Team: \n" +"Language: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Gerstenkörner" + +#: barley.lua +msgid "Barley" +msgstr "Gerste" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Grüne Bohnen" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Blaubeeren" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "Blaubeermuffin" + +#: carrot.lua +msgid "Carrot" +msgstr "Möhre" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Goldene Möhre" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Kakaobohne" + +#: cocoa.lua +msgid "Cookie" +msgstr "Keks" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Tafel Zartbitterschokolade" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Kaffeebohnen" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Tasse (leer)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Kalte Tasse Kaffee" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Heiße Tasse Kaffee" + +#: corn.lua +msgid "Corn" +msgstr "Mais" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Maiskolben" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Flasche Ethanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Baumwollsamen" + +#: cotton.lua +msgid "Cotton" +msgstr "Baumwolle" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Gurke" + +#: donut.lua +msgid "Donut" +msgstr "Donut" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Schokodonut" + +#: donut.lua +msgid "Apple Donut" +msgstr "Apfeldonut" + +#: grapes.lua +msgid "Grapes" +msgstr "Weintrauben" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "" + +#: ???? +msgid "Hoe" +msgstr "Hacke" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Holzhacke" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Steinhacke" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Stahlhacke" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Bronzehacke" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Mesehacke" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Diamanthacke" + +#: init.lua +msgid "Seed" +msgstr "Saatgut" + +#: melon.lua +msgid "Melon Slice" +msgstr "Melonenscheibe" + +#: melon.lua +msgid "Melon" +msgstr "Melone" + +#: potato.lua +msgid "Potato" +msgstr "Kartoffel" + +#: potato.lua +msgid "Baked Potato" +msgstr "Ofenkartoffel" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Kürbis" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Kürbisscheibe" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Kürbislaterne (Punch zum Ein- und Ausschalten)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Kürbisbrot" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "Kürbisteig" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Himbeeren" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Himbeersmoothie" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Rhabarber" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Rhabarberkuchen" + +#: soil.lua +msgid "Soil" +msgstr "Ackerboden" + +#: soil.lua +msgid "Wet Soil" +msgstr "Bewässerter Ackerboden" + +#: sugar.lua +msgid "Sugar" +msgstr "Zucker" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Weizenkörner" + +#: wheat.lua +msgid "Wheat" +msgstr "Weizen" + +#: wheat.lua +msgid "Straw" +msgstr "Stroh" + +#: wheat.lua +msgid "Flour" +msgstr "Mehl" + +#: wheat.lua +msgid "Bread" +msgstr "Brot" diff --git a/locale/de.txt b/locale/de.txt deleted file mode 100644 index 9b85a04..0000000 --- a/locale/de.txt +++ /dev/null @@ -1,104 +0,0 @@ -# German Translation for farming mod -# Deutsche Übersetzung der farming Mod -# last update: 2016/March/31 -# Author: Xanthin - -#init.lua -Seed = Saatgut - -#barley.lua -Barley Seed = Gerstenkörner -Barley = Gerste - -#beanpole.lua -Green Beans = Grüne Bohnen -Bean Pole (place on soil before planting beans) = Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen) - -#blueberry.lua -Blueberries = Blaubeeren -Blueberry Muffin = Blaubeermuffin - -#carrot.lua -Carrot = Möhre -Golden Carrot = Goldene Möhre - -#cocoa.lua -Cocoa Beans = Kakaobohne -Cookie = Keks -Bar of Dark Chocolate = Tafel Zartbitterschokolade - -#coffee.lua -Coffee Beans = Kaffeebohnen -Drinking Cup (empty) = Tasse (leer) -Cold Cup of Coffee = Kalte Tasse Kaffee -Hot Cup of Coffee = Heiße Tasse Kaffee - -#corn.lua -Corn = Mais -Corn on the Cob = Maiskolben -Bottle of Ethanol = Flasche Ethanol - -#cotton.lua -Cotton Seed = Baumwollsamen -Cotton = Baumwolle - -#cucumber.lua -Cucumber = Gurke - -#donut.lua -Donut = Donut -Chocolate Donut = Schokodonut -Apple Donut = Apfeldonut - -#grapes.lua -Grapes = Weintrauben -Trellis (place on soil before planting grapes) = Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen) - -#hoes.lua -Hoe = Hacke -Wooden Hoe = Holzhacke -Stone Hoe = Steinhacke -Steel Hoe = Stahlhacke -Bronze Hoe = Bronzehacke -Mese Hoe = Mesehacke -Diamond Hoe = Diamanthacke - -#melon.lua -Melon Slice = Melonenscheibe -Melon = Melone - -#potato.lua -Potato = Kartoffel -Baked Potato = Ofenkartoffel - -#pumpkin.lua -Pumpkin = Kürbis -Pumpkin Slice = Kürbisscheibe -Jack 'O Lantern (punch to turn on and off) = Kürbislaterne (Punch zum Ein- und Ausschalten) -Pumpkin Bread = Kürbisbrot -Pumpkin Dough = Kürbisteig - -#rasperry.lua -Raspberries = Himbeeren -Raspberry Smoothie = Himbeersmoothie - -#rhubarb.lua -Rhubarb = Rhabarber -Rhubarb Pie = Rhabarberkuchen - -#soil.lua -Soil = Ackerboden -Wet Soil = Bewässerter Ackerboden - -#sugar.lua -Sugar = Zucker - -#tomato.lua -Tomato = Tomate - -#wheat.lua -Wheat Seed = Weizenkörner -Wheat = Weizen -Straw = Stroh -Flour = Mehl -Bread = Brot \ No newline at end of file diff --git a/locale/template.pot b/locale/template.pot new file mode 100644 index 0000000..210d946 --- /dev/null +++ b/locale/template.pot @@ -0,0 +1,258 @@ +# 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-08-16 17:38-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "" + +#: barley.lua +msgid "Barley" +msgstr "" + +#: beanpole.lua +msgid "Green Beans" +msgstr "" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "" + +#: blueberry.lua +msgid "Blueberries" +msgstr "" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "" + +#: carrot.lua +msgid "Carrot" +msgstr "" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "" + +#: cocoa.lua +msgid "Cookie" +msgstr "" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "" + +#: corn.lua +msgid "Corn" +msgstr "" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "" + +#: cotton.lua +msgid "Cotton" +msgstr "" + +#: cucumber.lua +msgid "Cucumber" +msgstr "" + +#: donut.lua +msgid "Donut" +msgstr "" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "" + +#: donut.lua +msgid "Apple Donut" +msgstr "" + +#: grapes.lua +msgid "Grapes" +msgstr "" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "" + +#: init.lua +msgid "Seed" +msgstr "" + +#: melon.lua +msgid "Melon Slice" +msgstr "" + +#: melon.lua +msgid "Melon" +msgstr "" + +#: potato.lua +msgid "Potato" +msgstr "" + +#: potato.lua +msgid "Baked Potato" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "" + +#: raspberry.lua +msgid "Raspberries" +msgstr "" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "" + +#: soil.lua +msgid "Soil" +msgstr "" + +#: soil.lua +msgid "Wet Soil" +msgstr "" + +#: sugar.lua +msgid "Sugar" +msgstr "" + +#: tomato.lua +msgid "Tomato" +msgstr "" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "" + +#: wheat.lua +msgid "Wheat" +msgstr "" + +#: wheat.lua +msgid "Straw" +msgstr "" + +#: wheat.lua +msgid "Flour" +msgstr "" + +#: wheat.lua +msgid "Bread" +msgstr "" diff --git a/locale/template.txt b/locale/template.txt deleted file mode 100644 index 3f52730..0000000 --- a/locale/template.txt +++ /dev/null @@ -1,102 +0,0 @@ -# Template for translations of farming mod -# last update: 2016/March/31 - -#init.lua -Seed = - -#barley.lua -Barley Seed = -Barley = - -#beanpole.lua -Green Beans = -Bean Pole (place on soil before planting beans) = - -#blueberry.lua -Blueberries = -Blueberry Muffin = - -#carrot.lua -Carrot = -Golden Carrot = - -#cocoa.lua -Cocoa Beans = -Cookie = -Bar of Dark Chocolate = - -#coffee.lua -Coffee Beans = -Drinking Cup (empty) = -Cold Cup of Coffee = -Hot Cup of Coffee = - -#corn.lua -Corn = -Corn on the Cob = -Bottle of Ethanol = - -#cotton.lua -Cotton Seed = -Cotton = - -#cucumber.lua -Cucumber = - -#donut.lua -Donut = -Chocolate Donut = -Apple Donut = - -#grapes.lua -Grapes = -Trellis (place on soil before planting grapes) = - -#hoes.lua -Hoe = -Wooden Hoe = -Stone Hoe = -Steel Hoe = -Bronze Hoe = -Mese Hoe = -Diamond Hoe = - -#melon.lua -Melon Slice = -Melon = - -#potato.lua -Potato = -Baked Potato = - -#pumpkin.lua -Pumpkin = -Pumpkin Slice = -Jack 'O Lantern (punch to turn on and off) = -Pumpkin Bread = -Pumpkin Dough = - -#rasperry.lua -Raspberries = -Raspberry Smoothie = - -#rhubarb.lua -Rhubarb = -Rhubarb Pie = - -#soil.lua -Soil = -Wet Soil = - -#sugar.lua -Sugar = - -#tomato.lua -Tomato = - -#wheat.lua -Wheat Seed = -Wheat = -Straw = -Flour = -Bread = \ No newline at end of file