How to translate .lua file

16 replies [Last post]
ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

Hello,
I would like to help with the translation. I have the it.lua file

E.g.:


["Rounds Complete"] = "Round Completati",
-- ["Rubber Band"] = "", -- Construction_Mode

How to translate the second string? I just need to remove "--" at the beginning of the line and remove the "-- Construction_Mode" string? I see that the translated string don't have the "-- Construction_Mode" (or similar) at the end.

Thanks

sphrix
sphrix's picture
User offline. Last seen 1 day 20 hours ago. Offline
Joined: 2011-04-07
Posts: 207

the -- is to comment a line, or comment at the end of a line

So this line :

-- ["Rubber Band"] = "", -- Construction_Mode

is a comment, that mean the game won't read it

To translate it, remove the first --, so the game read the line, and it stop to read it when it reache the second -- : -- construction mode

dont delete the second -- , it is here to show people where the line come from, in this example the line come from the construction mode file. (it happen that there is no second -- ).

put the translation here :

-- ["Rubber Band"] = "TRANSLATION HERE, BETWEEN THE " ", -- Construction_Mode

and keep the " , " at the end of the translation Wink Smiley

Devs and other people might add interesting stuff to my comment but you can start i guess Smile

the beachs hogs surfin hedgewars

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

sphrix allegedly wrote:

the -- is to comment a line, or comment at the end of a line

So this line :

-- ["Rubber Band"] = "", -- Construction_Mode

is a comment, that mean the game won't read it

To translate it, remove the first --, so the game read the line, and it stop to read it when it reache the second -- : -- construction mode

dont delete the second -- , it is here to show people where the line come from, in this example the line come from the construction mode file. (it happen that there is no second -- ).

put the translation here :

-- ["Rubber Band"] = "TRANSLATION HERE, BETWEEN THE " ", -- Construction_Mode

and keep the " , " at the end of the translation Wink Smiley

Devs and other people might add interesting stuff to my comment but you can start i guess Smile

Thank you very much.

So the string:
-- ["Rubber Band"] = "", -- Construction_Mode

becomes
["Rubber Band"] = "Banda Elastica", -- Construction_Mode

correct? I've seen that all the italian translated strings doesn't have the last comment "-- Construction_Mode". Do you think I should start from scratch or continue with this file?

nemo
nemo's picture
User offline. Last seen 2 weeks 2 days ago. Offline
Joined: 2009-01-28
Posts: 1861

The comments are nice to have but not essential. It's mstly to give context.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

nemo allegedly wrote:

The comments are nice to have but not essential. It's mstly to give context.


Ok, thank you very much. I'll start translating soon. Do you know when the new version will be released? I would like to translate more strings and improve the italian translation before the new release, but it's not essential Smile

sphrix
sphrix's picture
User offline. Last seen 1 day 20 hours ago. Offline
Joined: 2011-04-07
Posts: 207

release schedule

If the release schedule doesnt help you, i would guess it would be near halloween

And your exemple for translation is correct Wink Smiley

the beachs hogs surfin hedgewars

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

One simple question. If some strings is used in italian without translation (e.g. "highlander" which is common in italian, too) do you prefer to leave the string unstranslated or translate it with the same content?

sheepluva
sheepluva's picture
User offline. Last seen 5 days 2 hours ago. Offline
Joined: 2009-07-18
Posts: 563

ocirne allegedly wrote:

One simple question. If some strings is used in italian without translation (e.g. "highlander" which is common in italian, too) do you prefer to leave the string unstranslated or translate it with the same content?

Translate with same content, I'd say. Otherwise people or scripts checking for Translation completeness could falsely categorize that string as missing translation.

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

sheepluva allegedly wrote:

ocirne allegedly wrote:

One simple question. If some strings is used in italian without translation (e.g. "highlander" which is common in italian, too) do you prefer to leave the string unstranslated or translate it with the same content?

Translate with same content, I'd say. Otherwise people or scripts checking for Translation completeness could falsely categorize that string as missing translation.


Ok thank you! I'll upload the file on bugzilla next week I think Wink Smiley Thanks for help

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

Hello, I've translated the entire "Classic Fairytale" file. I'm now playing the adventure to see if the translations are correct and coherent with the game, but I would like to unlock all the levels (I can't even pass the 3rd mission which seems buggy). Is there any way to unlock all the missions?

P.S. Where I can find the "A Space Adventure" translation file?

sphrix
sphrix's picture
User offline. Last seen 1 day 20 hours ago. Offline
Joined: 2011-04-07
Posts: 207

find the folder of the campaign and edit the file " campaign.ini" MissionNum=X replace X with the right number

also, try to do the mission yourself, it is way better Wink Smiley

for the translation file of A space Adventure, i dont know, should be the same as the other campaign, maybe it is not yet added to the locale file...

the beachs hogs surfin hedgewars

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

sphrix allegedly wrote:

find the folder of the campaign and edit the file " campaign.ini" MissionNum=X replace X with the right number

also, try to do the mission yourself, it is way better Wink Smiley

for the translation file of A space Adventure, i dont know, should be the same as the other campaign, maybe it is not yet added to the locale file...

Hello, modify the campaign.ini file didn't work. It's already set to MissionNum=10 but also modifying this value doesn't unlock the missions. I've seen that the mission unlocked have a .hwp file but I can't open it. Maybe this file is needed to unlock a mission?

My intention was to play every map, but the "journey back" seems buggy for me. The other Hogs doesn't move and I cant take the crates as I have no ropes os something useful. I spent a lot of time trying to understand how to play that mission but I can't. I'm spending more time to play THAT mission than to review my translation. The latter is the priority for me at the moment Smile

sphrix
sphrix's picture
User offline. Last seen 1 day 20 hours ago. Offline
Joined: 2011-04-07
Posts: 207

the .hwp is just the map file if i remember correctly

i remember reading in IRC that there were bugs on the campaign, but Wuzzy worked on it to fix the most bugs possible, try to install the beta version of the next release, : http://hedgewars.org/node/6772

also, usually modifying the campaign.ini work (i done it when i tested my shoppa campaign), but i think the problem here is because the campaign let you some choice so if you dont play the mission you dont write the choices in the next mission's lua file, so.... wait a real developper come with a better answer than mine ^^ i can't help more sorry

you can read the lua file to see how you would like your translation, see if it fits etc...

the beachs hogs surfin hedgewars

KoBeWi
KoBeWi's picture
User offline. Last seen 3 days 21 hours ago. Offline
Joined: 2010-12-25
Posts: 564

sphrix allegedly wrote:
i remember reading in IRC that there were bugs on the campaign, but Wuzzy worked on it to fix the most bugs possible, try to install the beta version of the next release, : http://hedgewars.org/node/6772
The alpha version of next release has broken campaigns and you can't run them at all.

ocirne
User offline. Last seen 6 years 30 weeks ago. Offline
Joined: 2017-09-03
Posts: 8

Thank you, both.

I'll try to do my best to translate the right way. I have no problem translating the content of the game, but italian is a bit more complex than english.

E.g.: "You have to wait"

"You" can be used if talking with ONE person or MORE than one person... "have" is always "have". In italian there are different verbal forms. "Tu devi aspettare" (One person) or "Voi dovete aspettare" (more than one person). This can make a simple talk totally non-sense.

This is why I would need to play every single mission to provide a good translation Smile

sphrix
sphrix's picture
User offline. Last seen 1 day 20 hours ago. Offline
Joined: 2011-04-07
Posts: 207

yep, i had the same problem when i worked on the french translation, i guess a lot of langages need more context,

try to hand around on the irc, maybe you can direc speak with the developpers in charge Wink Smiley

maybe, and that might help you just a little, you can find a walkthrough on youtube, or in the demo section, ask if anyone has the demo files (i havent ;p )

the beachs hogs surfin hedgewars

Wuzzy
Wuzzy's picture
User offline. Last seen 2 weeks 4 days ago. Offline
Joined: 2012-06-20
Posts: 1301

So, the original question of this thread seems to be answered, right?

For more questions about translations, go to https://hedgewars.org/kb/Translations

Yes, the .lua file has a very confusing syntax for those who do not program in Lua. Yes, these .lua files contain real code of a programming language, which is a bit crazy. xD

I guess I will explain this strange .lua file translation in that wiki page soonish.

Hi, I am a Hedgewars developer. Smile

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]