Fix various loc() syntax errors in scripts
authorWuzzy <almikes@aol.com>
Tue, 16 May 2017 21:37:46 +0200
changeset 12424 b9cc405541c1
parent 12423 e9d2efe5763b
child 12425 f9cbb896967b
Fix various loc() syntax errors in scripts
share/hedgewars/Data/Maps/ClimbHome/map.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Flying_Saucer.lua
share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
share/hedgewars/Data/Scripts/TargetPractice.lua
--- a/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sun May 14 19:08:57 2017 +0200
+++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua	Tue May 16 21:37:46 2017 +0200
@@ -371,10 +371,10 @@
                     SetState(CurrentHedgehog, gstWinner)
                     SendStat(siGameResult, loc("You have beaten the challenge!"))
                     SendStat(siGraphTitle, loc("Your height over time"))
-                    SendStat(siCustomAchievement, string.format(loc("%s reached home in %.3f seconds. Congratulations!"), loc(GetHogName(CurrentHedgehog)), finishTime))
-                    SendStat(siCustomAchievement, string.format(loc("%s bravely climbed up to a dizzy height of %d to reach home."),loc(GetHogName(CurrentHedgehog)), getActualHeight(RecordHeight)))
+                    SendStat(siCustomAchievement, string.format(loc("%s reached home in %.3f seconds. Congratulations!"), GetHogName(CurrentHedgehog), finishTime))
+                    SendStat(siCustomAchievement, string.format(loc("%s bravely climbed up to a dizzy height of %d to reach home."), GetHogName(CurrentHedgehog), getActualHeight(RecordHeight)))
                     SendStat(siPointType, loc("seconds"))
-                    SendStat(siPlayerKills, tostring(roundedFinishTime), loc(GetHogTeamName(CurrentHedgehog)))
+                    SendStat(siPlayerKills, tostring(roundedFinishTime), GetHogTeamName(CurrentHedgehog))
 
                     EndGame()
                     onAchievementsDeclaration()
@@ -591,7 +591,7 @@
         SendStat(siCustomAchievement, string.format(text, RecordHeightHogName))
     end
     SendStat(siPointType, loc("points"))
-    SendStat(siPlayerKills, actualHeight, loc(GetHogTeamName(CurrentHedgehog)))
+    SendStat(siPlayerKills, actualHeight, GetHogTeamName(CurrentHedgehog))
     EndGame()
     onAchievementsDeclaration()
 end
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Flying_Saucer.lua	Sun May 14 19:08:57 2017 +0200
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Flying_Saucer.lua	Tue May 16 21:37:46 2017 +0200
@@ -98,8 +98,8 @@
 TargetPos[7] = { 
 	Targets = {{ X = 1884, Y = 704 }},
 	MessageTime = 6500,
-	Message = loc("Now dive just one more time and collect the next crate." .. "|" ..
-		loc("Tip: Don't remain for too long in the water, or you won't make it.")),
+	Message = loc("Now dive just one more time and collect the next crate.") .. "|" ..
+		loc("Tip: Don't remain for too long in the water, or you won't make it."),
 	Ammo = { [amJetpack] = 1}, }
 
 -- The Boom Target
@@ -114,8 +114,8 @@
 		loc("Step 2: Select your grenade.") .. "|" ..
 		loc("Step 3: Start flying and get yourself right above the target.") .. "|" ..
 		loc("Step 4: Drop your grenade by pressing the [Long jump] key.") .. "|" ..
-		loc("Step 5: Get away quickly and land safely anywhere." .. "| |" ..
-		loc("Note: We only give you grenades if you stay in your flying saucer.")), nil, 20000)
+		loc("Step 5: Get away quickly and land safely anywhere.") .. "| |" ..
+		loc("Note: We only give you grenades if you stay in your flying saucer."), nil, 20000)
 
 		SpawnBoomTarget()
 
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua	Sun May 14 19:08:57 2017 +0200
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua	Tue May 16 21:37:46 2017 +0200
@@ -30,7 +30,7 @@
 TargetPos[ 1 ] = { X = 1100, Y = 1100, Message = loc("Now find the next target! |Tip: Normally you lose health by falling down, so be careful!") }
 TargetPos[ 2 ] = { X = 1500, Y = 1490, Message = loc("You're getting pretty good! |Tip: When you shorten you rope, you move faster!|And when you lengthen it, you move slower.") }
 TargetPos[ 3 ] = { X = 2200, Y = 800, Message = loc("The next one is pretty hard! |Tip: You have to do multiple swings!") }
-TargetPos[ 4 ] = { X = 2870, Y = 400, Message = loc("I don't know how you did that .. But good work! |The next one should be easy as cake for you!") }
+TargetPos[ 4 ] = { X = 2870, Y = 400, Message = loc("I don't know how you did that. But good work!|The next one should be easy as cake for you!") }
 TargetPos[ 5 ] = { X = 4000, Y = 1750, Message = "" }
 TargetPos[ 6 ] = { Modifier = true, Func = function() -- Last target is ALWAYS the "winning" target!
 	Info( loc("Congratulations"), loc("Congratulations! You've completed the Basic Rope Training!"), 0 ) -- Congrats
@@ -39,7 +39,7 @@
 	AddCaption( loc( "Victory!" ))
 	if TurnTimeLeft >= 250000 then -- If you very fast, unlock the ahievement "Rope Master!"
 		RopeMaster = true
-		AddCaption( string.format(loc( "Achievement gotten: %s"), loc("Rope Master") ),0xffba00ff,capgrpAmmoinfo )
+		AddCaption( string.format(loc("Achievement gotten: %s"), loc("Rope Master") ),0xffba00ff,capgrpAmmoinfo )
 		PlaySound( sndHomerun )
 	end
 	Objective = true
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sun May 14 19:08:57 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Tue May 16 21:37:46 2017 +0200
@@ -758,8 +758,8 @@
 				SetState(hhs[i], bor(GetState(hhs[i]), gstWinner))
 			end
 		end
-		AddCaption(string.format("%s wins!", winnerTeam))
-		SendStat(siGameResult, string.format("%s wins!", winnerTeam))
+		AddCaption(string.format(loc("%s wins!"), winnerTeam))
+		SendStat(siGameResult, string.format(loc("%s wins!"), winnerTeam))
 
 		for i = 1, TeamsCount do
 			SendStat(siPointType, loc("points"))
@@ -814,7 +814,7 @@
 					text = loc("%s (%s) is Rambo in a hedgehog costume! He destroyed %d invaders in one round.")
 				end
 			elseif awardRoundKills.value >= 11 then
-				text = loc("%s (%s) is addicted to killing: %d invaders destoyed in one round.")
+				text = loc("%s (%s) is addicted to killing: %d invaders destroyed in one round.")
 			else
 				text = loc("%s (%s) destroyed %d invaders in one round.")
 			end
@@ -1526,7 +1526,7 @@
 		
 				end
 
-				AddCaption(loc(string.format("Round score: %d", roundScore)), 0xFFFFFFFF, capgrpMessage2)
+				AddCaption(loc(string.format(loc("Round score: %d"), roundScore)), 0xFFFFFFFF, capgrpMessage2)
 
 				-- other awards
 				awardRoundScore = UpdateSimpleAward(awardRoundScore, roundScore, 50)
@@ -1862,7 +1862,7 @@
 			PlaySound(sndExplosion)
 			PlaySound(sndShotgunReload)
 			wepAmmo[0] = wepAmmo[0] + barrelBonus
-			AddCaption(string.format("+%d Ammo", barrelBonus), 0x00ff00ff,capgrpMessage)
+			AddCaption(string.format(loc("+%d Ammo"), barrelBonus), 0x00ff00ff,capgrpMessage)
 			DrawTag(1)
 
 			GK = GK + 1
@@ -2102,7 +2102,6 @@
 				--nw WriteLnToConsole("Collision confirmed. The gtExplosives is within the circ radius!")
 
 				dist = (GetDistFromXYtoXY(vCircX[i], vCircY[i], getGearValue(gear,"XP"), getGearValue(gear,"YP")) - (NR*NR))
-				--AddCaption(loc("Dist: ") .. dist .. "!",0xffba00ff,capgrpGameState)
 				if dist >= 1000000 then
 					sniperHits = sniperHits +1
 					AddCaption(loc("Sniper! +8 points!"),0xffba00ff,capgrpGameState)
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sun May 14 19:08:57 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Tue May 16 21:37:46 2017 +0200
@@ -997,8 +997,6 @@
                         	loc("Complete the track as fast as you can!") .. "|" ..
                                 loc("Round limit:") .. " " .. roundLimit .. "|" ..
 				loc("You can further customize the race by changing the scheme script paramater.") .. "|" ..
-								--loc("For example, the below line would play map 4, with infinite fuel for the flying saucer, and four rounds.") .. "|" ..
-								--"m=4, ufo=true, rounds=4" .. "|" ..
 
                                 "", 4, 4000
                                 )
--- a/share/hedgewars/Data/Scripts/TargetPractice.lua	Sun May 14 19:08:57 2017 +0200
+++ b/share/hedgewars/Data/Scripts/TargetPractice.lua	Tue May 16 21:37:46 2017 +0200
@@ -222,7 +222,7 @@
 		if GetGearType(gear) == gtHedgehog then
 			if not game_lost then
 				game_lost = true
-				AddCaption(loc("You lose!", 0xFFFFFFFF, capgrpGameState))
+				AddCaption(loc("You lose!"), 0xFFFFFFFF, capgrpGameState)
 				ShowMission(params.missionTitle, loc("Aiming practice"), loc("Oh no! You failed! Just try again."), -amSkip, 0)
 
 				SetHealth(player, 0)