refactor lua-format in locales

This commit is contained in:
codexp 2018-07-13 14:03:30 +02:00
parent d023a3496c
commit 4fa06ce2ea
7 changed files with 71 additions and 76 deletions

View File

@ -126,15 +126,22 @@ end
function circular_saw:reset(pos)
local meta = minetest.get_meta(pos)
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("micro", {})
inv:set_list("output", {})
meta:set_int("anz", 0)
meta:set_int("anz", 0)
meta:set_string("infotext",
S("Circular Saw is empty (owned by %s)")
:format(meta:get_string("owner") or ""))
S("Circular Saw is empty") .. owned_by
)
end
@ -167,6 +174,13 @@ function circular_saw:update_inventory(pos, amount)
local name_parts = circular_saw.known_nodes[node_name] or ""
local modname = name_parts[1] 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:
node_name.. " " .. math.floor(amount / 8)
@ -191,8 +205,8 @@ function circular_saw:update_inventory(pos, amount)
meta:set_int("anz", amount)
meta:set_string("infotext",
S("Circular Saw is working on %s (owned by %s)")
:format(material, meta:get_string("owner") or ""))
S("Circular Saw is working on @1") .. owned_by
)
end
@ -427,10 +441,16 @@ minetest.register_node("moreblocks:circular_saw", {
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
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("infotext",
S("Circular Saw is empty (owned by %s)")
:format(owner))
S("Circular Saw is empty") . owned_by
)
end,
-- The amount of items offered per shape can be configured:

View File

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

View File

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

View File

@ -51,19 +51,16 @@ msgid "Set"
msgstr "Fixer"
#: circular_saw.lua
#, fuzzy, lua-format
msgid "Circular Saw is empty (owned by %s)"
msgstr "Scie circulaire est vide (propriété de %s)"
msgid "(owned by @1)"
msgstr "(propriété de @1)"
#: circular_saw.lua
#, fuzzy, lua-format
msgid "Circular Saw is working on %s (owned by %s)"
msgstr "Scie circulaire, manipule %s (propriété de %s)"
#: circular_saw.lua
#, fuzzy
msgid "Circular Saw is empty"
msgstr "Scie circulaire, vide"
msgstr "Scie circulaire est vide"
#: circular_saw.lua
msgid "Circular Saw is working on @1"
msgstr "Scie circulaire, manipule @1"
#: init.lua
msgid "[MOD] moreblocks loaded."
@ -273,8 +270,7 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "Dalle en bois vers la gauche"
#: ownership.lua
#, lua-format
msgid "Sorry, %s owns that spot."
msgid "Sorry, @1 owns that spot."
msgstr ""
#: ownership.lua

View File

@ -52,12 +52,12 @@ msgstr "Imp."
#: circular_saw.lua
#, 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)"
#: circular_saw.lua
#, 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)"
#: circular_saw.lua
@ -273,9 +273,8 @@ msgid "Leftwards Wooden Tile (Deprecated)"
msgstr "Mattonella in legno verso sinistra"
#: ownership.lua
#, lua-format
msgid "Sorry, %s owns that spot."
msgstr "Spiacente, quel punto è di proprietà di %s"
msgid "Sorry, @1 owns that spot."
msgstr "Spiacente, quel punto è di proprietà di @1"
#: ownership.lua
msgid "someone"

View File

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

View File

@ -33,7 +33,7 @@ function moreblocks.node_is_owned(pos, placer)
end
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
else
return false