ghorsington / CM3D2.YATranslator

Yet Another Translator -- Translation plug-in for CM3D2 remade from scratch
https://coder.horse/CM3D2.YATranslator
The Unlicense
28 stars 5 forks source link

Strings don't go back to being untranslated during reload when translation is removed #13

Closed Advent-Seph closed 6 years ago

Advent-Seph commented 6 years ago

Removing all instances of a translation and then reloading doesn't remove the translation in-game without a scene change.

This might be a hangover issue from #8 . Everything else got fixed but this remains.

ghorsington commented 6 years ago

Not related to #8, nor is this a bug.

Why would you even want to restore strings you actually want to replace in the first place? If you use EnableStringReload, that means you want to edit string translations and preview the changes live. That also means you already have the original string -- which you obtained by dumping assets or other means -- in the translation file. As a translator, your work process is most likely as follows

  1. Translate the string and view the changes in-game
  2. Fix the existing translation and preview the typesetting in-game
  3. Move onto the next string

Given that you have the original string in the text files (and your task of replacing it with another string), there is no reason to ever want to restore the original string on the fly. This is the reason why UTP nor TP implement such a feature.

All this rambling notwithstanding, I'll add the feature, as it requires only a small change.

Advent-Seph commented 6 years ago

Sorry about that, m8.

It's just, sometimes the game uses extremely similar looking strings to refer to the same thing but in different places, like this example:

シニヨン&ロール <-For the hair in Maid Edit シニョン&ロール <-For the hair in the Shop

And I find untranslating one as an effective way to see which is which. I could normally just add a random letter or number at the end of the translation to see which is which but, and this might be a separate bug, i'm not sure, sometimes even different looking strings, when translated into something similar, become "linked" and any change on one affects the other too, like for example:

身長 <-on the little black stat card, in Maid Edit 全身 <-In the body category, in Maid Edit

If translating both to Height, any change on one after the fact affects the other, like adding a 1 to the end of one translated string will also add the 1 to the other line, even if the translation for the other doesn't have the 1.

ghorsington commented 6 years ago

The issue you mention is separate, but I shall address it here since it's not worth creating a new issue for.

That's because YAT (and UTP/TP) caches the translated strings as a translated-to-original dictionary -- the "original" being the latest instance of the untranslated string that was replaced.

When YAT attempts to retranslate the visible strings, it uses the dictionary to restore the translated text to its original form. Thus, if the same level contains multiple strings that were translated into the same string, the get restored to the same form. YAT (nor any other translation loader) cannot distinguish these kind of special cases, as it would require the game to provide some additional metadata for each single string.

TL;DR: YAT caches strings, but cannot be a perfect bijection because game. You'll have to live with it.


It's just, sometimes the game uses extremely similar looking strings to refer to the same thing but in different places, like this example:

シニヨン&ロール <-For the hair in Maid Edit シニョン&ロール <-For the hair in the Shop

Then use level indices to distinguish between them. YAT (and pretty much any other plug-in) logs current level index into the console. Moreover, if the same string with the same translation is present in multiple levels, you should put them into a single file and tag it appropriately (e.g. translation.15-16-19.txt to enable the same translations for levels 15, 16 and 19).

Advent-Seph commented 6 years ago

Yeah, I had a feeling that it might not be a bug. Thanks for clearing that up, i'll be mindful of that onward.

I've been using level indices since we spoke on the Hongfire forums, no worries there. In hindsight I realize that was a bad example as they occur on .5 and .8, a more apt example would probably be:

特定のイベントを3種類見ている <-Daily Activity 特定のイベントを3種類見ている <-VIP Events

Both occur on level 24 and seem to only differ by the 3 in the string. It's not so much the level I have issues with, i'm just a bit anal and obsessive about making sure that everything is as proper as I can make it, so I end up triple checking myself just to be sure. Seeing one untranslate during a reload instead of having to worry about whether it's just the dictionary matching them really helps me out.

I've so far managed to completely translate the UI and items in the game, and i'm now starting to translate the dialogue. Your plugin and expertise are the main reason i've been able to figure out as much as I have, thanks again.