Announcement

Collapse
No announcement yet.

[Plugin] IMGUI Translation Loader (+ list of known translated plug-ins) [1.2.1.0]

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Utilities] [Plugin] IMGUI Translation Loader (+ list of known translated plug-ins) [1.2.1.0]

    IMGUI Translation Loaderand some plugin translations!

    Unity's Immediate Mode GUI is often used to quickly debug Unity games. However, the IMGUI is also used by many game mods and plug-ins to generate in-game GUIs. For instance, such plugins as Mutliple Maids, PngPlacement and VibeYourMaid are all users of IMGUI. If the GUI looks plain, transparent gray, most likely it's IMGUI.

    This plug-in allows to easily translate these GUIs without editing the DLL. Finally no need to wait for someone to translate the latest version of your favourite plug-in!

    The project is open source and dedicated to the public domain. The plug-in itself was written from scratch while maintaining compatibility with currently available translations.

    Main features
    • Core based on YATranslator for speed
    • Translates GUIs on by-assembly basis
    • Versions for Sybaris and ReiPatcher
    • Support for RegExes
    • Supports dumping original strings

    You can find more information on IMGUI Translation Loader project page

    DOWNLOAD
    The latest version is: 1.2.1.0
    Remember to read the README, as it contains requirements and an installation guide

    Installation, troubleshooting, help
    You can find all help you need on the project's wiki.

    If you need help or encounter a problem, consult the wiki first.
    I won't be looking at this thread too often because of HF servers being sometimes quite unstable -- moreover, it's hard to keep track of already resolved issues on a forum.
    Until I find a better way to report problems and propose features, consider creating an issue ticket on IMGUI Translation Loader GitHub page to get your problem looked into quickly.

    More info about contributing is in IMGUITranslationLoader Wiki/Contributing.

    Translation files

    To use the translation loader, you will obviously need the plug-in you want to have translated and the translation file itself.
    As the time passes, I might post or link more these translation files.

    To use these, you must have the original, untranslated, version of the plugin you wish to translate
    That's the whole point of IMGUI Translation Loader: no need to use manually edited DLLs just to translate the plug-in's GUI.

    Usage guide: Get the translation text file, put it into UntiyInjector/Config/IMGUIStrings folder (create it if you don't have it yet).
    Last edited by denikson; 01-18-2018, 11:20 AM.

  • #2
    Yes, this is too quick a bump, but just a small notification that a quick fix was issued. Fixed a small problem with some GUIs failing to load.

    Comment


    • #3
      denikson ;-; dude I just finished transing v21... it took me 6 hours. This is a life saver though. I've been meaning to put forward a plugin UI Translator idea....
      Attention! I'm taking a break from hongfire and CM3d2 modding. For modding inquiries, refer to neerhom or the CM3d2 Discord server.
      Please spare me the tentacle and gang rape hentai...


      I'm not a fan.

      Comment


      • denikson
        denikson commented
        Editing a comment
        In the case of MM I just manually transcribed everything from your version, since I just wanted a quick test.

        Of course if you are translating a plug-in from scratch, you can use string dumper provided by this plug-in. It will create a half-done translation file. The only downside is that you have to actually use the GUI to capture all strings.

        P. S. I knew I'd miss something! As I did say, this is mainly a test file (and something to give some value to this new tool) and you do translations much better than me.
        Moreover I don't have all the DLC for the items. If you want, you can enable string dumping and put my test translation into the IMGUITranslationDumps folder. When you run the game, open MM GUI and view the missing translations, the translation loader will add missing strings to the translation file while ignoring already translated strings.
        Last edited by denikson; 12-30-2017, 04:06 PM.

      • krypto5863
        krypto5863 commented
        Editing a comment
        denikson yes, please. I was already cringing at the raw dump I had made. Thanks. I definitely hope to see this plugin in COM.

      • denikson
        denikson commented
        Editing a comment
        No problem. To be honest, this plug-in does not depend on any CM3D2-specific functionality. Thus by default it will work with any Unity game, as long as you get at least ReiPatcher and UnityInjector to work.

    • #4
      Originally posted by denikson View Post
      Main features
      • Supports dumping original strings

      I think i just had a mental orgasm...
      Making futa/yuri master model
      CM3D to CM3D2 mod porting
      Lesbian dual vibrator fix
      Furry maid set
      CM3D2.CategoryUnlocker
      COM3D2.ModLoader
      COM3D2.CategoryCreator

      Comment


      • denikson
        denikson commented
        Editing a comment
        Forsooth! I almost spilled all my tea as well when it worked!

        Do note that, as I had mentioned somewhere in previous comments, you do need to actually run the plug-in and view all the GUI at least once to dump the strings. This is tedious, but better than looking through the assembly (or writing a proper static analyzer).

      • Neerhom
        Neerhom commented
        Editing a comment
        I've read that, though this still sounds a lot better than manually going trough code (compiled or not), every time when there is an update.

    • #5
      Sorry for yet another selfish bump, but here's an important update to the plug-in. Version 1.1.0.0 fixes the vast FPS drop caused by IMGUI Translation Loader trying to figure out the name of the plug-in it tries to translate.

      Note that you still should expect a small FPS drop (my tests showed a drop of 1-5 FPS depending on the plug-in). Nonetheless, it should still be better than about 50% drop.

      EDIT: Released 1.2.0.0 today as well. Removed a glut of unneeded code. If you still don't like the performance hit, try turning on Global Mode.
      Last edited by denikson; 12-31-2017, 07:23 AM.

      Comment


      • #6
        Do I need to uninstall other translations like YAT in order to install this one?

        Comment


        • denikson
          denikson commented
          Editing a comment
          No, of course not! IMGUI Translation Loader is a fully separate plug-in from YAT. The point is that you can use the tool separately from each other. YAT does its own thing, while IMGUI does its own.

        • SpiderNipples
          SpiderNipples commented
          Editing a comment
          That's pretty cool. Thank you.

      • #7
        This looks nice, but what about the sizes of elements? Sometimes the new strings don't fit in the buttons, does this plugin support that?

        Comment


        • denikson
          denikson commented
          Editing a comment
          Unfortunately that is not supported mainly because of performance concerns. Given that replacing just the strings can affect the performance quite severely, catching and modifying the value of almost every call to draw IMGUI will just make the FPS plummet.

          Many plug-ins that were translated to English before this translation loader usually avoided editing the GUI size as well -- mainly because most plug-ins don't have the source code available. Thus, if you really need to fit the text without any abbreviations, you're better off modifying the plug-in DLLs themselves. Not only will the performance be not affected, but you can also make your text fit perfectly at the cost of modifying the DLL by hand.

      • #8
        It looks like variables are considered as part of the string, which makes translation of plugins like PngPlacement quite painful.

        Edit: How is it with regex performance? For example I made an universal filter, that should catch any number with or without the minus sign and/or the decimal mark and then put that everywhere. But would it be better overall if I put less complex filters in places where more complex ones aren't needed?
        Last edited by curseofZ; 01-05-2018, 12:03 AM.

        Comment


        • denikson
          denikson commented
          Editing a comment
          Again, unfortunately there isn't much that this plug-in can do about this. Most plug-ins draw the GUI labels as follows: they take the original label text string, format the variable into a string and combine the two to yield the final string that is passed to the IMGUI itself. Since IMGUI Translation Loader can only catch the final strings that will be put into the GUI, you will have to use RegExes to accomodate for these situations.
          Only few "good" plug-ins put the label text and the value into their own separate GUI labels.

          As with the size editing, this can be solved with editing the plug-ins DLLs by hand. Using IMGUI Translation Loader does not mean one cannot use the "good ol'" method of translating plug-ins by using IL decompilers/editors.

          As for the performance of RegExes, I suggest using the most generic pattern as possible while making as them specific as possible. It's rather contradictory, so let me elaborate:

          IMGUI Translation Loader has to test every single RegEx you declare, so making them really specific will help them fail as fast as possible in the case where the RegEx shouldn't match the provided string.

          On the other hand, you need to consider how RegEx matches successfully: adding too specific a pattern might make matching a bit slower.
          For instance, if you want to match "Test: -0.212" (a common type of label in GUIs), do you really need to use a "universial" number matching pattern? If you know that whatever comes after the space has to be copied into your translation string, you might be just better off using "Test: (.+)" as a pattern instead of an elaborate one that effectively does not yield any better result (that is, unless you REALLY need to match a number and nothing but a number).

          All in all, in the tests I did with some plug-ins I decided to go with as simple patterns as possible. Moreover, I mainly use Global Mode now which helps with the performance (to some extent).
          Last edited by denikson; 01-05-2018, 06:08 AM.

        • curseofZ
          curseofZ commented
          Editing a comment
          denikson Why didn't I think about using just a generic "Test: (.+)" before, that makes much more sense, since I guess it only does one check that either fails or passes and doesn't waste resource with further checks.

          Anyway, thanks for the replies, that helped me understand this plugin more. All in all, I think even if in some cases it's just better to edit the source and recompile, having a separate translation that works with this plugin is still pretty handy, so that new versions of a plugin can still be translated instantly.

      • #9
        @denikson First off, thanks for all your hard work with this project. It is gonna be an invaluable tool for translators like myself! I'm really looking forward to working with it. However...

        I have installed the 3 DLLs (for Sybaris) in the correct specified folders (Managed, Loader, Unityinjector) and created the IMGUIStrings folder in the Unityinjector/config folder (this procedure is all standard for me) and tossed in the translation files, but it's not working for me. Does it only work with a certain game version? I am using 1.54.1 at the moment. It is currently the only Sybaris plugin that I'm having problems with.

        The file called "imguitranslationloader.ini" was indeed created when I loaded the game, so I know it was trying to do something. However, MM and the other plugins are not being translated at all (Load=True is also set of course). I also consulted the wiki page mentioned, but I am still unfortunately not able to get this very nice plugin working..

        Sorry for the bother, any assistance would be greatly appreciated. Thank you for your time.
        Last edited by Anthemoessa; 01-13-2018, 01:41 PM.

        Comment


        • denikson
          denikson commented
          Editing a comment
          Greetings! Thank you for the (somewhat premature) feedback!

          Most likely you're missing the latest Cecil.Inject (based on similar reports). You can grab the latest version from https://github.com/denikson/Mono.Cecil.Inject/releases .

          Moreover, make sure you have all previous pre-translated plug-ins removed. They usually have "English" in their name. In the case of MM, make sure you have "CM3D2.MultipleMaids.Plugin.English.dll" removed. You need the original, untranslated DLL along with the translation file (you can find a list in the OP).

        • Anthemoessa
          Anthemoessa commented
          Editing a comment
          denikson

          That indeed was the problem (The new Cecil file fixed it)! Everything is working fantastically now, thank you so much! This plugin is amazing!
          Last edited by Anthemoessa; 01-13-2018, 02:00 PM.

      • #10
        Made a IMGUI translation file for the cm3d2.facecontrol.plugin. It probably has a couple things that needs fixing because I didn't understand some of the settings. It's not a Google translation though.

        I'm working on cm3d2.alwayscolorchangeex.plugin translation file as well, and it's almost completed. I haven't seen an IMGUI version yet, but I did see a direct plugin translated version (which I didn't look at yet), so maybe Neerhom may want to do it instead? I'm not trying to steal anyone's thunder so out of respect I mentioned this. Either way, I'll drop mine in here when it's done, or maybe we can work together. : )

        I noticed it doesn't translate formatted (bold, colored, etc) text, anyway around that?
        Attached Files
        Last edited by Anthemoessa; 01-14-2018, 08:23 PM.

        Comment


        • curseofZ
          curseofZ commented
          Editing a comment
          Anthemoessa Was doing this for myself at first too, since I always forget what each of those options in preset load do and had to google it up every time. I still think it's worth doing, as it can serve as an alternative. Even though editing the source is easy, it still takes some time and not everyone is able to do that. Having something that will work instantly with a new version without being reliant on someone else isn't all that bad.
          But oh well, thanks for your version.

        • Anthemoessa
          Anthemoessa commented
          Editing a comment
          curseofZ Yeah, I do agree with you on that. If you want to split some work load and work together on ACC, that's fine with me, I like doing it. I also like the text method because it's very simple and easy for everyone to edit. I will focus on another one like shape animator or bone slider (if it actually works now) in the meantime (unless those are being worked on too).
          Last edited by Anthemoessa; 01-16-2018, 01:38 PM.

        • curseofZ
          curseofZ commented
          Editing a comment
          Anthemoessa Yeah, sure. I'm only planning to do this one and maybe revisit MM, since I still saw some props and effects untouched.

      • #11
        Question about regex again. Since the plugin takes only full strings, does that mean the ^ and $ for line start and end don't need to be included right? So for example, when I write "$1.+" does a string like "2345" get checked only once, or will it get checked 4 or so more times trying to find 1 somewhere in the middle?

        Comment


        • curseofZ
          curseofZ commented
          Editing a comment
          denikson This question was more about optimization, since further checking after the first failed character is a waste of resources and since your plugin only accepts whole strings, I thought that maybe the '^' character gets automatically included by your plugin. So, isn't it always beneficial to use it, because even if it found a match in the middle of a string, the string gets discarded anyways, because the plugin only accepts whole strings? Or maybe it can actually match only a part of the original string, which then will get translated leaving what's before it intact, when using regex and I only assumed it doesn't, because of how the non regex translations behave?

        • denikson
          denikson commented
          Editing a comment
          Ah, I see! All I can say is that the devil's in the details! I suggest taking a look at how IMGUITL actually performs the translation of the original string. That is done in StringTranslations.cs line 40 to 50. The part you're most interested is the foreach-loop:

          For each loaded RegEx, IMGUITL runs Regex.IsMatch on the original string. IsMatch tries to find the first match in the string. If a match is found, Regex.Replace is run on the original string again. This time every match (not the whole string) is replaced by the translation string.

          Thus in most cases, "anchoring" the RegEx with '^' may bring some nice boost in performance when the match should fail.
          The reason why IMGUITL (and YAT) don't add '^' to your RegEx is simple: user choice (and compatibility reasons).
          If I were to enforce the addition of the '^', you might lose some of the functionality you might need -- as you deduced, you can make a RegEx that replace only a part of the original text.

          All in all, as I said, you don't loose much for not using '^' -- unless the plug-in you're trying to translate requires a dozen of RegExes or you (for whatever reason) decided to leave the majority of the plug-in's UI untranslated. In these aforementioned cases, however, the difference between anchoring your RegEx and not will most likely have an impact on performance.

          If you decide to anchor every single RegEx you write for IMGUITL from now on, keep it up -- good for you! Though I wouldn't be so paranoid as to go ahead and rewrite every single plug-in translation that already exists.

          Pardon my prolonged, somewhat quixotic, raffle. I hope this somewhat cleared up how IMGUITL actually works and why I don't really care whether you anchor your RegExes or not. As long as you keep your patterns simple, you're already quite good to go.

        • curseofZ
          curseofZ commented
          Editing a comment
          denikson Ah, I get it. Thanks for the clear up. Anyway, I'll asks one more thing, is the plugin able to translate console messages and other messages not part of the UI? I noticed ACC has even windows message box errors. I left some of these in, even though some would still require regex, but if they're not doing anything, I could comment them.

      • #12
        So, I posted the AlwaysColorChangeEx translation in its original thread.

        Comment


      • #13
        Made two small translations for UnderwearAutoChanger and HotKeyFilter plugins. There wasn't much to translate, but it's a mix of google translate and "translations" based off the actual functionality when the previous didn't make much sense.
        Attached Files

        Comment


        • #14
          How do I create a translation file? Trying to learn to translate "Shape + [VYM + API] _ v 0212 (Enhanced shape animation plugin. Zip)" (https://ux.getuploader.com/cm3d2_i/download/150 but I can't figure out where to start. Though at most, I'll just be machine translating.

          Comment

          Working...
          X