F/HA and F/SN to PO file conversion

It's alright, we feel your pain. Noone wants to admit being gar for Berserker.

Moderator: Staffers

F/HA and F/SN to PO file conversion

Unread postby ranmafan » November 1st, 2009, 9:02 am

Technically, this might be more F/HA related, since that's what I'm testing the script with... but it should be relevant to F/SN and KiriKiri in general, too.

As seen at the end of this thread, I wanted to get a bit more transparency in F/HA translation.

viewtopic.php?f=3&t=1406&start=60

Long story short, I need a way to convert the original .ks files into something that's easily editable with standard tools. Thus I put together a quick-n-dirty perl script that strips embedded scripts, unneeded tags, etc. and produces a standard PO file (as used by GNU gettext).

http://seiba.maidlab.jp/fha/ks2po.pl

Right now, I'm processing the files line-by-line, getting rid of:

Code: Select all
[iscript] - [script_end]
@iscript - @script_end
lines starting with @ or *
empty lines


and writing out the last seen comment (lines starting with ";") and line number as the context for each line that needs to be translated. The goal is to automate the reverse process, too.

So far, it seems to be working with no issues (see the link in the thread above). The next step is to hack some kind of word-by-word suggestion support into Entrans (instead of the current line-by-line) to save time translating...

So, any thoughts?
Last edited by ranmafan on October 29th, 2011, 12:02 am, edited 1 time in total.
ranmafan
Might just like this board
 
Posts: 48
Joined: October 29th, 2009, 11:46 am

Re: F/HA and F/SN to PO file conversion

Unread postby Bejarid » November 8th, 2009, 10:23 pm

Hm, if I understand well what you say, you try to do the same thing I do from some month with the french translation of FSN.

Take a look here and then an exemple of the result here.
Bejarid
Posting more than n00bs
 
Posts: 25
Joined: June 18th, 2008, 7:05 am

Re: F/HA and F/SN to PO file conversion

Unread postby ranmafan » November 9th, 2009, 9:29 am

Bejarid wrote:Hm, if I understand well what you say, you try to do the same thing I do from some month with the french translation of FSN.

Take a look here and then an exemple of the result here.


Yep, I've seen that... the difference is that I want to convert to a specific intermediate format (gettext PO files) rather than arbitrary text. But I'll look through the sources later, thanks. I'm not at all familiar with .NET (and frankly, I'd rather stay that way), but I should figure it out eventually...

Btw, I've also written the counterpart, po2ks.

Actually, I'm not sure how you're converting everything back to the original .ks format... In my case, I'm adding line numbers as comments, and verifying that things match up later - but it seems like you're stripping off pretty much everything except text...
ranmafan
Might just like this board
 
Posts: 48
Joined: October 29th, 2009, 11:46 am

Re: F/HA and F/SN to PO file conversion

Unread postby Bejarid » November 9th, 2009, 7:37 pm

Yeah, I kick anything else [Line...] and howl of berserker.
And then, I copy back the translated text in place of the original text in the original file, between the script lines.

I do it in .Net for performance reason, I can clean all the files of FSN in 0,5 sec, and rescript them in few seconds when I need ^^
Sources should be not too hard to understand I think... But comments are in french (google translate will by your friend :p)

But I don't really understand why you use the PO format, isn't it use for translate programs ? A novel like FHA should not be translate this way, string by string, I think.
Bejarid
Posting more than n00bs
 
Posts: 25
Joined: June 18th, 2008, 7:05 am

Re: F/HA and F/SN to PO file conversion

Unread postby ranmafan » November 10th, 2009, 12:11 pm

Bejarid wrote:Yeah, I kick anything else [Line...] and howl of berserker.
And then, I copy back the translated text in place of the original text in the original file, between the script lines.


If I understand correctly, that might be one too many assumptions... it sounds like a single mistake (e.g. a missing paragraph separator) could screw up the rest of the file easily. I'm also not so sure that it's a good idea to attempt to remove lines and howls - you can't really be 100% sure they're not needed until you see context...

It might be okay for FSN specifically, but, IMHO, better leave it up to the translator to decide. At any rate, I'll look it when I have some spare time...

I do it in .Net for performance reason, I can clean all the files of FSN in 0,5 sec, and rescript them in few seconds when I need ^^
Sources should be not too hard to understand I think... But comments are in french (google translate will by your friend :p)


Dude, it's ridiculously simple line-by-line regex matching on just a few MB of text I doubt you'd have serious performance issues on a modern PC even if you wrote it in Javascript :lol:

But I don't really understand why you use the PO format, isn't it use for translate programs ? A novel like FHA should not be translate this way, string by string, I think.


Yes, a wiki would be better if doing it in a small team, but it kind of discourages casual contributors. Either way, I'm preserving the order in which the lines appear, so it's not like each line is translated entirely out of context...

Using a standard format also means being able to move data between different apps easily if needed.
ranmafan
Might just like this board
 
Posts: 48
Joined: October 29th, 2009, 11:46 am

Re: F/HA and F/SN to PO file conversion

Unread postby Bejarid » November 10th, 2009, 11:14 pm

ranmafan wrote:
Bejarid wrote:Yeah, I kick anything else [Line...] and howl of berserker.
And then, I copy back the translated text in place of the original text in the original file, between the script lines.


If I understand correctly, that might be one too many assumptions... it sounds like a single mistake (e.g. a missing paragraph separator) could screw up the rest of the file easily. I'm also not so sure that it's a good idea to attempt to remove lines and howls - you can't really be 100% sure they're not needed until you see context...

It might be okay for FSN specifically, but, IMHO, better leave it up to the translator to decide. At any rate, I'll look it when I have some spare time...


Sorry, I want to say anything but... Yeah I need to pratice more my poor english I know ^^
It's the only thing I can't rescript easly, so I let it, but in anycase, the translation should be done with the game open imo.
But yes, one mistake (no space in begin of a line for example) screw up the file. However it's not really hard to find and correct so...

ranmafan wrote:
I do it in .Net for performance reason, I can clean all the files of FSN in 0,5 sec, and rescript them in few seconds when I need ^^
Sources should be not too hard to understand I think... But comments are in french (google translate will by your friend :p)


Dude, it's ridiculously simple line-by-line regex matching on just a few MB of text I doubt you'd have serious performance issues on a modern PC even if you wrote it in Javascript :lol:


Believe me or not, I do it in JS in first time, and clean the first file take 10 minutes. Now I clean 727 files in less than one sec... And a more complicated cleaning. But sure other language can make the same result :) In my case I just find it easy to use (debug, performance optimisation...) and fast.

ranmafan wrote:
But I don't really understand why you use the PO format, isn't it use for translate programs ? A novel like FHA should not be translate this way, string by string, I think.


Yes, a wiki would be better if doing it in a small team, but it kind of discourages casual contributors. Either way, I'm preserving the order in which the lines appear, so it's not like each line is translated entirely out of context...

Using a standard format also means being able to move data between different apps easily if needed.


Well, a Wiki is for casual contributor. He find an error ? He click on "Edit", correct the error, and click on "Submit". Same for translation. No download or register needed ^^ I think it's the simplest way for accept casual participation, but I may have wrong.

PO format is relevant if you want to use translate related apps, yes, but I haven't find any of them really usefull for translate something like FSN/FHA. So a free format are enough for me.
Bejarid
Posting more than n00bs
 
Posts: 25
Joined: June 18th, 2008, 7:05 am


Return to Fate/stay night Chat

Who is online

Users browsing this forum: No registered users and 2 guests