Use format strings everywhere in A Classic Fairytale (for translators)
authorWuzzy <almikes@aol.com>
Sun, 16 Apr 2017 01:05:08 +0200
changeset 12268 2c8e7e73ef58
parent 12267 2c11b8f5fa4d
child 12269 41542ed28fe4
Use format strings everywhere in A Classic Fairytale (for translators)
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/enemy.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/family.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/first_blood.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/united.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -193,7 +193,7 @@
     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("Do not laugh, inexperienced one, for he speaks the truth!"), SAY_SAY, 10000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Yeah, sure! I died. Hillarious!"), SAY_SAY, 6000}})
     AnimInsertStepNext({func = AnimSay, args = {gearr, loc("You're...alive!? But we saw you die!"), SAY_SAY, 6000}})
-    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("???"), SAY_SAY, 2000}})
+    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("Huh?"), SAY_SAY, 2000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Wow, what a dream!"), SAY_SAY, 3000}})
     if nativeDead[chiefNum] ~= true then
       AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
@@ -207,7 +207,7 @@
     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("It was not a dream, unwise one!"), SAY_SAY, 5000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Exactly, man! That was my dream."), SAY_SAY, 5000}})
     AnimInsertStepNext({func = AnimSay, args = {gearr, loc("You're...alive!? But we saw you die!"), SAY_SAY,  6000}})
-    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("???"), SAY_SAY, 2000}})
+    AnimInsertStepNext({func = AnimSay, args = {gearr, loc("Huh?"), SAY_SAY, 2000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[denseNum], loc("Dude, wow! I just had the weirdest high!"), SAY_SAY, 6000}})
     if nativeDead[chiefNum] ~= true then
       AnimInsertStepNext({func = AnimTurn, args = {natives[chiefNum], "Right"}})
@@ -256,7 +256,7 @@
     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You know what? I don't even regret anything!"), SAY_SAY, 7000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("In fact, you are the only one that's been acting strangely."), SAY_SAY, 8000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("Are you accusing me of something?"), SAY_SAY, 3500}})
-    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Seems like every time you take a \"walk\", the enemy find us!"), SAY_SAY, 8000}})
+    AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Seems like every time you take a \"walk\", the enemy finds us!"), SAY_SAY, 8000}})
     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You know...taking a stroll."), SAY_SAY, 3500}})
     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Where have you been?!"), SAY_SAY, 3000}})
   end
@@ -504,12 +504,12 @@
   if nativesNum == 0 then
     return
   end
-  local hogDeadStrings = {loc("They killed ") .. gear .. loc("! You bastards!"), 
-                          gear .. loc("! Why?!"), 
+  local hogDeadStrings = {string.format(loc("They killed %s! You bastards!"), gear),
+                          string.format(loc("%s! Why?!"), gear), 
                           loc("That was just mean!"), 
-                          loc("Oh no, not ") .. gear .. "!",
-                          loc("Why ") .. gear .. loc("? Why?"),
-                          loc("What has ") .. gear .. loc(" ever done to you?!")}
+                          string.format(loc("Oh no, not %s!"), gear),
+                          string.format(loc("Why %s? Why?"), gear),
+                          string.format(loc("What has %s ever done to you?"), gear)}
   table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[7 - nativesNum], SAY_SHOUT, 4000}})
 end
 
@@ -1054,7 +1054,7 @@
   TurnsLeft = TurnsLeft - 1
   
   if stage == platformStage then
-    AddCaption(TurnsLeft .. " turns until arrival!")
+    AddCaption(string.format(loc("Turns until arrival: %d"), TurnsLeft))
   end
 
   if stage == spyKillStage then
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -193,7 +193,7 @@
   startAnim = {}
   local m = m5DeployedNum
   table.insert(startAnim, {func = AnimWait, args = {native, 3000}})
-  table.insert(startAnim, {func = AnimCaption, args = {native, loc("With the rest of the tribe gone, it was up to ") .. nativeNames[m5DeployedNum] .. loc(" to save the village."), 5000}})
+  table.insert(startAnim, {func = AnimCaption, args = {native, string.format(loc("With the rest of the tribe gone, it was up to %s to save the village."), nativeNames[m5DeployedNum]), 5000}})
   table.insert(startAnim, {func = AnimCaption, args = {native, loc("But it proved to be no easy task!"), 2000}})
   for i = 1, 4 do
     table.insert(startAnim, {func = FollowGear, swh = false, args = {cyborgs[i]}})
@@ -241,9 +241,9 @@
   table.insert(startAnim, {func = AnimCustomFunction, args = {native, RestoreHedge, {cyborg, unpack(cyborgPos)}}})
   table.insert(startAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgPos)}})
   table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
-  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Greetings, ") .. nativeUnNames[m] .. "!", SAY_SAY, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, string.format(loc("Greetings, %s!"), nativeUnNames[m]), SAY_SAY, 2500}})
   table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("As you can see, there is no way to get on the other side!"), SAY_SAY, 7000}})
-  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I wish to help you, ") .. nativeUnNames[m] .. "!", SAY_SAY, 4000}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, string.format(loc("I wish to help you, %s!"), nativeUnNames[m]), SAY_SAY, 4000}})
   table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Beware, though! If you are slow, you die!"), SAY_SAY, 7000}})
   table.insert(startAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   table.insert(startAnim, {func = AnimSwitchHog, args = {native}})
@@ -257,7 +257,7 @@
   table.insert(killAnim, {func = AnimCustomFunction, args = {native, RestoreHedge, {cyborg, unpack(cyborgPos)}}})
   table.insert(killAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(cyborgPos)}})
   table.insert(killAnim, {func = AnimCustomFunction, args = {cyborg, CondNeedToTurn, {cyborg, native}}})
-  table.insert(killAnim, {func = AnimSay, args = {cyborg, loc("You bear impressive skills, ") .. nativeUnNames[m5DeployedNum] .. "!", SAY_SHOUT, 4000}})
+  table.insert(killAnim, {func = AnimSay, args = {cyborg, string.format(loc("You bear impressive skills, %s!"), nativeUnNames[m5DeployedNum]), SAY_SHOUT, 4000}})
   table.insert(killAnim, {func = AnimSay, args = {cyborg, loc("However, my mates don't agree with me on letting you go..."), SAY_SHOUT, 7000}})
   table.insert(killAnim, {func = AnimSay, args = {cyborg, loc("I guess you'll have to kill them."), SAY_SHOUT, 4000}})
   table.insert(killAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
@@ -272,7 +272,7 @@
   table.insert(killedAnim, {func = AnimOutOfNowhere, args = {cyborg, unpack(secondPos[2])}})
   table.insert(killedAnim, {func = AnimOutOfNowhere, args = {native, unpack(secondPos[1])}})
   table.insert(killedAnim, {func = AnimCustomFunction, args = {cyborg, CondNeedToTurn, {cyborg, native}}})
-  table.insert(killedAnim, {func = AnimSay, args = {cyborg, loc("Nice work, ") .. nativeUnNames[m5DeployedNum] .. "!", SAY_SHOUT, 4000}})
+  table.insert(killedAnim, {func = AnimSay, args = {cyborg, string.format(loc("Nice work, %s!"), nativeUnNames[m5DeployedNum]), SAY_SHOUT, 4000}})
   table.insert(killedAnim, {func = AnimSay, args = {cyborg, loc("As a reward for your performance, here's some new technology!"), SAY_SHOUT, 8000}})
   table.insert(killedAnim, {func = AnimSay, args = {cyborg, loc("Use it wisely!"), SAY_SHOUT, 3000}})
   table.insert(killedAnim, {func = AnimDisappear, args = {cyborg, unpack(secondPos[2])}})
@@ -634,7 +634,7 @@
     TurnTimeLeft = 0
   else
     SetInputMask(0xFFFFFFFF)
-    AddCaption(loc("Turns until Sudden Death: ") .. SuddenDeathTurns - TotalRounds)
+    AddCaption(string.format(loc("Turns until Sudden Death: %d"), SuddenDeathTurns - TotalRounds))
   end
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/enemy.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/enemy.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -651,10 +651,10 @@
     cyborgsDeadFresh = false
     WonMission()
   elseif nativesDeadFresh and GetHogTeamName(CurrentHedgehog) == loc("Cannibals") then
-    AnimSay(CurrentHedgehog, loc("Your deaths will be avenged, cannibals!"), SAY_SHOUT, 0)
+    AnimSay(CurrentHedgehog, loc("Your deaths will be avenged, Natives!"), SAY_SHOUT, 0)
     nativesDeadFresh = false
   elseif cannibalsDeadFresh and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
-    AnimSay(CurrentHedgehog, loc("Your deaths will be avenged, cannibals!"), SAY_SHOUT, 0)
+    AnimSay(CurrentHedgehog, loc("Your deaths will be avenged, Cannibals!"), SAY_SHOUT, 0)
     cannibalsDeadFresh = false
   end
 end
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/family.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/family.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -146,7 +146,7 @@
   table.insert(startAnim, {func = AnimTurn, args = {cyborg, "Left"}})
   table.insert(startAnim, {func = AnimTurn, args = {natives[2], "Left"}})
   table.insert(startAnim, {func = AnimTurn, args = {natives[3], "Left"}})
-  table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("Hello again, ") .. nativeUnNames[m5DeployedNum] .. "!", SAY_SAY, 2500}})
+  table.insert(startAnim, {func = AnimSay, args = {cyborg, string.format(loc("Hello again, %s!"), nativeUnNames[m5DeployedNum]), SAY_SAY, 2500}})
   table.insert(startAnim, {func = AnimSay, args = {cyborg, loc("I just found out that they have captured your princess!"), SAY_SAY, 7000}})
   if m5DeployedNum == girlNum then
     table.insert(startAnim, {func = AnimSay, args = {natives[1], loc("Of course I have to save her. What did I expect?!"), SAY_SAY, 7000}})
@@ -338,7 +338,7 @@
 
 function EndMission()
   RemoveEventFunc(CheckPrincessFreed)
-  AddCaption("So the princess was never heard of again...")
+  AddCaption(loc("So the princess was never heard of again ..."))
   DismissTeam(loc("Natives"))
   DismissTeam(loc("011101001"))
   TurnTimeLeft = 0
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/first_blood.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/first_blood.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -473,7 +473,7 @@
   deleteCrate = true
   DeleteGear(crates[1])
   TurnTimeLeft = -1
-  AddCaption(loc("And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."))
+  AddCaption(loc("And so happened that Leaks A Lot failed to complete the challenge! He landed, pressured by shame ..."))
   AddEvent(CheckChallengeFailed, {}, DoChallengeFailed, {}, 0)
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -821,7 +821,7 @@
 end
 
 function DoTookBlowTorch()
-  ShowMission(loc("The Journey Back"), loc("The Tunnel Maker"), loc("Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."), 0, 6000)
+  ShowMission(loc("The Journey Back"), loc("The Tunnel Maker"), loc("Hint: Select the blowtorch, aim and press [Fire]. Press [Fire] again to stop.").."|"..loc("Don't blow up the crate."), 0, 6000)
 end
 
 function CheckTookLowGravity()
@@ -829,7 +829,7 @@
 end
 
 function DoTookLowGravity()
-  ShowMission(loc("The Journey Back"), loc("The Moonwalk"), loc("Hint: Select the LowGravity and press [Fire]."), 0, 6000)
+  ShowMission(loc("The Journey Back"), loc("The Moonwalk"), loc("Hint: Select the low gravity and press [Fire]."), 0, 6000)
 end
 
 function CheckOnBridge()
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -89,7 +89,7 @@
   SpawnUtilityCrate(2365, 1495, amShotgun)
   SpawnUtilityCrate(2495, 1519, amGrenade)
   SpawnUtilityCrate(2620, 1524, amRope)
-  ShowMission(loc("The Shadow Falls"), loc("The Showdown"), loc("Save Leaks A Lot!|Hint: The Switch utility might be of help to you."), 1, 6000)
+  ShowMission(loc("The Shadow Falls"), loc("The Showdown"), loc("Save Leaks A Lot!|Hint: The switch hedgehog utility might be of help to you."), 1, 6000)
   RemoveEventFunc(CheckDenseDead)
   AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadRefused, {}, 0)
   AddAmmo(cannibals[6], amGrenade, 1)
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/united.lua	Sun Apr 16 00:18:44 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/united.lua	Sun Apr 16 01:05:08 2017 +0200
@@ -193,7 +193,7 @@
     table.insert(startAnim, {func = AnimOutOfNowhere, args = {cannibals[i], unpack(cannibalPos[i])}})
   end
   table.insert(startAnim, {func = AnimWait, args = {chief, 1500}})
-  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("HOW DO THEY KNOW WHERE WE ARE???"), SAY_SHOUT, 5000}})
+  table.insert(startAnim, {func = AnimSay, args = {leaks, loc("HOW DO THEY KNOW WHERE WE ARE?"), SAY_SHOUT, 5000}})
   table.insert(startAnim, {func = AnimSay, args = {chief, loc("We have to protect the village!"), SAY_SAY, 5000}})
   table.insert(startAnim, {func = AnimSwitchHog, args = {leaks}})
   AddSkipFunction(startAnim, SkipStartAnim, {})
@@ -214,10 +214,10 @@
   if nativesNum == 0 then
     return
   end
-  local hogDeadStrings = {loc("They killed ") .. gear ..loc("! You bastards!"), 
-                          gear .. loc("! Why?!"), 
+  local hogDeadStrings = {string.format(loc("They killed %s! You bastards!"), gear), 
+                          string.format(loc("%s! Why?!"), gear), 
                           loc("That was just mean!"), 
-                          loc("Oh no, not ") .. gear .. "!"}
+                          string.format(loc("Oh no, not %s!"), gear)}
   table.insert(hogDeadAnim, {func = AnimSay, args = {CurrentHedgehog, hogDeadStrings[nativesNum], SAY_SHOUT, 4000}})
 end