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

  • I not sure If someone already noticed , but, Translation Aggregator "think" that HIRAGANA and KATAKANA are the same thing. This is very wrong.

    try to translate this short sentence with the Translation Aggregator :

    ここまでできる

    ATLAS translation ( in Translation Aggregator windows )

    It is able to do until here.

    Nowadays I am adding all characters names of the game in Translation Aggregator. Sometimes, some characters names are wrote with katakana, like the pet of this game:

    もっと 姉、ちゃんとしようよっ!
    http://pm.d-dream.com/detail.php?arg_tno=7930

    The name of the pet is コマ ( Koma ) wrote in katakana.

    Try to add コマ ( コマ = Koma ) in Translation Aggregator and try to translate again that same short sentence. See ? the translation become:

    It is able to do by crowding Koma.

    Translation Aggregator "Think" that "こま" in hiragana and "コマ" in katakana are the same thing. This is very wrong. This can create terrible translation mistakes in games where have so much texts in hiragana and have also characters with names in katakana.

    See the difference between hiragana and katakana:

    http://en.wikipedia.org/wiki/Hiragana
    http://en.wikipedia.org/wiki/Katakana
    Last edited by fhc; 08-14-2010, 11:40 AM.
    ...

    Comment


    • Originally posted by fhc View Post
      I not sure If Freaka noticed, but, using notepad++, we can delete any entry and save it without any troubles.

      But, If we try to ADD a entry using notepad++, this become damaged.
      fhc, I also wrote that you need to use Edit->EOL conversion->Unix format once you're done with your changes. Then save and it should work.

      Comment


      • Originally posted by Freaka View Post
        fhc, I also wrote that you need to use Edit->EOL conversion->Unix format once you're done with your changes. Then save and it should work.
        Ok. I did it. Now is working 100%. I merged my UserDict with the errzotl80 and created a profile named "AGTH" just to add my own words and separate it from errzotl80's words.

        Then, I deleted my doubt about this subject, since you solved my doubt 100%.

        Thank you very much, Freaka, like always, you are my hero !
        ...

        Comment


        • Originally posted by fhc View Post
          I merged my UserDict with the errzotl80 and created a profile named "AGTH" just to add my own words and separate it from errzotl80's words.
          Unless I misunderstand your sentence, it doesn't work like that. Every profile is only used, when the profile name matches the name of a programm running + the folder it is in. Say if you have a game called 'bloodrose' with an exe called br.exe then it would be onyour disk in c:\program files\bloodrose\br.exe The profile name would be bloodrose\br.exe The entries of this profile will be only used if this program is running. The only exception to this rule is Profile:* which is used always. A profile only named AGTH most likely is never used because there is no foldername/exe named this way.

          Edit: I guess to keep seperate entries you could abuse one of the programs that always run in windows in the background. E.g. windows\explorer.exe or system32\ctfmon.exe
          Last edited by Freaka; 08-14-2010, 11:57 AM.

          Comment


          • If you use the launcher, and tell TA to launch AGTH (As in point TA at the copy of AGTH in its own directory, and tell itself to launch that like it's a game, rather than checking the inject with AGTH option), you'll get an appropriately named dictionary added to the list. That dictionary then will be active whenever the AGTH binary in TA's directory is running.

            fhc: You're right, that behavior is very, very bad. I'll fix that in the next version. Currently, the substitution code uses the same string comparison function as I use for JParser dictionary lookups. JParser allows Katakana and Hiragana to match, but then later it goes back and applies a pretty hefty penalty for strings that don't match exactly.
            Last edited by ScumSuckingPig; 08-14-2010, 02:18 PM.

            Comment


            • I guess this would be a feature wish for a future version: a way to make the hooking address dynamic. I believe we had that topic earlier when talking about .net and also stack trace. Instead of using a fixed address, a way to calculate the final address. I could image this working in the following form, an address at which an initial hook is placed. The first time this address is passed a given calculation/data read is done e.g. [ESP+80]-5 - to pick an address which is on the stack. The initial hook is removed and instead a hook placed at this position.

              I would guess the calculation shouldn't be much of an issue as you're already doing it, not sure about the hook setting and removing part?

              While I think about it, I also need to check your posts again for what can be already done with existing mechanism. [ESP+0x44]^[ESP] is still obscure to me, but I recall we already had that and I probably need to play a bit around with it to get a feeling for it. I guess the way you need to recheck agth every time you see a hooking code, I need to do the same with TA.

              Comment


              • Freaka is right, I need to find a way to make agth to run automatically with Translator Aggregator for my intention of to separate my words. ScumSuckingPig explained how to do it ( I think ) but I admit that I not understand.

                What I need to do to AGTH run automatically everytime that I run Translator Aggregator ?

                I tried to make like Freaka suggested and tried to use "explorer.exe" like a profile instead of "aght.exe" , but, I get a IO error.

                everything is so complicated... I think I will gave up about the errzotl80's UserDict until ScumSuckingPig make a feature where we can use 2 UserDict at same time, and, of course, to load both UserDict at same time everytime that we run Translator Aggregator...
                ...

                Comment


                • [ESP+0x44]^[ESP] is just the XOR of the two. Basically you take the two contexts and combine them in some way likely to produce a result that is likely going to be unique. Anyways, I've already added multiple contexts (A pretty simple change, actually). Still need to update my AGTH conversion code, though.

                  My code currently can't unhook a function (Though a hook can just do nothing after the first call). It also currently is set up to add all hooks at once, though don't think that'd be too hard to change.

                  The syntax for dynamic hooking starts to get pretty messy...
                  Code:
                  wchar:[ESP+0x10]:[ESP+EAX]@[ESP+0x40]@0:whatever.dll:fxn
                  Think it's self-explanatory what that might do...err...given the current discussion.

                  Edit: fhc: If you edit UserDict.txt and add the lines:

                  Code:
                  Profile:Windows\Explorer.exe
                  1
                  1
                  Then you'd have the two separate sections. You could delete the initial 1/1 substitution; it's just there because I may ignore sections with no substitutions in them. You'd currently have to save the file with Linux style line breaks, but that should change when I release my new version (Though I'm still going to be saving with Linux style ones, just in case). If you have Windows installed in another directory, you'd have to change the name as appropriate. Could also just use "TA\Translation Aggregator.exe", or whever you have TA installed to.
                  Last edited by ScumSuckingPig; 08-14-2010, 02:57 PM.

                  Comment


                  • Originally posted by ScumSuckingPig View Post
                    The syntax for dynamic hooking starts to get pretty messy...
                    Messy codes look totally pro and most probably don't care as look as it works hehe.

                    Irregardless on when that is going to be implemented thanks for continuing to evolve and update TA.

                    Comment


                    • You asked for feedback so here is a list of ideas, that could be implemented in TA. I'm not actually suggesting that you implement them.
                      • Add support for a user dictionary for MeCab. I have implemented one in my app and I find it very useful. Especially useful for adding names.
                      • Add scripting support to TA. Lua is a popular scripting language that is often embedded in C++ programs. It could also be used for hooking.
                      • Add support for regular expressions in the substitutions list. PCRE seems to be a popular regular expressions library.
                      • TA only supports dictionaries in EDICT format, but those don't have examples. The best Japanese-English dictionary is supposed to be "Kenkyusha’s New Japanese-English Dictionary (5th edition)". It has lots of examples. It is in the EPWING format. The open source EB library gives access to dictionaries in EPWING format.
                      • If a dictionary entry is big the popup window becomes too big. This is especially the case when a dictionary entry has examples. You could make it fixed size and scrollable. You could also make it display just one entry and the user would have to press a key or click a button to display the next entry.
                      AGTH wiki

                      Comment


                      • All reasonable suggestions.

                        Hadn't thought about MeCab dictionaries. MeCab suffers from the no english docs issue, so I tend not to think about (Or use) it much, myself. If some substitutions could be tagged to be automatically added to JParser/MeCab dictionaries, could definitely get better (and nicer looking) results.

                        I've thought about Lua before, for both substitions and handling hooked text. Could do some really powerful things with it, but I'm just not sure how much interest there'd be in it.

                        Regular expressions would definitely be useful, and are something I've been planning since before I added substitutions. PCRE doesn't sound like my kind of thing, however. A quick google search seems to indicate that there's no Perl regexp reference. Only "tutorials" and lists of modifiers and escape sequences. Probably a bit hypocritical for me to complain about docs, but...

                        Problem with dictionaries not in edict format is they have no usage information, which really helps JParser out (Though not nearly as much as it used to, because of MeCab hinting). Other two problems with EPWing: I've never come across a free EPWing Japanese-English dictionary other than edict, and it's basically a Japanese dictionary format (Meaning no, or minimal, docs in English).

                        Better popup formatting is also a good idea... My tooltips aren't terribly pretty, either, and could use some sprucing up at the same time.


                        Edit: One thing I am thinking of adding is support for launching apps in other languages than Japanese. As I support online translators that work with other languages, only seems logical. My subtitle overlay mod already has all the code I need for a language pulldown menu, too.

                        Probably also a good idea to spend some time cleaning up my code. I know at least a little more about making reasonable code now than I did when I started TA.
                        Last edited by ScumSuckingPig; 08-14-2010, 04:30 PM.

                        Comment


                        • Originally posted by ScumSuckingPig View Post
                          Could also just use "TA\Translation Aggregator.exe", or whever you have TA installed to.
                          thank you very much ! this works splendid !

                          Someone know what I need to do to make my "EOL conversion" of notepad++ in "Unix Format" forever ?

                          Every time that I edit it, is always on "Windows Format" and I need to change to "Unix Format". Then, If someday I forget to change this option, and save it, this will mess up all my work.

                          Or If I save it in "Windows Format" and save it, and notice my mistake, and try to save it again in properly "Unix Format" , this will be ok ?
                          Last edited by fhc; 08-14-2010, 05:07 PM.
                          ...

                          Comment


                          • Wouldn't implementing a scripting language mean a lot of coding work? From my point of view of what it can do in terms of hooking: The hard part about getting a hook is usually to find an address that passes all wanted text. TA can't really help with that unless it gets some special debugging function. Once you have that spot its about sorting out extra garbage. With a good set of established functions to do that there probably isn't much left over to script away. Might be worth to wait and see how much adoption TA hooking sees at all and what it can't solve. Personally I'm using it mostly as a solution where I'm unable to do so with AGTH. Scripting would be then the special solution where the special solution doesn't work.

                            I have to admit I don't have much clue about Lua, given such specific conditions as calculating with stack/register values - is that something you can easily do with it or does that need to be coded anyways?

                            Originally posted by fhc View Post
                            Or If I save it in "Windows Format" and save it, and notice my mistake, and try to save it again in properly "Unix Format" , this will be ok ?
                            Yeah, you can open the file again, make that EOL change and it's fine. I don't know why notepad++ doesn't keep the default line encoding, but I don't know which free editor is doing a better job at that either.

                            Comment


                            • Originally posted by Freaka View Post
                              Yeah, you can open the file again, make that EOL change and it's fine. I don't know why notepad++ doesn't keep the default line encoding, but I don't know which free editor is doing a better job at that either.
                              Thank you very much, Freaka, then, I not need to worry
                              ...

                              Comment


                              • Implementing it from scratch would be, but Lua libraries are open source, and designed to be easy for programs to add it in for scripting support. It would be for, as you say, "sorting out extra garbage" in a game-specific manner, rather than for controlling the injection stuff (Though could be used there, too, I suppose). Might also be useful for more advanced substitutions and general purpose reformatting.

                                Comment

                                Working...
                                X