Announcement

Collapse

Please use the Hentai ID thread for all hentai ID requests. Click me for link!

The Identification Thread is Here:

http://www.hongfire.com/forum/showthread.php/447081
See more
See less

Translation Aggregator

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Translation Aggregator

    I'm no longer working on Translation Aggregator, but Setx has released an updated version, here. The files attached directly to this post are now outdated

    Translation Aggregator basically works like ATLAS, with support for using a number of website translators and ATLAS simultaneously. It was designed to replace ATLAS's interface as well as add support for getting translations from a few additional sources. Currently, it has support for getting translations from Atlas V13 or V14 (Don't need to have Atlas running), Google, Honyaku, Babel Fish, FreeTranslations.com, Excite, OCN, a word-by-word breakdown from WWWJDIC, MeCab, which converts Kanji to Katakana, and its own built-in Japanese parser (JParser). I picked websites based primarily on what I use and how easy it was to figure out their translation request format. I'm open to adding more, but some of the other sites (Like Word Lingo) seem to go to some effort to make this difficult.

    JParser requires edict2 (Or edict) in the dictionaries directory, and supports multiple dictionaries in there at once. It does not support jmdict. You can also stick enamdict in the directory and it'll detect some names as well, though the name list will be heavily filtered to avoid swamping out other hits. If you have MeCab installed, JParser can use it to significantly improve its results. TA can also look up definitions for MeCab output as well, if a dictionary is installed. In general, MeCab makes fewer mistakes, but JParser handles compound words better, and groups verb conjugations with the verb rather than treating them as separate words.

    TA also includes the ability to launch Japanese apps with Japanese locale settings, automatically inject AGTH into them, and inject its own dll into Japanese apps. Its dll can also translate their menus and dialogs using the ATLAS module (Requires you have ATLAS installed, of course). Versions 0.4.0 and later also include a text hooking engine modeled after AGTH. The menu translation option attempts to translate Windows-managed in-game menus, and is AGTH compatible. The AGTH exe and dlls must be in the Translation Aggregator directory for it to be able to inject AGTH into a process. AGTH is included with the most recent versions of TA.

    The interface is pretty simple, much like ATLAS: Just paste text into the upper left window, and either press the double arrow button to run it through all translators, or press the arrow buttons for individual translation apps. Each algorithm is only run once at a time, so if a window is busy when you tell it to translate something, it'll queue it up if it's a remote request, or stop and rerun it for local algorithms. If you have clipboard monitoring enabled (The untranslated text clipboard button disables it altogether), it'll run any clipboard text with Japanese characters copied from any other app through all translators with clipboard monitoring enabled. I won't automatically submit text with over 500 characters to any of the translation websites, so you can skip forward in agth without flooding servers, in theory. I still don't recommend automatic clipboard translation for the website translators, however.

    To assign a hotkey to the current window layout, press shift-alt-#. Press alt-# to restore the layout. Bound hotkeys will automatically include the current transparency, window frame, and toobar states. If you don't want a bound hotkey to affect one or more of those states, then you can remove the first 1 to 3 entries in the associated line in the ini file. Only modify the ini yourself when the program isn't running. All other values in those lines are mandatory.

    Pre-translation substitutions modify input text before it's sent to any translator. Currently applies to websites, ATLAS, Mecab, and JParser. There's a list of universal replacements ("*") and replacements for every launch profile you've created. I pick which set(s) of substitutions to use based on currently running apps. Note that you do not need to be running AGTH or even have launched a game through TA's launch interface for the game to be detected, but you do need to create a launch profile. May allow you to just drag and drop exes onto the dialog in the future.

    MeCab is a free program that separates words and gives their pronunciation and part of speech. I use it to get the information needed to parse words and display furigana. If you have MeCab installed but I report I'm having trouble initializing it, you can try copying libmecab.dll to the same directory as this program. Do not install MeCab using a UTF16 dictionary, as I have no idea how to talk to it (UTF16 strings don't seem to work). Instead, configure MeCab to use UTF8, Shift-JIS, or EUC-JP. If you have both MeCab and edict/edict2 installed, you can view a word's translation in MeCab by hovering the mouse over it. Also, JParser can use MeCab to help in parsing sentences.

    JParser tends to be a better choice for those who know almost no Japanese - it tells you how verbs are conjugated, handles some expressions, etc. MeCab may well be the better choice for those who know some Japanese, however.

    Source, attached below, is available under the GPL v2.

    Thanks to (In alphabetical order, sorry if I'm leaving anyone out):
    Hongfire Members:
    Freaka for his innumerable feature suggestions and reported issues over the course of development.
    Setsumi for TA Helper and for all his suggested improvements and reported issues, particularly with JParser.
    Setx for AGTH.
    Stomp for fixing the open file dialog not working properly on some systems and adding the tooltip font dialog, and fixing a bug that required admin privileges when certain other software was installed.
    Might sound like minor contributions, but feedback really drives the development of TA.

    Non-members:
    KingMike of KingMike's Translations, who is apparently the creator of the EUC-JP table I used to generate my own conversion table.
    Nasser R. Rowhani for his function hooking code.
    Z0mbie for writing the opcode length detector/disassembler I use for hooking. Apparently was intended for virus-related use, but works fine for other things, too.
    And the creators and maintainers of edict, MeCab, and zlib.

    You might also be interested in:
    *Setsumi's TA Helper and AGTHGrab.
    *errotzol's replacements script.
    *Devocalypse's devOSD.
    *kaosu's ITH (Like AGTH. No direct TA support, due to lack of a command line interface, but definitely worth checking out).

    MeCab
    edict2

    Changelog:
    0.4.9
    * Fixed MeCab/JParser getting stuck when starting a new translation before the last is fixed.
    * Fixed interface lockup while mousing over an item in MeCab while JParser is running.
    * Menu translation will now translate column headings in ListViews (Needed this for the AA launcher)
    * Fixed ATLAS config crash.
    * Global hotkey support. Toggle under "File" menu (Tools is kinda big already). Currently only really supports history navigation. May add more later.

    0.4.8
    * Added history. Logs both original text and translations (For online translators). It logs up to 20 MB of original text, and whatever translations are associated with it. Currently only way to force a retranslation is to toggle one of several options (Autoreplace half-width characters, src/dest language, modify substitutions).
    * Fixed deadlock bug on MaCab mouse over while JParser is running.
    * Fix corrupting built-in text hooker settings when launch failed. Suspect no one uses this, anyways.
    * Drag/dropping an exe onto TA to open up the injection dialog now actives TA.

    0.4.7
    * JParser and MeCab each use their own thread (Mostly).
    * Changed conjugation table format to JSON - plan to do this to a lot of other files (Being careful not to mess up game settings or substitution tables). Currently have way too much file loading code.

    0.4.6
    * Fix WWWJDIC
    * Fix closing injection dialog
    * Updating process list 10+x faster
    * Process list autoupdates
    * Fixed bug that would result in injecting into wrong process when one program is running multiple times.
    * Updated included AGTH version

    0.4.5
    * Added bing support.
    * Updated Honyaku code (They didn't try and block TA, they just modified their HTML)
    * Fixed AGTH command line code.
    * Replaced "/GL" with "/SM" compile option, resulting in faster builds when one has a lot of cores.

    0.4.4
    * Regular expressions are now compiled
    * Injection validation when using addresses relative to dlls (Or function addresses in dlls) should be fixed.
    * Added option to create shortcuts. They'll launch TA (If it's not running) and try to launch the game using the current injection settings (Injection settings that you'd get at the launch screen - the current settings are not saved - it always uses the most recently used ones).
    * Appropriated some of Setsumi's code to make tooltips larger.

    0.4.3
    * Multiple subcontexts now supported. Separate them with semi-colons. AGTH code converter will add two subcontexts, when appropriate.
    * Using aliases for hooks added. Prefix a hook with "[Alias Text]" and that's what will be displayed on the context manager screen as the hook's name. Makes it easier to see context strings.
    * Locale selection added to injection dialog.
    * "Hook delay" added to injection dialog. Actually doesn't delay hooking, delays how long before hooks that use filtering based on calling function's dll are enabled. Generally only the default hooks do this. Increasing this delay may circumvent issues with games that crash when launched with AGTH, but work fine when injected after launching.
    * Added "!" and "~" operators.

    * Stomp's admin privilege fix when using some 3rd party software added.
    * Excite fixed
    * Fixed sanity testing for injection addresses, so when specify a dll or exe name in a text hook, shouldn't erroneously think it's an error when the module isn't loaded in the current address space.
    * Fixed some JParser dicrionary common word parsing, when using versions of edict with entL entries. Also changed treatment of Kanji entries when only their corresponding Hiragana are marked as common.
    * Fixed substitution matching Hiragana with Katakana and vice versa.
    * Fixed a clipboard-related crash bug.
    * Fixed hooks causing crashes when relocating call/jumps (Hopefully...)
    * Fixed AGTH repeat filter length placement (oops).

    0.4.2b
    * Fixed substitution loading/deleting.
    * Fixed << and >>.

    0.4.2
    * AGTH code conversion tool.
    * Injection code checker added.
    * New child process injection handler (Really nifty injection code for that...). Should be a little more robust than before.
    * Option not to inject into child processes added.
    * Auto copy to clipboard added.
    * Both extension filters fixed.
    * Both eternal repeat filters fixed/upgraded.
    * Phrase repeat filter fixed/upgraded.
    * OpenMP/MSVC 2008 SP1 runtime requirement removed
    * char/charBE fixed
    * GetGlyphOutline fixed
    * Copy to clipboard crash when auto translate disabled fixed.
    * Slightly improved dll injection error handling.

    0.4.1
    * More context/filter options.
    * Repeated phrase filter now handles cases where phrase is being extended by a couple characters each time (xxyxyz, etc). Extension filters no longer really needed, unless the repeat starts out too short.
    * Option to handle eternally looping text.
    * Option to ignore text without any Japanese characters.
    * Text which substitution rules reduce to nothing no longer overwrites translated text.
    * Log length limit added.
    * Options to manage default internal text hooks added.
    * Clipboard treated as a context. Its default settings should mirror the old handling.

    0.4.0
    * Added it's own text hooking engine. Probably still buggy.
    * Fixed excessive redrawing when a hidden furigana window had clipboard translation enabled.
    * Works with new, even more poorly formatted edict files.
    * Handles EUC_JP characters that Windows does not (Doesn't use them properly with WWWJDIC at the moment, however). Only really fixes loading edict files with those characters.
    * Fixed right clicking when full screen.
    * Fixed not checking auto Hiragana mode.
    * Less picky when reading MeCab output.
    Attached Files
    Last edited by ScumSuckingPig; 07-11-2015, 11:20 AM. Reason: Change download link, re-upload attachments upon request from Setx

  • Version 0.4.0 released. Note: The source code of new versions are now licensed under version 2 of the GPL. As older versions were released with a more permissive license (No restrictions for non-commercial use), that still applies to versions prior to 0.4.0. People are, of course, free to redistribute my official binaries without redistributing the source. I don't currently plan on GPLing any of the other code I release on these forums.

    Note that for some reason, the forums are putting the new attachments at the top of the file list, rather than at the bottom, where they usually are. I've added a download link to the top of the post, and removed a lot of the ancient versions, to make this a bit less of an issue.

    The internal text hooker is now included, but I have yet to test custom hooks at all, so I recommend not trying to mess with them. Consider its internal hooker potentially rather buggy, so if you want robustness, just stick with AGTH for now (Still supported, and will continue to be supported). The default hooks should work for a fair number of games, but I don't think I've even tested all of them, come to think of it.

    A number of the repeat filters could also use work. Should also probably add a custom phrase repeat filter. Extending repeats is completely untested, and I might need to make it handle more funky cases before it's useful.

    Merging contexts: By default, each context/thread (Henceforth called "context") is handled completely independently of the others. They each have their own timeout before translating. Though currently the timeout value can only be set per process, all other values are set per context, and the contents of each context with "Auto translate" are sent to the translators individually. "Merge text stream" sends a context's data to a merged context as it's received. The individual stream's filters are completely ignored. Merge on flush sends the data to the merged stream only after the idle delay has timed out, and the context's filters are applied first.

    Note that regardless of merge settings, the merged stream is treated as if it's an independent context with data coming straight from a hook. That means once it gets data, its idle delay must also pass before it sends what it has to the translators. Currently, the translators acts just like text is coming from the clipboard (Meaning the auto clipboard settings matter), with the exception that all english text is run through the local translation engines (ATLAS, MeCab, and JParaser). So if a game is partially translated, still works. I may add an option to disable the clipboard independent of the auto clipboard toggles or something, at some point.


    At some point, I'll start adding stuff to the docs directory. Right now, all it has are the custom hook docs from a few pages back.
    Last edited by ScumSuckingPig; 05-03-2010, 06:58 AM.

    Comment


    • Afaik GPL means in a nutshell if you distribute a program that uses a modified GPL source, you need to provide a way to get the modified source as well. You're also not allowed to change the license so ultimately if you use GPL you need to release your own code under GPL as well. However you never need to provide the source directly with the build. GPL doesn't make any restrictions on the commercial useability. As long as you provide a way to get the source you can sell it as much as you want (e.g. linux distributions).

      Don't have much time for testing atm, but will try to do if I can.

      Comment


      • Indeed GPL makes no direct restrictions on commercial usability. I still consider my old "license" more permissive, as I can't see anyone wanting to use the code commercially, but I can see people wanting to use it and not release their source. Admittedly, my old license is not GPL compatible in that one would technically have to add a restriction to GPL to redistribute the code under GPL (Though it could could be used with GPLed code). Anyways, if someone wants to redistribute something using my old code under GPL v2 or later rather than the old non-commercial license, they are welcome to do so.

        Looks like GPL doesn't allow redistribution of non-modified binaries without redistributing the source ("You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways"). Section 4 is for unmodified source. Even if I'm misreading it, probably a good idea for me to make it clear that it is allowed, so others know that (If not allowed under GPL, I'm making an exception to allow people to do so). Without this condition, person A could modify some GPL code, distribute it with binaries, then stop distributing both. Then person B could redistribute just the binaries, and suddenly you're using closed source GPLed code.

        Note that if you use GPLed code (modified or not) as part of a project, you're still free to release the non-GPLed parts of the code under another license. Could be less restrictive, like the zlib or MIT licenses, for example. Also, source does not need to be provided with the binaries under GPL. You just need to redistribute source through one of a variety of means if you also distribute binaries.
        Last edited by ScumSuckingPig; 05-03-2010, 10:46 PM.

        Comment


        • I've tried the new hooking with そぷらの~ボクの初恋ハプニング~ (it's one of the games which can be found in http://www.hongfire.com/forum/showthread.php?t=157594 (if you install it, please also note the comments I added http://www.hongfire.com/forum/showth...02#post2314402 )) which is a somewhat old game and features a perma text output. TextOutA seems to be detected fine and I see the text getting added, but unless I'm doing something wrong it seems TA is unable to extract even a single sentence until I kill the game.

          Comment


          • Doubt you're doing anything wrong, but just in case: All you need to do is check "auto translation" for the context in question (Unlike AGTH, selecting the context is not enough) and make sure clipboard translation is enabled, and the idle timer for that process is set to a reasonable value.

            I'll get the game and look into it. Odd that it's not working, given that it's getting the text successfully, which is the hard part.

            Edit: Something I've been forgetting to mention is that saved per-context settings will probably be lost as I add stuff to save per context. Per process settings will be kept as they have been in the past (Including custom hook codes). Basically everything on the context manager screen except port and whether or not to display all text in the log (Something added mostly for speed) will be lost when I significantly modify amount of information saved per context. At some point, I may implement a scheme to fix that, but it's not currently a big priority, as those settings generally aren't too hard to figure out.
            Last edited by ScumSuckingPig; 05-05-2010, 04:32 PM.

            Comment


            • I sometimes somehow get it to copy from the context into TA if I select the context, though that doesn't happen always. Just for sanity, is the context window supposed to be always open or just set up once and then can be closed?

              Comment


              • Set up once and then closed. I want to set up an easy way of navigating the translation history, but I don't plan on integrating into the context window (Though the history may context information as well). Context window just has too much extra stuff on it.

                That having been said, changes to the context window are applied instantly (Except for the text fields. Changes to those are applied when you unfocus the field), so you don't have to close the context window. That's why there's no "apply" or "cancel" buttons. Might replace "ok" with "done" to make that a little clearer.
                Last edited by ScumSuckingPig; 05-05-2010, 08:21 PM.

                Comment


                • Took at look at the game, and it's being blocked by my filters - not sure why you're getting any text at all, actually. I ignore calls from Windows dlls so you don't get contexts for things like the status bar being redrawn.

                  To determine if a dll is a system dll, I compare its path against the game path. If they're the same, it's not a system dll. It looks like the Windows API I'm using to enumerate the dlls doesn't truly support unicode. Replaces Japanese characters in the path with question marks.

                  Anyways, see if this fixes the problem. Note that the game floods the context when drawing that annoying animated cursor. Maybe I should look into an option for handling that.

                  Also, I'm planning on adding an option to disable the context filters at some point.

                  Noticed the game is crashing on exit, and on start half the time when I don't have menu translation enabled. Former isn't terribly surprising, since I don't clean up after myself. Latter is kinda odd.

                  <Removed, get 0.4.1 instead>
                  Last edited by ScumSuckingPig; 05-12-2010, 10:56 PM.

                  Comment


                  • I tried TA 0.4.0. NAIST-JDIC dictionary is working, great.

                    In the "Select Program" dialog there is the "Launch Program" file dialog. It doesn't show any drives in "My Computer". This has been reported before. This dialog works in all other apps that I tried. I can't even select an exe file. When I select it and click "OK" it doesn't appear in TA. In TA 0.3.5b I also don't see any drive in "My Computer", but I can at least select exe files.

                    Tried the internal hook in 0.4.0 it worked with two games. Although it slowed down one of them sometimes. Even merging worked and that is something that AGTH can't do. I'm running Windows XP SP3. Using the internal hook with normal users rights will crash the game. Only If I start TA with administrator rights the internal hook will work. AGTH works with normal users rights.

                    Overall I think it's great that there is now an open source text hooker. Although I won't be able to contribute I'm sure that other people will.
                    AGTH wiki

                    Comment


                    • Unfortunately, I don't know how to hook without admin privileges. Wonder how AGTH manages it.

                      The explorer dialog thing is really odd. Particularly that you're getting different results in different versions, as I don't remember changing anything there. What OS are you using?

                      Also, with 0.4.0b, you should be able to just drag exe's onto TA instead (There was a bug in 0.4.0 where the form wasn't being populated correctly when doing this). Not a solution, but I have no idea what the heck the problem is. I just populate a data structure and pass it on to Windows. I suspect it's a Windows bug with some simple workaround, since the docs (http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx) don't seem to mention that behavior anywhere...

                      Comment


                      • Unfortunately, I don't know how to hook without admin privileges. Wonder how AGTH manages it.

                        The explorer dialog thing is really odd. Particularly that you're getting different results in different versions, as I don't remember changing anything there. What OS are you using?

                        Also, with 0.4.0b, you should be able to just drag exe's onto TA instead (There was a bug in 0.4.0 where the form wasn't being populated correctly when doing this). Not a solution, but I have no idea what the heck the problem is. I just populate a data structure and pass it on to Windows. I suspect it's a Windows bug with some simple workaround, since the docs (http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx) don't seem to mention that behavior anywhere... Suppose could also be a common control initialization issue. Without any clue what the hell causes it, not a whole lot I can do.

                        Comment


                        • I use Windows XP SP3 Pro 32-bit. I have tried 0.4.0b and selecting exe files in the file dialog works again! I still don't see any drives in "My Computer", but that doesn't matter. I tried drag & drop and it works too.
                          AGTH wiki

                          Comment


                          • Hmm... I changed nothing in 0.4.0b that would have affected the issue you were running into (Other than the drag and drop fix, of course). Bizarre. Don't have a computer running 32-bit XP to test on, unfortunately.

                            Comment


                            • It doesn't show any drives in "My Computer". Confirmed on Windows server 2003 32bit. It does not show any drives.
                              But network neighbourhood shows all my shared drives fine, and when you go back 1 more step from my computer then you can select the drives.

                              Comment


                              • Originally posted by ScumSuckingPig View Post
                                Took at look at the game, and it's being blocked by my filters - not sure why you're getting any text at all, actually. I ignore calls from Windows dlls so you don't get contexts for things like the status bar being redrawn.

                                [...]

                                Anyways, see if this fixes the problem. Note that the game floods the context when drawing that annoying animated cursor. Maybe I should look into an option for handling that.

                                Also, I'm planning on adding an option to disable the context filters at some point.

                                Noticed the game is crashing on exit, and on start half the time when I don't have menu translation enabled. Former isn't terribly surprising, since I don't clean up after myself. Latter is kinda odd.
                                The new version doesn't seem to have changed anything for me. From the context window the text rarely reaches the original text window, however sometimes it does so. It could be just my imagination but it seems if something interrupts the scrolling/textoutput then TA is able to catch up and post it or or something. One issue could be that I'm running it in a VMWare with only a single processor assigned, but if I'm using sleephook there seems to be plenty of cpu to spare (I've tried with and without sleephook).
                                Attached Files

                                Comment

                                Working...
                                X