1. HotdogWithMustard

    Newcomer

    Joined:
    Jan 12, 2019
    Messages:
    11
    Country:
    United States
    I seen that, I wrote a script in AHK to automatically go through and add <br> in the appropriate places. (Beginning of dialog, after a set amount of words, etc)

    I'll post it here when I get off work.
     
    Minalia likes this.
  2. Minalia

    Minalia Newbie
    Newcomer

    Joined:
    Feb 10, 2019
    Messages:
    3
    Country:
    United States
    There are a lot of mistranslations as i said... and I'm wondering if you manually copy/pasted things because some "Mistranslations" are obviously misplaced... I can't DM here but if you add Mina#1946 on discord we can talk more. I streamed DQB recently in its entirety and I really want to stream DQB2 as well but I couldn't in good conscience stream until it makes enough sense to explain to the audience :P
     
  3. HotdogWithMustard

    Newcomer

    Joined:
    Jan 12, 2019
    Messages:
    11
    Country:
    United States
    Here's the script I wrote to fix the text wrapping.
    The script goes through each line and splits the text into words then counts how many words till it hits >= 40 character mark and inserts a new line before or at the mark.

    It's written in AHK (AutoHotKey) so you'll need to install that in-order to use it.
    After you have AHK installed create a new file, name it whatever but make sure the extension ends with .ahk, drop the code in the file and then double click the file to run the script.

    Once you run the script it'll ask for a directory, select the directory that contains the translated text files and then wait till you see the done message.
    (It may take a couple minutes to process all the text)

    Some additional notes:
    • The script will only processes files that match this file format: FILE_*.txt
    • The script will only process lines that contain "<key>", the only exception to this is the item description file, it'll process all lines in that file. ("FILE_10.txt")
    • The character name variable ("<pname>") will be replaced with "Dude". (I did this because the text is normally Japanese and it made for some interesting dialog. :rofl:)
    • Lines that contain "<key>" will start with a new line, I do this because lines that contain <key> require user input and are usually dialog lines, dialog lines tend to have the NPC's name right before the dialog and having a new line after the NPC's name makes the text a bit more readable.
    • The script uses a custom function to calculate the text length (used for detecting when to insert a new line). The function is setup to replace all in-text variables with a space then return the total string length. If it detects a certain variable ("<iname>", "<string>", "<space>") in the text, it'll return an invalid length to trigger a new line, It does this because these variables get replaced with different text in-game and I can't really measure the length of the text If I don't know what the text is going to be..
    • You can process individual files by dragging and dropping them onto the compiled version of the script.
    • I was pretty baked when I wrote this and only briefly glanced over it, so please excuse any redundant code and or other issues that I might of over-looked. :)

    Code:
    #NoEnv
    #SingleInstance, Ignore
    
    if (FileExist(A_Args[1]))
    {
        ProcessFile(A_Args[1])
    }
    else
    {
        FileSelectFolder, Path, % "*" A_ScriptDir, 0, % "Select Translations"
     
        if (!Path)
        {
            ExitApp
        }
     
        loop, Files, % Path "\FILE_*.txt", F
        {
            ProcessFile(A_LoopFilePath)
        }
     
        MsgBox, % "Done!"
    }
    
    GetLength(Input)
    {
        while (RegExMatch(Input, "<[\/\$]?([^<>\(\)]+)[^>]*>", Match))
        {
            if ((Match1 == "iname") || (Match1 == "string") || (Match1 == "space"))
            {
                return 100
            }
     
            Input := StrReplace(Input, Match, " ", , 1)
        }
     
        return StrLen(Input)
    }
    
    ProcessFile(Input)
    {
        Local Text
        RegExMatch(Input, "^FILE_(\d+)", Match)
     
        loop
        {
            FileReadLine, Line, % Input, % A_Index
     
            if (ErrorLevel)
            {
                break
            }
     
            if ((Match1 == 10) || (InStr(Line, "<key>")))
            {
                Line := ProcessLine(Line)
            }
     
            Text := Text Line "`n"
        }
     
        if (Text)
        {
            FileDelete, % Input
            FileAppend, % Text, % Input, % "UTF-8"
        }
    }
    
    ProcessLine(Input)
    {
        Local Line, Prefix, Suffix, Index
     
        if (RegExMatch(Input, "^\[email protected]", Prefix))
        {
            Input := SubStr(Input, StrLen(Prefix) + 1)
        }
     
        for Index, Text in StrSplit(Input, "|")
        {
            if (Index > 1)
            {
                Line := Line "|"
            }
     
            if (RegExMatch(Text, "\s*<key>\s*$", Suffix))
            {
                Text := SubStr(Text, 1, -StrLen(Suffix))
            }
     
            if (RegExMatch(Text, "(\w+)?<pname>(\w+)?", Match))
            {
                Text := StrReplace(Text, Match, Match1 (Match1 ? " " : "") "Dude" (Match2 ? " " : "") Match2)
            }
     
            Text := StrReplace(Text, "…", "...")
            Text := RegExReplace(Text, "\s*<br>\s*", " ")
            Text := RegExReplace(Text, "\s{2,}", " ")
     
            Array := StrSplit(Text, " ")
            Index := 0
     
            loop, % Array.Length()
            {
                Characters := Array[A_Index]
                Length := GetLength(Characters)
       
                if ((Index + Length >= 40) || ((Array[A_Index + 1]) && (Index + Length + 1 >= 40)))
                {
                    Line := Line "<br>"
                    Index := 1
                }
       
                if ((Index) && ((!InStr(Line, "<br>")) || (InStr(Line, "<br>", 0, 0) != (StrLen(Line) - 3))))
                {
                    Line := Line " "
                    Index++
                }
       
                Line := Line Characters
                Index := Index + Length
            }
     
            if (Suffix)
            {
                Line := "<br>" Line Suffix
            }
        }
     
        return Prefix Line
    }
     
    Last edited: Feb 10, 2019
  4. Minalia

    Minalia Newbie
    Newcomer

    Joined:
    Feb 10, 2019
    Messages:
    3
    Country:
    United States
    Where's the output files?

    Edit: oh... it edits the files themselves. ok then :P
     
    Last edited: Feb 11, 2019
  5. cobjak

    cobjak Newbie
    Newcomer

    Joined:
    Jan 16, 2019
    Messages:
    9
    Country:
    France
    Heu guys someone can share file pleaaaaaase ?
     
  6. masagrator

    masagrator The developper
    Member

    Joined:
    Oct 14, 2018
    Messages:
    2,334
    Country:
    Poland
    For what? Game will get Western release 12th July confirmed in last Direct. So noone now wants to take time to translate this game.
     
    Last edited: Mar 5, 2019
    cobjak likes this.
  7. Nazosan

    Nazosan GBAtemp Fan
    Member

    Joined:
    May 12, 2009
    Messages:
    499
    Country:
    United States
    A full blown translation wasn't what was being discussed. Also, it's currently March. There's a reason some people want to do what they can within reason right now.

    Would be nice to have the formatting fixed. Obviously the machine translation itself sucks, but there's not a lot to be done about that.
     
    cobjak likes this.
  8. cobjak

    cobjak Newbie
    Newcomer

    Joined:
    Jan 16, 2019
    Messages:
    9
    Country:
    France
    I would just like someone to share what he has done so far. I do not mind playing in Japanese because it is a language that I learn, but having menus and some objects in English isn't bad thing. And my save is well advanced so I would not play in the western release that goes out too long, it's been 3 months that I play already the game
     
  9. Dark5hroud

    Dark5hroud Newbie
    Newcomer

    Joined:
    May 18, 2019
    Messages:
    2
    Country:
    United Kingdom
    Hi Guys,

    I have been able to extract the LINKDATA.BIN, inject the translations and have transferred the files to the SD as F:\atmosphere\titles\010050000705E000\romfs\LINKDATA.BIN and LINKDATA.IDX however every time i try to launch the game it crashes.

    Anything iv missed ??
     
  10. Falo

    Falo GBAtemp Advanced Fan
    Member

    Joined:
    Jul 22, 2012
    Messages:
    612
    Country:
    Germany
    The auto-translation was made for Update 0 of the game, currently the game is at Update 9.
    If you have any update installed, then the translation will crash the game (lots of new files and more text lines).

    The translation can be ported to the new update and i did update my tools to do this.
    But i never shared my updated tools, because:
    - the english version releases soon (12. July)
    - the story translation is really bad.
    - it's too complicated for a normal user to unpack updated game files
     
    Last edited: May 18, 2019
  11. Dark5hroud

    Dark5hroud Newbie
    Newcomer

    Joined:
    May 18, 2019
    Messages:
    2
    Country:
    United Kingdom
    any chance you can upload your newer version ?? or the unpacker ?? i have the updated linkdata.bin however text files need to be updated to include new lines like you mentioned.

    currently equipment etc is saying lines from conversations as files are out of order with new updates.
     
  12. BennyXCross

    BennyXCross Member
    Newcomer

    Joined:
    Sep 5, 2015
    Messages:
    19
    Country:
    Germany
    @Falo and @HotdogWithMustard I'm trying to rework some textures and models inside the game. Could you maybe give me some tips on how to do that? Does the Injector also add models and textures instead of texts?
    If some of you are skilled enough to work on some kind of mod managing program please pm me, maybe we can work something out.
     
  13. BennyXCross

    BennyXCross Member
    Newcomer

    Joined:
    Sep 5, 2015
    Messages:
    19
    Country:
    Germany
    How do I inject the texture? Is there some kind of folder structure inside the LINKDATA.BIN? Because when I tried it, it just added the.g1t texture to the .BIN and the file size increased. Or do I have to rename the texture to .dat (though that also didn't work and it was added to the file size). I want to replace the texture inside the .BIN with my texture :\
     
  14. BennyXCross

    BennyXCross Member
    Newcomer

    Joined:
    Sep 5, 2015
    Messages:
    19
    Country:
    Germany
    What I don't get. Even when I reinject a file I just extracted from the Linkdata with linkdata.exe. Trying to reinject it works fine, but once I replace the original Linkdata.bin/.idx the game gives me an error and crashes.
    Here's what the .bat looks like: "linkdata.exe inject FILE_02749.dat 2749 LINKDATA.IDX".
    Did I do something wrong?
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Builders, Dragon, Quest