-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate strings via Japanese→$language dictionaries? #38
Comments
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, (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.) |
Turns out the best implementation is as follows:
|
… screen in all supported versions. And even in some versions that aren't supported yet. Some of those trials for older games don't even have the safe sprintf() hacks yet, which are necessary for translated versions to show up in the first place, heh. Oh, and while I'm at it: • Don't cover the "th?? JP" string unless there is a good reason. This string is typically only used for the human-readable section of replay files, which we shouldn't translate in order to not introduce incompatibilities. • "th08 Music Room spoiler 5" just consists of a single U+3000 IDEOGRAPHIC SPACE, and isn't meaningfully used in later games. … yeah, we *really* need thpatch/thcrap#38.
For spell cards, dictionary based translation is now technically possible. The new {
"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 |
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 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 |
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:
東方紅魔郷.exe
and every game'scustom.exe
to simply not work on non-Japanese locales.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:
Dialogue and endings use a rather involved time code system that additionally gives translators the freedom to edit dialogue on a text box level and allows them to use 2 lines where the original only uses one (and vice versa). This greatly goes against the line-centric design of ZUN's original formats, and is one source of all the complexity in the dialogue patcher (with the other one being the hard line system used in th06, th07 and parts of th08).
Spell cards use their (zero-based) index number in the game's Result screen, which are pulled out from the game's memory using a bunch of breakpoints. This works fine for games that have a result screen. All games that don't (TH095, Uwabami Breakers, TH125, TH143) coincidentally also happen to have no reliable index numbers, and therefore require even more build-specific binary hacks and breakpoints to somehow derive them from the game progression - or, in the case of Uwabami Breakers, a full copy of all .ECL danmaku scripts with corrected IDs. :(
Hardcoded string translation assigns IDs to virtual memory addresses (
stringlocs.js
), then looks up translations for these IDs in a separate table (stringdefs.js
). This is reliable, needs zero game- and build-specific hacks, and I have a script to locate the addresses, but they still need to be committed for every build of every game.Music Room translation uses a combination of hardcoded string translation (for the "No. X ??????" strings displayed for locked tracks), a separate file containing song title translations (
themes.js
) and a separate file for comments (musiccmt.js
).The
themes.js
system was designed before thcrap to serve as a song title source for (hypothetical) third-party applications to cope with frequent translation changes (which in turn was the main motivation for thcrap in the first place).musiccmt.js
basically uses the same format as the generic plaintext translation support that would later be developed for th143, but with a special syntax that replaces a single@
character in a line with a customizable format string, printing the title of the currently selected track.Not to mention that pulling the theme number out of the game also requires its fair share of build-specific breakpoints.
Dialog resource translation makes use of the fact that the widgets (and thus, their strings) internally appear in a set order, builds a JSON array of hardcoded string IDs (
dialog_*.js
) in this order, then pulls the translations out ofstringdefs.js
. Other than that, no build-specific hacks necessary.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.
The text was updated successfully, but these errors were encountered: