Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nil-check and translations #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
local level = toolranks.get_level(dugnodes)
if lastlevel < level then
local levelup_text = S(
"Your @1@2@3 just leveled up!",
"Your @1@2@3 just leveled up to @4@5@6!",
toolranks.colors.green,
itemdesc,
toolranks.colors.white,
toolranks.colors.green,
level,
toolranks.colors.white
)
minetest.chat_send_player(user:get_player_name(), levelup_text)
Expand All @@ -122,9 +125,11 @@ function toolranks.new_afteruse(itemstack, user, node, digparams)
caps.punch_attack_uses = caps.punch_attack_uses and (caps.punch_attack_uses * use_multiplier)

for _,c in pairs(caps.groupcaps) do
c.uses = c.uses * use_multiplier
for i,t in ipairs(c.times) do
c.times[i] = t / speed_multiplier
if c.uses then
c.uses = c.uses * use_multiplier
for i,t in ipairs(c.times) do
c.times[i] = t / speed_multiplier
end
end
end
itemmeta:set_tool_capabilities(caps)
Expand Down
11 changes: 11 additions & 0 deletions locale/toolranks.de.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# textdomain: toolranks
@1@2@n@3Level @4 @5@n@6Node dug: @7=@1@2@n@3Stufe @4 @5@n@6Node gegraben: @7
pickaxe=Spitzhacke
axe=Axt
shovel=Schaufel
hoe=Hacke
sword=Schwert
tool=Werkzeug
Most used tool is now a @1@2@3 owned by @4 with @5 uses.=Das meist benutzte Werkzeug ist nun: @1@2@3 im Besitz von @4 mit @5 Benutzungen.
Your tool is about to break!=Dein Werkzeug wird gleich brechen!
Your @1@2@3 just leveled up to @4@5@6!=@1@2@3 ist gerade aufgebessert worden zur Stufe @4@5@6!
3 changes: 2 additions & 1 deletion locale/toolranks.en.tr
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ sword=sword
tool=tool
Most used tool is now a @1@2@3 owned by @4 with @5 uses.=Most used tool is now a @1@2@3 owned by @4 with @5 uses.
Your tool is about to break!=Your tool is about to break!
Your @1@2@3 just leveled up!=Your @1@2@3 just leveled up!
Your @1@2@3 just leveled up to @4@5@6!=Your @1@2@3 just leveled up to @4@5@6!

11 changes: 11 additions & 0 deletions locale/toolranks.es.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# textdomain: toolranks
@1@2@n@3Level @4 @5@n@6Node dug: @7=@1@2@n@3Nivel @4 @5@n@6Nodo excavado: @7
pickaxe=pico
axe=hacha
shovel=pala
hoe=azada
sword=espada
tool=herramienta
Most used tool is now a @1@2@3 owned by @4 with @5 uses.=La herramienta más utilizada ahora es @1@2@3 propiedad de @4 con @5 usos.
Your tool is about to break!=¡Tu herramienta está a punto de romperse!
Your @1@2@3 just leveled up to @4@5@6!=¡Tu @1@2@3 acaba de subir de nivel a @4@5@6!
4 changes: 2 additions & 2 deletions locale/toolranks.fr.tr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ hoe=houe
sword=épée
tool=outil
Most used tool is now a @1@2@3 owned by @4 with @5 uses.=L’outil le plus utilisé est désormais @1@2@3 appartenant à @4 avec @5 utilisations.
Your tool is about to break!=Votre outil va se casser !
Your @1@2@3 just leveled up!=Votre @1@2@3 a gagné un niveau !
Your tool is about to break!=Tu outil va se casser !
Your @1@2@3 just leveled up to @4@5@6!=Tu @1@2@3 a gagné un niveau au @4@5@6 !