diff --git a/init.lua b/init.lua index bda89ae..9a3dc9a 100755 --- a/init.lua +++ b/init.lua @@ -40,7 +40,7 @@ local sounds = { } -- Translation wrapper -local S = minetest.get_translator() +local S = minetest.get_translator(mname) -- Lava death messages messages.lava = { @@ -227,10 +227,10 @@ minetest.register_on_punchplayer(function(player, hitter, time, local player_name = player:get_player_name() local death_message if hitter:is_player() then - death_message = string.format(S(messages.whacking[math.random(1,#messages.whacking)], player_name, hitter:get_player_name())) + death_message = S(messages.whacking[math.random(1,#messages.whacking)], player_name, hitter:get_player_name()) else local entity_name = monsters[hitter:get_luaentity().name] or "monster" - death_message = string.format(S(messages.monsters_whacking[math.random(1, #messages.monsters_whacking)], player_name, entity_name)) + death_message = S(messages.monsters_whacking[math.random(1, #messages.monsters_whacking)], player_name, entity_name) end broadcast_death(death_message) minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player_name,gain=1}) @@ -260,7 +260,7 @@ minetest.register_on_dieplayer(function(player) local player_name = player:get_player_name() local node = minetest.registered_nodes[minetest.get_node(player:get_pos()).name] if minetest.is_singleplayer() then - player_name = "You" + player_name = S("You") end local death_message = "" @@ -290,7 +290,7 @@ minetest.register_on_dieplayer(function(player) end -- Actually tell something - death_message = string.format(S(death_message, player_name)) + death_message = S(death_message, player_name) broadcast_death(death_message) minetest.sound_play(sounds[math.random(1,#sounds)], {to_player=player_name,gain=1}) sound_play_all(player_name) diff --git a/locale/death_messages.fr.tr b/locale/death_messages.fr.tr index bc6feee..5e15903 100644 --- a/locale/death_messages.fr.tr +++ b/locale/death_messages.fr.tr @@ -1,5 +1,7 @@ # textdomain: death_messages +You=Tu + ## lava @1 thought lava was cool.=@1 pensait que la lave était cool. @1 felt an urgent need to touch lava.=@1 a ressenti un besoin urgent de toucher la lave. diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..4866561 --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,101 @@ +# textdomain: death_messages + +You= + +## lava +@1 thought lava was cool.= +@1 felt an urgent need to touch lava.= +@1 fell in lava.= +@1 died in lava.= +@1 didn't know lava was very hot.= +@1 destroyed Sauron's ring.= +@1 melted into a ball of fire.= +@1 couldn't resist that warm glow of lava.= +@1 dug straight down.= + +## Drowning +@1 lacked oxygen.= +@1 ran out of air.= +@1 tried to impersonate an anchor.= +@1 forgot (s)he was not a fish.= +@1 forgot (s)he needed to breath underwater.= +@1 isn't good at swimming.= +@1 looked for the secret of the Unicorn.= +@1 forgot their scaphander.= +@1 failed at swimming lessons.= +@1 blew one too many bubbles.= + +## Fire +@1 was a bit too hot.= +@1 was too close to the fire.= +@1 just got roasted.= +@1 got burnt.= +@1 thought (s)he was the human torch.= +@1 started a fire.= +@1 burned to a crisp.= +@1 got a little too warm.= +@1 got too close to the camp fire.= +@1 just got roasted, hotdog style.= +@1 was set aflame. More light that way.= + +## Acid +@1 now has parts of him/her missing.= +@1 discovered that acid is fun.= +@1 put his/her head where it melted.= +@1 discovered that his/her body in acid, it's like sugar in water.=l'acide, c'est comme du sucre dans de l'eau. +@1 thought (s)he was swimming in apple juice.= +@1 gave his/her body to make an infusion.= +@1 drowned into the wrong liquid.= +@1 tried to test his/her body's solubility in acid.= + +## Sand +@1 learned that sand is less fluid than water.= +@1 joined the mummies.= +@1 got buried.= +@1 choosen to become a fossil.= + +## Other +@1 did something fatal to himself/herself.= +@1 died.= +@1 left this world.= +@1 reached miner's heaven.= +@1 lost his/her life.= +@1 saw the light.= +@1 fell from a bit too high.= +@1 slipped on a banana skin.= +@1 wanted to test his/her super powers.= +@1 gave up on life.= +@1 is somewhat dead now.= +@1 passed out permanently.= +@1 died under very mysterious conditions.= +@1 died in very mysterious circumstances.= +@1 passed away.= + +## Whacking Death +@1 got whacked by @2.= +@1's grave was dug by @2.= +@1 got recycled by @2.= +@1 surely annoyed @2.= +@1 can't have any more offspring because of @2.= +@1 got beaten up by @2.= +@1 had his suffering cut short by @2.= +@1 died in excruciating pain because of @2's fault.= +@1 spent his last moments in the company of @2.= +@1's lineage was extinguished by @2.= +@1 wasn't as strong as @2.= + +## Monster Whacking +@1 got whacked by a @2.= +Darwin said: @1 was less adapted than a @2.= +@1 was transformed into a doormat by a @2.= +@1 thought (s)he was stronger than a @2.= +@1 got kicked up by a @2. Next up...= +@1 felt well that he/she could not do anything against a @2.= +@1 versus @2? It's going bad!= +@1 got a memorable spanking from @2.= +@1 thought to be able to tame a @2? History shows he was wrong.= +@1 didn't have the right reflex in front of a @2.= +But what did @1 imagine versus a @2? Rest her soul.= +@1 got shipped off to the afterlife in a hurry by a @2.= +@1's attempt to reason with a @2 didn't exactly pay off.= +@1 was severely shattered by a dirty @2.=