Refactor Lua format in locales

This commit is contained in:
codexp 2018-07-13 14:03:30 +02:00 committed by Hugo Locurcio
parent 4605ed7848
commit c7f80ce960
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
7 changed files with 71 additions and 75 deletions

View File

@ -126,15 +126,22 @@ end
function circular_saw:reset(pos) function circular_saw:reset(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local owned_by = meta:get_string("owner")
if owned_by and owned_by ~= "" then
owned_by = " " .. S("(owned by @1)", meta:get_string("owner"))
else
owned_by = ""
end
inv:set_list("input", {}) inv:set_list("input", {})
inv:set_list("micro", {}) inv:set_list("micro", {})
inv:set_list("output", {}) inv:set_list("output", {})
meta:set_int("anz", 0)
meta:set_int("anz", 0)
meta:set_string("infotext", meta:set_string("infotext",
S("Circular Saw is empty (owned by %s)") S("Circular Saw is empty") .. owned_by
:format(meta:get_string("owner") or "")) )
end end
@ -167,6 +174,13 @@ function circular_saw:update_inventory(pos, amount)
local name_parts = circular_saw.known_nodes[node_name] or "" local name_parts = circular_saw.known_nodes[node_name] or ""
local modname = name_parts[1] or "" local modname = name_parts[1] or ""
local material = name_parts[2] or "" local material = name_parts[2] or ""
local owned_by = meta:get_string("owner")
if owned_by and owned_by ~= "" then
owned_by = " " .. S("(owned by @1)", meta:get_string("owner"))
else
owned_by = ""
end
inv:set_list("input", { -- Display as many full blocks as possible: inv:set_list("input", { -- Display as many full blocks as possible:
node_name.. " " .. math.floor(amount / 8) node_name.. " " .. math.floor(amount / 8)
@ -191,8 +205,8 @@ function circular_saw:update_inventory(pos, amount)
meta:set_int("anz", amount) meta:set_int("anz", amount)
meta:set_string("infotext", meta:set_string("infotext",
S("Circular Saw is working on %s (owned by %s)") S("Circular Saw is working on @1") .. owned_by
:format(material, meta:get_string("owner") or "")) )
end end
@ -427,10 +441,16 @@ minetest.register_node("moreblocks:circular_saw", {
after_place_node = function(pos, placer) after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local owner = placer and placer:get_player_name() or "" local owner = placer and placer:get_player_name() or ""
local owned_by = owner
if owner ~= "" then
owned_by = " " .. S("(owned by @1)", owner)
end
meta:set_string("owner", owner) meta:set_string("owner", owner)
meta:set_string("infotext", meta:set_string("infotext",
S("Circular Saw is empty (owned by %s)") S("Circular Saw is empty") . owned_by
:format(owner)) )
end, end,
-- The amount of items offered per shape can be configured: -- The amount of items offered per shape can be configured:

View File

@ -18,7 +18,7 @@ msgstr ""
#: circular_saw.lua #: circular_saw.lua
msgid "Circular Saw" msgid "Circular Saw"
msgstr "Kreissaege" msgstr "Kreissäge"
#: circular_saw.lua #: circular_saw.lua
msgid "" msgid ""
@ -49,47 +49,40 @@ msgid "Set"
msgstr "Ok" msgstr "Ok"
#: circular_saw.lua #: circular_saw.lua
#, fuzzy, lua-format msgid "(owned by @1)"
msgid "Circular Saw is empty (owned by %s)" msgstr "(gehört @1)"
msgstr "Kreissaege ist leer (gehoert %s)"
#: circular_saw.lua #: circular_saw.lua
#, fuzzy, lua-format msgid "Circular Saw is working on @1"
msgid "Circular Saw is working on %s (owned by %s)" msgstr "Kreissäge arbeitet mit @1"
msgstr "Kreissaege, arbeitet mit %s (gehoert %s)"
#: circular_saw.lua #: circular_saw.lua
#, fuzzy
msgid "Circular Saw is empty" msgid "Circular Saw is empty"
msgstr "Kreissaege, leer" msgstr "Kreissäge ist leer"
#: init.lua #: init.lua
msgid "[moreblocks] loaded." msgid "[moreblocks] loaded."
msgstr "[moreblocks] geladen." msgstr "[moreblocks] geladen."
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "All-faces Acacia Tree" msgid "All-faces Acacia Tree"
msgstr "Baumscheibenstamm" msgstr "Akazien Baumstamm (allseitig)"
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "All-faces Aspen Tree" msgid "All-faces Aspen Tree"
msgstr "Baumscheibenstamm" msgstr "Espen Baumstamm (allseitig)"
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "All-faces Jungle Tree" msgid "All-faces Jungle Tree"
msgstr "Baumscheibenstamm" msgstr "Tropenbaum Baumstamm (allseitig)"
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "All-faces Pine Tree" msgid "All-faces Pine Tree"
msgstr "Baumscheibenstamm" msgstr "Kiefer Baumstamm (allseitig)"
#: nodes.lua #: nodes.lua
msgid "All-faces Tree" msgid "All-faces Tree"
msgstr "Baumscheibenstamm" msgstr "Baumstamm (allseitig)"
#: nodes.lua #: nodes.lua
msgid "Cactus Brick" msgid "Cactus Brick"
@ -104,9 +97,8 @@ msgid "Centered Wooden Tile"
msgstr "Holzfliese mittig" msgstr "Holzfliese mittig"
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "Checker Stone Tile" msgid "Checker Stone Tile"
msgstr "Steinfliese" msgstr "Schachsteinfliese"
#: nodes.lua #: nodes.lua
msgid "Circle Stone Bricks" msgid "Circle Stone Bricks"
@ -145,9 +137,8 @@ msgid "Copper Patina Block"
msgstr "" msgstr ""
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "Empty Shelf" msgid "Empty Shelf"
msgstr "Leeres Buecherregal" msgstr "Leeres Regal"
#: nodes.lua #: nodes.lua
msgid "Full Wooden Tile" msgid "Full Wooden Tile"
@ -191,9 +182,8 @@ msgid "Split Stone Tile"
msgstr "Geteilte Steinfliese" msgstr "Geteilte Steinfliese"
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "Stone Bricks" msgid "Stone Bricks"
msgstr "Kohlesteinziegel" msgstr "Steinziegel"
#: nodes.lua #: nodes.lua
msgid "Stone Tile" msgid "Stone Tile"
@ -212,9 +202,8 @@ msgid "Tar"
msgstr "" msgstr ""
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "Trap Desert Stone" msgid "Trap Desert Stone"
msgstr "Steinfalle" msgstr "Wüstensteinfalle"
#: nodes.lua #: nodes.lua
msgid "Trap Glass" msgid "Trap Glass"
@ -229,14 +218,12 @@ msgid "Trap Obsidian"
msgstr "" msgstr ""
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "Trap Obsidian Glass" msgid "Trap Obsidian Glass"
msgstr "Glasfalle" msgstr "Obsidianglasfalle"
#: nodes.lua #: nodes.lua
#, fuzzy
msgid "Trap Sandstone" msgid "Trap Sandstone"
msgstr "Steinfalle" msgstr "Sandsteinfalle"
#: nodes.lua #: nodes.lua
msgid "Trap Stone" msgid "Trap Stone"
@ -271,9 +258,8 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "Holzfliese links" msgstr "Holzfliese links"
#: ownership.lua #: ownership.lua
#, lua-format msgid "Sorry, @1 owns that spot."
msgid "Sorry, %s owns that spot." msgstr "Tut mir leid, dieser Bereich gehört @1."
msgstr "Tut mir leid, %s gehoert diese Stelle."
#: ownership.lua #: ownership.lua
msgid "someone" msgid "someone"

View File

@ -45,19 +45,17 @@ msgid "Set"
msgstr "" msgstr ""
#: circular_saw.lua #: circular_saw.lua
#, lua-format msgid "(owned by @1)"
msgid "Circular Saw is empty (owned by %s)"
msgstr ""
#: circular_saw.lua
#, lua-format
msgid "Circular Saw is working on %s (owned by %s)"
msgstr "" msgstr ""
#: circular_saw.lua #: circular_saw.lua
msgid "Circular Saw is empty" msgid "Circular Saw is empty"
msgstr "" msgstr ""
#: circular_saw.lua
msgid "Circular Saw is working on @1"
msgstr ""
#: init.lua #: init.lua
msgid "[moreblocks] loaded." msgid "[moreblocks] loaded."
msgstr "[moreblocks] cargado." msgstr "[moreblocks] cargado."
@ -270,8 +268,7 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "Parquet Izquierdo" msgstr "Parquet Izquierdo"
#: ownership.lua #: ownership.lua
#, lua-format msgid "Sorry, @1 owns that spot."
msgid "Sorry, %s owns that spot."
msgstr "" msgstr ""
#: ownership.lua #: ownership.lua

View File

@ -50,19 +50,17 @@ msgid "Set"
msgstr "Définir" msgstr "Définir"
#: circular_saw.lua #: circular_saw.lua
#, lua-format msgid "(owned by @1)"
msgid "Circular Saw is empty (owned by %s)" msgstr "(propriété de @1)"
msgstr "Scie circulaire vide (propriété de %s)"
#: circular_saw.lua
#, lua-format
msgid "Circular Saw is working on %s (owned by %s)"
msgstr "Scie circulaire, manipule %s (propriété de %s)"
#: circular_saw.lua #: circular_saw.lua
msgid "Circular Saw is empty" msgid "Circular Saw is empty"
msgstr "Scie circulaire vide" msgstr "Scie circulaire vide"
#: circular_saw.lua
msgid "Circular Saw is working on @1"
msgstr "Scie circulaire manipulant @1"
#: init.lua #: init.lua
msgid "[moreblocks] loaded." msgid "[moreblocks] loaded."
msgstr "[moreblocks] a été chargé." msgstr "[moreblocks] a été chargé."
@ -256,9 +254,8 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "Dalle en bois vers la gauche (déprécié)" msgstr "Dalle en bois vers la gauche (déprécié)"
#: ownership.lua #: ownership.lua
#, lua-format msgid "Sorry, @1 owns that spot."
msgid "Sorry, %s owns that spot." msgstr "Désolé, @1 possède cet endroit."
msgstr "Désolé, %s possède cet endroit."
#: ownership.lua #: ownership.lua
msgid "someone" msgid "someone"

View File

@ -50,12 +50,12 @@ msgstr "Imp."
#: circular_saw.lua #: circular_saw.lua
#, fuzzy, lua-format #, fuzzy, lua-format
msgid "Circular Saw is empty (owned by %s)" msgid "Circular Saw is empty"
msgstr "La sega circolare è vuota (di proprietà di %s)" msgstr "La sega circolare è vuota (di proprietà di %s)"
#: circular_saw.lua #: circular_saw.lua
#, fuzzy, lua-format #, fuzzy, lua-format
msgid "Circular Saw is working on %s (owned by %s)" msgid "Circular Saw is working on %s"
msgstr "Sega circolare, in funzione su %s (di proprietà di %s)" msgstr "Sega circolare, in funzione su %s (di proprietà di %s)"
#: circular_saw.lua #: circular_saw.lua
@ -271,9 +271,8 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "Mattonella in legno verso sinistra" msgstr "Mattonella in legno verso sinistra"
#: ownership.lua #: ownership.lua
#, lua-format msgid "Sorry, @1 owns that spot."
msgid "Sorry, %s owns that spot." msgstr "Spiacente, quel punto è di proprietà di @1"
msgstr "Spiacente, quel punto è di proprietà di %s"
#: ownership.lua #: ownership.lua
msgid "someone" msgid "someone"

View File

@ -44,19 +44,17 @@ msgid "Set"
msgstr "" msgstr ""
#: circular_saw.lua #: circular_saw.lua
#, lua-format msgid "(owned by @1)"
msgid "Circular Saw is empty (owned by %s)"
msgstr ""
#: circular_saw.lua
#, lua-format
msgid "Circular Saw is working on %s (owned by %s)"
msgstr "" msgstr ""
#: circular_saw.lua #: circular_saw.lua
msgid "Circular Saw is empty" msgid "Circular Saw is empty"
msgstr "" msgstr ""
#: circular_saw.lua
msgid "Circular Saw is working on @1"
msgstr ""
#: init.lua #: init.lua
msgid "[moreblocks] loaded." msgid "[moreblocks] loaded."
msgstr "" msgstr ""
@ -250,8 +248,7 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "" msgstr ""
#: ownership.lua #: ownership.lua
#, lua-format msgid "Sorry, @1 owns that spot."
msgid "Sorry, %s owns that spot."
msgstr "" msgstr ""
#: ownership.lua #: ownership.lua

View File

@ -33,7 +33,7 @@ function moreblocks.node_is_owned(pos, placer)
end end
if ownername ~= false then if ownername ~= false then
minetest.chat_send_player( placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername) ) minetest.chat_send_player( placer:get_player_name(), S("Sorry, @1 owns that spot.", ownername) )
return true return true
else else
return false return false