[OLD] How to translate the game (from 0.4.5 to 0.7.3)

Subforum for discussing translation of the Original Story and Custom Stories, the House Party translation system itself, and for translation-related suggestions. DO NOT UPLOAD/SHARE anything but translation files (.txt files OR archives of appropriate .txt files in .rar, .zip, or .7z formats). All applicable parent forum rules, etc. apply.

Moderators: erasmus, ttant

Forum rules
No discussion of piracy, no harassment of forum users or commentary on their language of choice, no advertisements, no trolling of any kind. Be cool to one another.
ttant
Posts: 629
Joined: Sat Sep 17, 2016 6:22 pm

[OLD] How to translate the game (from 0.4.5 to 0.7.3)

Postby ttant » Mon May 08, 2017 3:11 pm

This is the old way, using HPCS creator, for game version 0.4.5 to 0.7.3.


This is not the only way, but it's the way I follow to do the French translation.

I use :
  • Notepad++ because we need something that can handle large file and different encoding
  • AutoHotKey, to speed up the translation import in HPCS creator
  • A java program (java 8 is required) which was not design for that, but still does the trick.
    As it's too big to attach, here is two link to get them (both links allow you to download the same file).
    :arrow: rapidgator mirror
    :arrow: 4shared mirror

Note: There is tons of known issues, mainly the translator not working. so use only yandex or Void translator. Yandex 1.5 need a free translation key you get when registering to their API.

And here is the steps I use :

1. format files:
  • Do a backup of all characters and story files.
  • Open each characters file and story file with notepad++
  • For each of the opened file, remove the part before the first { and after the last } (the non text part).
  • Copy paste the remaining part in http://jsbeautifier.org/
  • Copy paste back the result from jsbeautifier.org in the file
:arrow: all the file are pretty printed now. We will use those file for next part.

2. Extract sentences from pretty printed files
  • Launch qsptools (file translation tab should be the active one)
  • Change Using to Void translator. Do NOT use another one, the replacement is not working in both json parser.
  • Load previous dictionary if you have one. otherwise skip this line.
  • Click on browse to select the folder (or one of the file) which contains the file to parse (from step 1)
  • Change parser to Json character parser (for character file) or Json story parser (for story file)
  • Click on translate.
  • Browse for another file, change parser (if necessary) and click on translate. Repeat as many time as needed.
  • Once you have parsed all the files you want, click on Save to get a XML file.
:arrow: if the parser work, the input file will be suffixed with ".ori". make sure that all character and story file are parsed (so you need to do at least 2 translations: 1 for story file and 1 for all character files - or more if you do character file one by one). you now have a XML file which will be used for the next part.

3. Translation
This part is the longest one, as you have to do it manually :lol:
In the XML file you get from step 2, put your translation as content of attribute translated (instead of the English duplicate).

I mean:

Code: Select all

<entry original="Hey, I'm Stephanie.  Like, what's up?" translated="Hey, I'm Stephanie.  Like, what's up?"/>

Becomes:

Code: Select all

 <entry original="Hey, I'm Stephanie.  Like, what's up?" translated="Salut. Je m'appelle Stephanie. Alors, quoi de neuf ?"/>


4. AutohotKey
This part need the dictionary created at end of step2 and editer during step 3.
Make sure that the XML is valid (open it in a webbrowser - if the content is displayed, it's good, otherwise fix the reported error and refresh the page till all error are fixed)
  • Launch qsptools and go to AHK method generator
  • Load the dictionary
  • click on the Start button
  • Copy paste the produced text in you AutoHotKey script file
  • Right click, reload script on AutoHotKey icon (near the clock)
:arrow: If AutoHotKey produces an error, fix it.

5. HPCS creator
Import all unalterated file from step1 (the backup file, not the pretty printed one, those won't work)
For each english textfield or textarea, click on it, then press ctrl+m.
There are many of them, so don't hesitate to expand every single expandable pane to look for string to translate.
Once every file is done, save your project and export it to test it in HP.

AutoHotKey will try to find a match from the english text and replace it by your translation. if you got a popup, the english text was not found in your dictionnary:
  • You edit original sentence, and I told you not to.
  • You don't use the same file from the start of step1and to import at the beginning of step 5.
  • Some character were replaced by html values and were not restored in the autoHotKey script. You need to find the expected translation and paste it there manually.
  • The parser missed it. It happens some times, so you have to translate it and add one line in the dictionary.
  • Any other valid reason :D

ttant
Posts: 629
Joined: Sat Sep 17, 2016 6:22 pm

Re: How to translate the game

Postby ttant » Mon May 08, 2017 3:11 pm

This part is reserved to provide all the dictionary that you can use to avoid step 1 and 2 from previous post.

Previous versions wont be published here, as there is no point to do a translation for a version which is (already or really soon) deprecated.

  • Public version :arrow: 0.5.7 - HPCS 0.2.0 :
    057.7z
    (42.41 KiB) Downloaded 23 times

  • Steam version :arrow: 0.6.5 - HPCS 0.3.0 :
    065.7z
    (56.95 KiB) Downloaded 39 times

  • Patreon version :arrow: 0.7.0 - HPCS 0.x.x : Not released/published yet.

ttant
Posts: 629
Joined: Sat Sep 17, 2016 6:22 pm

Re: How to translate the game

Postby ttant » Mon May 08, 2017 3:12 pm

This part will explain how to create the AutoHotKey script from the google doc.

But before here is the explanation of how it works :

Code: Select all

^m::

means ctrl + m. So each time you press those, the following method will be called. So don't forget to delete this method once you don't need it any more.

Code: Select all

   clipboard =

empty the clipboard, to avoid ghost in it

Code: Select all

   Send {Ctrl Down}a{Ctrl Up}
    Sleep, 50
    Send {Ctrl Down}c{Ctrl Up}
   ClipWait 1
    Sleep, 50
   if ErrorLevel return
    Send {Del}
    Sleep, 50

Simulate ctrl+A, wait 50ms ctrl+c, wait 50ms, make sure that clipboard is filled, wait another 50 ms, delete the copied text from the textfield/textarea and wait again 50 ms

Code: Select all

    if (clipboard  = "What the fuck is a ""Whip-It""?")
    {
        Send Ou puis-je trouver du "Gaz hilarant" ?
    }
    else if (clipboard  = "Hey again stranger!  How's it going?")
    {
        Send Re-bonjour étranger {!} Comment ça va ?
    }

The dictionary content formatted to AutoHotKey script (or your own if you uses excel as explain later).

So we try to find a match for the clipboard content. If one is found, each character is typed.
I planned to use clipboard (replace clipboard content then paste it), but I got some strange issues.
If someone know a fastest way, i'm all hear :mrgreen:

This is the more tricky part
  • in original sentence, each quote should be escaped by another quote.
  • in translation, each quote is left as-is. Do NOT escape it.
  • in translation, # and ! (there might be other) should be wrapped in { }

Code: Select all

   else
    {
       MsgBox >%clipboard%< not found
        Send {Ctrl Down}v{Ctrl Up}
    }

If the clipboard content is not found, warn user and paste the clipboard conte,t to the textfield/textarea.

Code: Select all

Return

Method's end.

So know, you know how the autohotkey script works.
You just have to convert the google doc to that peculiar format. Excel can do it pretty easily, but you have to delete the unnecessary quotes it adds.
toAhk.7z
(48.46 KiB) Downloaded 20 times


Copy paste the english text in A3+, the translation in B3+.
Copy the F3+ content to notepad++

With the given file, I got :

Code: Select all

"    else if (clipboard  = ""original here"")
    {
       Send translation here
    }"
"    else if (clipboard  = ""B"")
    {
       Send b
    }"
"    else if (clipboard  = ""C"")
    {
       Send c
    }"
"    else if (clipboard  = """"""test"""" !"")
    {
       Send ""test"" {!}
    }"


This contains tons of error, you can easily fix using ctrl+h (replace)
  • >" else if< should be > else if< (quote deleted) and even if for the first one.
  • >""< should be >"< (only one quote - do this only ONCE)
  • >}"< should be >}< (quote deleted)

Then copy-patse the fixed version in you AutoHotKey script, reload the script in AutoHotKey and you can continue

ttant
Posts: 629
Joined: Sat Sep 17, 2016 6:22 pm

Re: How to translate the game

Postby ttant » Mon May 08, 2017 3:12 pm

reserved for something i don't know yet :mrgreen:

stre10k
Posts: 1
Joined: Tue Aug 01, 2017 3:45 pm

Re: How to translate the game

Postby stre10k » Thu Aug 17, 2017 5:05 pm

Now working on Russian translation of original story.

Where are XML files? Or how got them? I tap "save" and nothing happened.

rowd
Posts: 3
Joined: Tue Aug 22, 2017 3:03 pm

Re: How to translate the game

Postby rowd » Tue Aug 22, 2017 3:06 pm

Hi there,

i'd like to work on the french translation (translate the xml file) but it's not clear if you already did it or not as I can't see any completed .xml to download. Could you tell please ?

ttant
Posts: 629
Joined: Sat Sep 17, 2016 6:22 pm

Re: How to translate the game

Postby ttant » Tue Aug 22, 2017 5:48 pm

French translation is there :arrow: viewtopic.php?f=8&t=1395&p=1733#p1733

I update the second post.


Return to “House Party Translation Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests