From 7a7b915c661b9c9577596dcc39400370b4a658f3 Mon Sep 17 00:00:00 2001 From: Louis Royer <55180044+louisroyer@users.noreply.github.com> Date: Mon, 9 Mar 2020 14:22:50 +0100 Subject: [PATCH] Add french translation Update api obsolete documentation in README.md. --- README.md | 6 +++--- depends.txt | 1 - description.txt | 8 -------- init.lua | 37 +++++++++++++++++++------------------ locale/carpets.fr.tr | 20 ++++++++++++++++++++ locale/template.txt | 20 ++++++++++++++++++++ mod.conf | 2 ++ 7 files changed, 64 insertions(+), 30 deletions(-) delete mode 100644 depends.txt delete mode 100644 description.txt create mode 100644 locale/carpets.fr.tr create mode 100644 locale/template.txt diff --git a/README.md b/README.md index 5c90b5e..9d6700c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Carpets mod for minetest -This mod adds 15 colorized wool carpets to the minetest +This mod adds 15 colorized wool carpets to the minetest. ![](https://github.com/bell07/minetest-carpets/blob/master/screenshot.png) @@ -10,6 +10,6 @@ License: LGPL-2.1+. The mod provides an api to register more carpets using template nodes Example: -``` -carpets.register('default:dirt') -- registers carpet looks like dirt +```lua +carpets.register('default:dirt', {description=S('Carpet dirt')}) -- registers carpet looks like dirt ``` diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 35bc5e5..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ -wool? diff --git a/description.txt b/description.txt deleted file mode 100644 index 29d806b..0000000 --- a/description.txt +++ /dev/null @@ -1,8 +0,0 @@ -Carpets mod for minetest - -This mod adds 15 colorized wool carpets to the minetest. - -License: LGPL-2.1+ - -The mod provides an api to register more carpets using template nodes -Example: carpets.register('default:dirt') -- registers carpet looks like dirt diff --git a/init.lua b/init.lua index 11d0916..45eb5d2 100644 --- a/init.lua +++ b/init.lua @@ -1,25 +1,26 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) +local S = minetest.get_translator("carpets") dofile(modpath .. "/api.lua") if minetest.get_modpath("wool") then - local nodenames = { - "wool:black", - "wool:blue", - "wool:brown", - "wool:cyan", - "wool:dark_green", - "wool:dark_grey", - "wool:green", - "wool:grey", - "wool:magenta", - "wool:orange", - "wool:pink", - "wool:red", - "wool:violet", - "wool:white", - "wool:yellow", + local nodes = { + {name="wool:black", description=S("Black Carpet")}, + {name="wool:blue", description=S("Blue Carpet")}, + {name="wool:brown", description=S("Brown Carpet")}, + {name="wool:cyan", description=S("Cyan Carpet")}, + {name="wool:dark_green", description=S("Dark Green Carpet")}, + {name="wool:dark_grey", description=S("Dark Grey Carpet")}, + {name="wool:green", description=S("Green Carpet")}, + {name="wool:grey", description=S("Grey Carpet")}, + {name="wool:magenta", description=S("Magenta Carpet")}, + {name="wool:orange", description=S("Orange Carpet")}, + {name="wool:pink", description=S("Pink Carpet")}, + {name="wool:red", description=S("Red Carpet")}, + {name="wool:violet", description=S("Violet Carpet")}, + {name="wool:white", description=S("White Carpet")}, + {name="wool:yellow", description=S("Yellow Carpet")}, } - for _, nodename in ipairs(nodenames) do - carpets.register(nodename) + for _, node in ipairs(nodes) do + carpets.register(node.name, {description=node.description}) end end diff --git a/locale/carpets.fr.tr b/locale/carpets.fr.tr new file mode 100644 index 0000000..c1b1c6d --- /dev/null +++ b/locale/carpets.fr.tr @@ -0,0 +1,20 @@ +# textdomain: carpets + + +### init.lua ### + +Black Carpet=Tapis noir +Blue Carpet=Tapis bleu +Brown Carpet=Tapis marron +Cyan Carpet=Tapis cyan +Dark Green Carpet=Tapis vert foncé +Dark Grey Carpet=Tapis gris foncé +Green Carpet=Tapis vert +Grey Carpet=Tapis gris +Magenta Carpet=Tapis magenta +Orange Carpet=Tapis orange +Pink Carpet=Tapis rose +Red Carpet=Tapis rouge +Violet Carpet=Tapis violet +White Carpet=Tapis blanc +Yellow Carpet=Tapis jaune diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..292224a --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,20 @@ +# textdomain: carpets + + +### init.lua ### + +Black Carpet= +Blue Carpet= +Brown Carpet= +Cyan Carpet= +Dark Green Carpet= +Dark Grey Carpet= +Green Carpet= +Grey Carpet= +Magenta Carpet= +Orange Carpet= +Pink Carpet= +Red Carpet= +Violet Carpet= +White Carpet= +Yellow Carpet= diff --git a/mod.conf b/mod.conf index 1a77313..5540f74 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ name = carpets +description = Adds 16 colorized wool carpets to the minetest. +optional_depends = wool