RE: The setting to change the Language of the game to Any language - #2441
Conversation
There was a problem hiding this comment.
Preliminary review. I've already mentioned some of this on Discord but am repeating it here for reference.
- The hint area type being language-dependent is going to be an issue for parts of the codebase that don't directly interact with text and therefore don't care about the language. Currently, if I understand the code correctly, these just use an English-language version of the hint area type. This will cause issues if such a hint area value does end up in language-specific code and causes text to be generated in English instead of the correct language. I'd separate the language information from the hint area by passing it as a parameter to methods that generate text.
- Some of the variable names and magic strings (e.g. magic strings called
o,wiw, andcbf; single-letter variable names inLanguage.format_from_textandPatches.create_fake_name) are difficult to understand at a first glance. I would recommend replacing them with longer, more descriptive names. - There seem to be some pieces of logic that check if the language is English and use the logic for Japanese in the
elsecase. The level of Japanese proficiency among maintainers and contributors is much lower than that of English, so for maintainability, English should be the fallback case. - The PR adds
.DS_Storefiles to the repo. These should be removed, and I recommend adding them to your.git/info/excludeto prevent accidentally adding them back in the future. - The JSON file uses fixed-length (tuple-like) arrays in some places. To make it easier to read, I suggest replacing these with objects (
{}) with descriptive property names.
I will take a closer look at specific parts of the code and go into more detail in a later review, once CI is green.
|
Most of the system reworked, deleted .DS_Store, add some descriptions to the |
|
Sorry there was some typos in |
cjohnson57
left a comment
There was a problem hiding this comment.
Some pretty major (but easily fixable) issues with the setting definition itself, adding this separately before I review the rest of it.
|
Got different errors when trying to generate in English and Japanese. English: Seems to be because the dungeon name has a control code in it. Also, pretty sure the Japanese: Adding def from_bytes(
cls,
bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer,
byteorder: Literal["little", "big"] = "big",
*,
signed: bool = False,
)@flagrama any ideas here? Anyway, fixing that issue ran into the same issue English did with the dungeon name. |
LangDev here, this is probably because of the given value is For the requested changes, moving the |
cjohnson57
left a comment
There was a problem hiding this comment.
Here's my review of the rest of the code. Admittedly mostly nitpicks, but a few actual issues.
Thanks so much for all your work on this!
|
Thanks for your quick fixes on my first two messages! Can confirm they're resolved. I could launch the ROM and talk to NPCs and read hints in both English and Japanese. |
Regarding the last request, I'll edit them right now! |
|
One question, what exactly is the purpose of the |
FYI, the default value is just a change made in python 3.11. If you are using 3.11 or newer, this error won't appear. If you are using anything older this error comes up. If you are using 3.11 or newer but you have your dev environment set up to ensure everything works as far back as 3.8 it may be doing something additional to cause that error to show up. |
|
Interesting, ty for the info! |
Also, the |
|
Gotcha. Should that be "plain" texts? |
Oh, sorry yes |
cjohnson57
left a comment
There was a problem hiding this comment.
Thanks so much for all your changes! It's good now as far as I can tell.
Before merging, we should also get approval from Fenhl, and probably more testing of full JP seeds.
|
@cjohnson57 Thanks for the detailed reviews! |
|
Add UnitTest that checks language file / properties Below this is template for the errors If the language file misses If some properties are missing / wrong in If some bin files are not included in the |
|
Unless the conflicts revolve with in-game messages or custom texts, all conflicts will be resolved after merging |
|
Might make sense to document that in a new file in the Notes directory. |
|
Currently I'm working on the Note file and some adjustment for word gender properties |
… into dungeon_gender, added notes for both formatting and textures
|
@fenhl Added Notes for both texture gathering and syntax |
|
I would recommend keeping this PR focused on Japanese for now, and handling any changes necessary to support more languages later in separate PRs. The bulk of this PR has already been reviewed and tested, and making changes to support other languages here as well risks getting it stuck in the review process. |
|
@fenhl Unfortunately there is one small problem within the last 2 updates (revolving |
|
@fenhl Ok, now I can confirm that all of the issues are resolved |
|
@fenhl How's the test going? Currently, I'm doing some implementations for other languages such as German, French and Spanish For French, I found that some characters aren't implemented in the official game such as œ and î so I replaced some german characters to them Also, I found that in the |
|
Sorry, between multiple maintainers being on vacation and a critical issue coming up that needed to be handled before the upcoming 9.1 release, there hasn't been much time spent on this. As far as testing is concerned, this PR is ready to go, and the racing impact has been deemed acceptable, but we haven't reached a consensus on how it should interact with the settings string or how it should be presented in the GUI. |
|
@fenhl I have one solution regarding the racing impact and that is to implement SHA256 (or similar hashing tech) for the language Calculate SHA256 over the language file (for example English's For placement of GUI, I think under or beside of the Enable Plandomizer / Cosmetic Plandomizer switch is great |
|
Given that the racing impact has been deemed acceptable, I don't think we should implement any sort of verification mechanism. It would only add to the overhead for racers and race mods. |
I remember running into this before, and unfortunately as far as I remember this is actually how it is implemented in the game. You can see on cloudmodding: https://wiki.cloudmodding.com/oot/Text_Format |
|
Weird that there is no reference to this in decomp from what I can see. However it does seem like rando has it correct for the way it was implemented in game to me too. |
I don't think the actual accented characters would be listed anywhere in the codebase, just the character IDs corresponding to textures, which wouldn't be present in decomp |
@cjohnson57 |
I believe assets/text/charmap.nes.txt should have it documented, and technically there is a bug with the chamap being used for both N64 and GameCube builds, but the game just happens to not use it, or happily just displays the wrong texture for some other reason, so it doesn't cause a mismatch when compiled. |
|
Okay we talked about it a bit. We think that the language setting should not affect settings string, so it acts sort of like a cosmetic setting. Along with this it should not change item placement either to be clear. |
|
@cjohnson57 @fenhl Should I include these changes as well?
|
Why are these changes needed? |
|
@cjohnson57 This is the message which is added in the newest version of |
|
@JackTriton Oh sorry I misunderstood why you were posting that. Yes, please do include it. |
|
@fenhl @cjohnson57 Both cosmetic settings and 0x9097 entry are applied |



Hi, it's been a long time
This PR is redo of all of the functions I made almost 5 years ago
Description
With this PR, you can play OOTR with different languages or event texts / custom texts as well
Addition
Files
Also, you can add another language file just by drag and drop the file with same structure
For how to create and what file is included, checkout
language / README.mdAdditional Control Codes for wide characters
For the character to use, check out
Messages.pyText alignment
How to Change the language?
You can change the language by changing
Main Rules >> Language >> Language SelectionTips for language creation
If you want to add language with characters not included in vanilla game (for example Spanish has
ñ), do the same thing as other images: decompile the original game, replace some files with new one and recompile / get diff withget_diff.pyNotes
Currently, besides English which is already implemented from beginning, it allows you to play with Japanese as well
Why Japanese? well, it's because Japanese is the other language that NTSC rom has and one of language that uses wide characters instead and also because I'm Japanese
Just because I didn't implemented other languages such as German, French or Chinese (which is PAL and iQue version has), that doesn't mean you can't play with those languages or other languages that only got the translated version by using mod / patch or even that never got the version
Not only that, you can create version for events, competition or even speedruns as well (like shortening all of the texts, and speed up everything)
Screen shots