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

  • Well the first sentence has a link to a quick tutorial -> http://perldoc.perl.org/perlrequick.html but generally it's always using perl examples.

    Edit: Looks like this tutorial does it without any language specific examples: http://gnosis.cx/publish/programming...pressions.html - although one has to say that there are various regexp flavours and I'm not sure if those examples are full PCRE compatible.
    Last edited by Freaka; 08-16-2010, 04:27 PM.

    Comment


    • Yea...Those two tutorials look better. What I'd really like is a full spec, but tutorials + the reference basically constitute a spec (Not sure about completeness, but could probably write a full regexp matcher with them that could handle most things). Not intending to write one, but I want to be able to get that level of information.

      Edit: On a side note, while I expect average users wouldn't be able to do much with regexps, power users are another matter entirely...assuming they have docs that let them get a fair handle on the language.
      Last edited by ScumSuckingPig; 08-16-2010, 04:38 PM.

      Comment


      • Originally posted by ScumSuckingPig View Post
        They've stopped sending translations to anything sending the user-agent string TA uses. Clearly this is just an accidental server misconfiguration.
        If code that constructs web queries, including user-agent etc, and analyzes response can be moved to external script (lua?) then anyone can post updated script file, say Excite.web and no need to recompile a new version.
        読んでみた。 読んでみようとした。 読めたらいいな、と思った。

        Comment


        • Too much work. If I did that, I'd need to also add junk for how to get translated text out of the resulting HTML, which is the main reason I haven't done so... User-agent isn't really needed, anyways. Can just steal IE's (I'd feel a little guilty stealing FF's or Chrome's ). Just a one time thing, unlike other changes.

          Edit: I've considered letting dlls manage their own translators, but don't think there'd be enough interest in it to be worth the effort, either. If someone else makes the changes, I'd keep them, but not something I'm terribly interested in, myself. More interested in making TA more powerful than spending a couple hours implementing a feature that lets anyone do 2-minute fixes themselves.
          Last edited by ScumSuckingPig; 08-16-2010, 07:42 PM.

          Comment


          • Here's a version with a changed user-agent string. Just to be polite, still use the old one with other sites (Think it's nice to let any admins know what apps are using their site...though not if they change behavior based on that info... And not enough to use a string that clearly identifies TA. )

            NOTE: I've completely rewritten the expression evaluator from scratch (New version is easier to deal with more than 2 or 3 different levels in the order of operations hierarchy. May also be faster - it creates "compiled" expressions when it creates the hooks, so no redundant text parsing. Shouldn't be a noticeable speedup, though, since I don't think interpreting the expressions is a significant speed drain). Anyways, it still needs more testing, though it seems to be working. Just be aware some hooks may not work, due to bugs, which is why I'm not yet updating the version on the first page.
            Attached Files
            Last edited by ScumSuckingPig; 08-16-2010, 08:32 PM.

            Comment


            • Thanks SSP. Was trying to find where the user agent string in the source actually was and I just couldn't find it. Next thing I tried was adding TA to my AdMuncher's filtering list as a temp fix, which allows it to change the user agent of http programs, but TA still spit out the same error in OCN. The 0.4.3b works, so I'm happy clicking one button to get translations again instead of 5-6.

              Comment


              • Originally posted by ScumSuckingPig View Post
                Here's a version with a changed user-agent string. Just to be polite, still use the old one with other sites (Think it's nice to let any admins know what apps are using their site...though not if they change behavior based on that info... And not enough to use a string that clearly identifies TA. )
                Besides banning based on that information I don't see any good coming from it, wouldn't be surprised if most had a statement to disallow automatic parsing as well. Their minds probably rest way easier if they only see IE accessing it. Might be better to not even start this war and hide from the beginning.

                Comment


                • Yea, you're probably right, but I'm going to stick with my own User-Agent, unless someone else starts banning it, or OCN starts banning TA again (It's still possible to ID it as not IE through a number of rather simple methods). And if I do choose to use IE's more, probably will try to keep my own user-agent for WWWJDIC, at least, as it's not a commercial site and has no ads - if they choose to ban TA, not sure I'd implement a workaround, though suspect more people are using MeCab and/or JParser rather than WWWJDIC.

                  Really late edit 1: TA can really spam a server, depending on usage... Will eventually fix that, but I want some way of indicating a translation isn't current before I do, to minimize confusion. Should make banning less likely, too.

                  Really late edit 2: Oh, and Necrosis360, the user-agent is defined in shrink.h (Which serves to define global constants, as a pre-compiled header, and, unsurprisingly, to define some constants that reduce binary size)
                  Last edited by ScumSuckingPig; 08-17-2010, 03:02 PM.

                  Comment


                  • I am playing now Pia Go:
                    Piaキャロットへようこそ!! G.O.
                    http://pm.d-dream.com/detail.php?arg_tno=2792

                    Besides of the fact that this game is a pure love game, I am enjoying this game a LOT. This game have really a LOT of sex and a LOT of anal sex scenes ( I love anal sex scenes ). For suse I begin to become addicted to pure love games ( with anal sex scenes ).

                    However, this game have that "well know" bug of certain games where the name of the character that is speaking comes mixed with the normal text speech, creating terrible translation mistakes.

                    Thanks to TAHelper of Setsumi, I can fix this trouble nicely and I can play the game without any troubles.

                    Thank you very much, Setsumi ! TAHelper is for sure something WONDERFUL !

                    However, for more that I try, I cannot use the feature to add the name of the character inside of 【】 instead of just to remove it. The TAHelper always just remove the name of the character.

                    Of course, I am very happy that TAHelper remove the name of the character, I am not complaining, I really LOVE TAHelper, but, I really think that become more better to add the name of the character inside 【】 .

                    What I am doing wrong ? see screenshot:



                    Of course, you not need to have the game to test it. Here is the text:

                    留美ええ、ついさっき終わったところなの。今日も忙しかったよ。
                    see ATLAS translation:
                    Rumi Yes, Place that ended a minute ago. It was busy today.

                    留美 is the character speaking ( Rumi )

                    TAHelper make it to become like this ( this is good )

                    ええ、ついさっき終わったところなの。今日も忙しかったよ。
                    see ATLAS translation:
                    Yes, Place that ended a minute ago. It was busy today.

                    But, I think, is better like this:

                    【留美】ええ、ついさっき終わったところなの。今日も忙しかったよ。
                    see ATLAS translation:
                    【Rumi】Yes, Place that ended a minute ago. It was busy today.

                    This is important because sometimes, in others games, I not know WHO is speaking If I cannot see the name of the character that is speaking. This is terrible specially in games that have so many sub-characters, and most of these others games, most of the sub-characters not have voice acting, then, is really almost impossible to know who is speaking If is removed his name from the text, then, is really better to add the name of the character inside of "【】" than just remove it.

                    Then, what I need to do to make it to work well ? What I doing wrong ?

                    Of course, I am using the latest version of TAHelper.

                    I really LOVE the symbols "【】"

                    the most common eroge symbol is "「」" , but, sometimes, is some rare moments, I admit, is not sufficient to separate the text speech from the character that is speaking is certain texts, because of this, I make my Translator Aggegator to automatically substitute all "「」" to "【】"

                    For some unknown reason, "【】" is 100% perfect, the translator machine always separate the text inside "【】" from the other texts or words in 100% of all texts always.
                    Attached Files
                    Last edited by fhc; 08-17-2010, 03:32 PM.
                    ...

                    Comment


                    • hi there!

                      Thanks for fixing OCN, or rather for anything that has been fixed with 0.4.3/b.

                      But something with AGTH/TA seem to be wrong now...

                      I'm playing Kanojo x Kanojo x Kanojo at the moment, and there are some issues.

                      first(0.4.2&0.4.3/b): the internal hook works (with the converted h-code), but you need to click somewhere (other than the game) to get the text to show up in TA after some new text appered. it's the only game i've played so far that has this issue.

                      there is no problem with agth in 0.4.2, but with 0.4.3/b TA won't copy/grab anything from agth correctly. there are randomly missing parts in TA, while AGTH grabs everything correctly.

                      i've played a little with those new settings, but no joy.

                      Comment


                      • New settings shouldn't have anything to do with either of those issues (Neither of which I can duplicate, though I don't have that game).

                        Which version of the game are you playing? The doki-doki one (/HSC@4044F0) or the original one (/HS-4@4044D0)?

                        Comment


                        • fhc
                          Apparently a bug.
                          As a quick fix, put that name again (or translated equivalent) after Ctrl-Tab.

                          読んでみた。 読んでみようとした。 読めたらいいな、と思った。

                          Comment


                          • Just a quick request for comments (Or better ideas, more accurately, if anyone has them) - next version is going to use the aforementioned PRCE regexp library. Since ordering regexps by length and using the longest that starts at the earliest position makes a bit less sense with regexps (And I don't think the library lets you specify start position, without specifying an end position as well), I'm going to switch to prioritizing regexps by order (And disable auto-sort). I'm not going to make any promises about ordering of regexps in different profiles, except I'll go through one entire profile at a time. I'll just replace all the matches to one regexp, then move on to the next, etc. Also going to remove case-insensitivity, by default.

                            Currently, for simplicity, I'm leaning towards making everything a regexp. There are a couple potential issues with that: Unintuitive behavior for average users, and possibly reduced speed, if there are a lot of strings. I'm more concerned about the former than the latter. Only other options I see are:

                            1) A prefix for regexps (Or non-regexps)
                            2) A per-string setting.

                            Problem with 2 is that it wouldn't be visible when looking at a string list. Problem with 1 is that it's kinda ugly, and then there's always the case of when you want a regexp/non-regexp starting with that special character... Think the always regexp route is just simpler.
                            Last edited by ScumSuckingPig; 08-17-2010, 08:37 PM.

                            Comment


                            • The Translation Aggregator is absolutely amazing! Thanks for your hard work!
                              I just started experimenting with the Hide Toolbar/Frame options alongside "Always on Top".
                              It's cool how I can fit it exactly over the textbox in-game.

                              I noticed it's easy enough to change the font color, but is there any way to change the background color as well?
                              It would be cool to be able to match or find something similar to the color schemes used in-game. (Like white text on top of a dark navy blue box)

                              Comment


                              • No way to do that yet - there's not even a global config screen.

                                Comment

                                Working...
                                X