Zezombye / overpy

High-level language for the Overwatch Workshop with support for compilation and decompilation.
GNU General Public License v3.0
178 stars 27 forks source link

Fixes pasting in chinese workshop code in chinese client. #373

Closed kektram closed 3 months ago

kektram commented 3 months ago

Fixes a workshop bug specific to chinese workshop, setting "None" values to "无" instead of "全部禁用", causing projects compiled by overpy to fail to paste to workshop with errors.

Zezombye commented 3 months ago

This will get overridden the next time translations are generated. Either the GUID is wrong, or the translation got updated (in which case this PR would work but we gotta make sure it doesn't get reverted when datatool comes out for the latest update)

CactusPuppy commented 3 months ago

Upon further investigation, it turns out that Overwatch itself isn't giving the right translation when copying, so fixing this translation error would require us to do one of the following:

  1. Break decompiling
  2. Break compiling (current state)
  3. Write code that handles every specific case where Overwatch provides the wrong translation

Given the massive amount of work Option 3 would require, and that Options 1 and 2 are pretty much equally bad, this issue is going to be closed as a "won't fix" for now.

To obtain an incorrect translation:

  1. Import code XHJYK with the game client language set to 简体中文
  2. Copy the rules to clipboard
  3. Paste the rules
  4. Note that an error is output in the chat image
Zezombye commented 3 months ago

Option 3 should be ez to do by manually overriding in astToWorkshop.ts, like I did for a similar bug with Japanese: https://github.com/Zezombye/overpy/blob/e21b5fa2ca2224542b798c04b0c00c0cfb230fc6/src/compiler/astToWorkshop.ts#L468

@kektram please provide the exact overpy code that fails (so we can know exactly which instances of "none" to replace)

kektram commented 3 months ago

I didn't do any testing. I only verified it got fixed by manually replacing the invalid none entries with the corrected ones.

I was notified of the issue with these steps: 1) put ur client langauge on CN 2) load code 54cry 3) copy the code from ingame 4) paste it back in

After step 3, I manually replaced all invalid "None" entries with the corrected one, and that allowed me to paste it back in. I was told this code is compiled with overpy, I believe it to be "Genji parkour" https://github.com/tylovejoy/genji-framework

CactusPuppy commented 3 months ago

If someone wants to fix this bug, all they would have to do is import XHJYK, copy the rules, paste, and fix the errors one by one. This will catch all instances where the parser expects the other version of None.