Skip to content

Conversation

@JackTriton
Copy link

@JackTriton JackTriton commented Aug 5, 2025

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

  • language (folder): Consists every language you can play with
    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.md
  • Language.py: allows to manage language files (json, bin, ia4)

Additional Control Codes for wide characters

  • All of the additional control codes are placed the code + 0x8700 (for example, silver rupee count is placed 0xF0 + 0x8700 = 0x87F0)
    For the character to use, check out Messages.py

Text alignment

  • You can change the alignment of the text to Left, Center and Right

How to Change the language?

You can change the language by changing Main Rules >> Language >> Language Selection


Tips 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 with get_diff.py


Notes

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

Setting View

Title for Japanese

Title for English

@fenhl fenhl self-requested a review August 5, 2025 05:16
@fenhl fenhl added Type: Enhancement New feature or request Status: Needs Review Someone should be looking at it Component: Setting specific to setting(s) Status: Needs Testing Probably should be tested Component: Misc A catch-all label labels Aug 5, 2025
@JackTriton JackTriton marked this pull request as ready for review August 5, 2025 05:17
@fenhl fenhl mentioned this pull request Aug 5, 2025
Copy link
Collaborator

@fenhl fenhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and cbf; single-letter variable names in Language.format_from_text and Patches.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 else case. 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_Store files to the repo. These should be removed, and I recommend adding them to your .git/info/exclude to 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.

@JackTriton
Copy link
Author

Most of the system reworked, deleted .DS_Store, add some descriptions to the property_build.py and changed some of the values to have clearer infos

@JackTriton JackTriton requested a review from fenhl August 6, 2025 04:04
Copy link
Collaborator

@cjohnson57 cjohnson57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@cjohnson57
Copy link
Collaborator

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.

@JackTriton
Copy link
Author

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!

@cjohnson57
Copy link
Collaborator

One question, what exactly is the purpose of the property_build.py file? It seems to mainly contain the English messages that are now formatted in the English folder's property.json. Is it to generate the property.json?

@flagrama
Copy link

Adding byteorder="big" to the function call fixed it, but I'm not actually sure why that was necessary when the function definition already sets it to big by default? result.append(int.from_bytes(h.encode("cp932"), byteorder="big"))

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.

@cjohnson57
Copy link
Collaborator

Interesting, ty for the info!

@JackTriton
Copy link
Author

One question, what exactly is the purpose of the property_build.py file? It seems to mainly contain the English messages that are now formatted in the English folder's property.json. Is it to generate the property.json?

property_build.py creates property.json for the language
The default value would be the ones on English for compare / know what string to use

Also, the PLANE_TEXTS would be the ones for other texts to implement in game when the language is not on NTSC or any kind of variety

@cjohnson57
Copy link
Collaborator

Gotcha. Should that be "plain" texts?

@JackTriton
Copy link
Author

Gotcha. Should that be "plain" texts?

Oh, sorry yes PLAIN_TEXTS

@JackTriton JackTriton requested a review from cjohnson57 August 10, 2025 01:36
Copy link
Collaborator

@cjohnson57 cjohnson57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JackTriton
Copy link
Author

@cjohnson57 Thanks for the detailed reviews!

@JackTriton
Copy link
Author

Add UnitTest that checks language file / properties

Below this is template for the errors

If the language file misses property.json
{lang_name}: property.json is not included

If some properties are missing / wrong in property.json
{lang_name}: some properties are wrong in property.json

If some bin files are not included in the bin_patch.json
{lang_name}: some non-wanted bin files are included

@JackTriton
Copy link
Author

Unless the conflicts revolve with in-game messages or custom texts, all conflicts will be resolved after merging

@flagrama
Copy link

Conflicts have to be fixed before merging, that's just how git (and other version control software) works. Do you mean "after it is reviewed"?

@fenhl
Copy link
Collaborator

fenhl commented Aug 22, 2025

Conflicts in generated files are fine to leave unresolved, they will be fixed by the maintainer who merges the PR.

@flagrama
Copy link

Conflicts in generated files are fine to leave unresolved, they will be fixed by the maintainer who merges the PR.

Oh, yeah, I'm on the app so don't know how to look at the actual conflicts. If that's all it is, ignore me.

@fenhl fenhl added the Status: Waiting for Author Changes or response requested label Aug 25, 2025
@JackTriton
Copy link
Author

JackTriton commented Aug 28, 2025

This update is to confirm what's fixed and got worse with the current code

@JackTriton JackTriton requested a review from fenhl August 28, 2025 08:59
@JackTriton
Copy link
Author

This project is not abandoned: currently waiting for change requests / pull requests on the ReLanguage branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Misc A catch-all label Component: Setting specific to setting(s) Status: Needs Review Someone should be looking at it Status: Needs Testing Probably should be tested Status: Waiting for Author Changes or response requested Type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants