Language: Fallback to English if the language don't have the value - #2598
Conversation
|
Getting this error trying to generate with Japanese on this branch. If I revert to dev I can generate Japanese fine |
|
@cjohnson57 I reviewed and found out that the |
|
@cjohnson57 I think it's fixed now |
Now I'm getting this: 'cp932' codec can't encode character '\x82' in position 0: illegal multibyte sequence Traceback (most recent call last): File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\OoTRandomizer.py", line 57, in start main(settings) ~~~~^^^^^^^^^^ File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Main.py", line 57, in main patch_and_output(settings, spoiler, rom) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Main.py", line 379, in patch_and_output patch_cosmetics_log = prepare_rom(spoiler, world, rom, settings, rng_state, restore_rom) File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Main.py", line 221, in prepare_rom patch_rom(spoiler, world, rom) ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Patches.py", line 1563, in patch_rom update_message_by_id(messages, text_id, message, lang) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Messages.py", line 873, in update_message_by_id text = line_wrap(text, lang.base, align=lang.lang_property["align_text"]) File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\TextBox.py", line 57, in line_wrap text_codes = Messages.parse_control_codes(text, lang_index) File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Messages.py", line 368, in parse_control_codes text_bytes = encode_text_string(text) if lang else encode_text_string_jp(text) ~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "C:\Users\Caleb\Repos\OoT-Randomizer-Tests\Messages.py", line 325, in encode_text_string_jp result.append(int.from_bytes(ch.encode("cp932"), "big")) ~~~~~~~~~^^^^^^^^^ UnicodeEncodeError: 'cp932' codec can't encode character '\x82' in position 0: illegal multibyte sequence encoding with 'cp932' codec failed |
|
@cjohnson57 This exact error is caused around |
|
@cjohnson57 How about now? |
|
Yeah seems good now |
This allows to fallback texts using English's
property.jsonif the text don't exist in the Language