thpatch / thcrap

Touhou Community Reliant Automatic Patcher
https://www.thpatch.net
The Unlicense
582 stars 42 forks source link

Translate strings via Japanese→$language dictionaries? #38

Open nmlgc opened 10 years ago

nmlgc commented 10 years ago

With the reorganization of the project and the progress we've made in the last year, I think it's worth raising this question again. The new project administration will need to take a stance on this before covering the next game, and it'll be important to know the background behind my decision against such a system.

It has always been my design goal for thcrap's translation functionality not to rely on any original Japanese strings. This decision stems from two observations:

Combine the two and you have rampant piracy of unofficially translated games. We can't rely on pirated copies coming with the original text anymore. That's just how it is.

This means, however, that we have needed all sorts of alternative indexing systems to correctly assign translations:

Using one single dictionary-based solution instead of these systems would greatly reduce the amount of effort required to support new games at the expense of both compatibility to static patches and more bloat in the translation files.

nmlgc commented 10 years ago

Reposting this from our (now apparently dead) Trello page. I've taken a look at Nutzer's Touhou 8.3 patch and noticed that it frequently uses multiple spell card declarations within a single scene. These would pretty much be impossible to translate without a dictionary system.

Currently, base_tsa merely has an extremely ugly solution to handle this case for the one single scene in the original TH14.3, 3-7, which actually has a second spell card name. It involved finding a certain location in the ECL parsing code that only seems to be called in that specific case, then resetting thcrap's internal spell card ID and assigning the translation for "「リザレクション」" to ID № 1.

(Just in case anyone was still thinking that 14.3 is just a generic Touhou game that shouldn't have posed any difficulty in automatic patching. It is not.)

nmlgc commented 8 years ago

Turns out the best implementation is as follows:

32th-System commented 1 year ago

For spell cards, dictionary based translation is now technically possible. The new spell_id breakpoint can take multiple parameters from multiple places, and combine them into one string to be used as the spell ID. These parameters can even be strings. So it would be possible to have a spell_name breakpoint like this

{
    "spell_id": {
        [
            {
                "type": "s",
                "param": "ecx"
            }
        ]
    },
    "spell_name": "ecx"
}

or this

{
    "spell_id": "ecx",
    "spell_id_type": "s",
    "spell_name": "ecx"
}

However, by being able to combine as many parameters as you want, there is also no need for a dictionary based translation, even in ISC or ISC mods that use multiple spell declarations in the same scene. On the other hand, I think that spell names in content mods should be entirely up to the mod itself, and that just putting the name in the ecl file and leaving it at that is therefore pefectly OK

32th-System commented 1 year ago

In th19, certain server status messages are pulled from the internet. They are therefore

and therefore: only translatable with a dictionary based system. Because of that, I have added a new dict_translate breakpoint. It's placed right before the draw_ctext call that's responsible for drawing those status messages to the screen.

Since we were basically forced to add this functionality, and it has been another 9 years since this issue was opened, using a dictionary based system for other things might warrant another more lengthy discussion