Skip to content
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

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

Closed
wants to merge 1 commit into from

Conversation

kektram
Copy link

@kektram kektram commented Jul 21, 2024

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
Copy link
Owner

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)

Copy link
Collaborator

@CactusPuppy CactusPuppy left a comment

Choose a reason for hiding this comment

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

Some of the changes here are incorrect. Not every "None" value needs to be changed from "无" to "开始加速".

For example, the following code in Simplified Chinese is valid and can be pasted:

规则("规则 1")
{
	事件
	{
		持续 - 每名玩家;
		双方;
		全部;
	}

	动作
	{
		开始加速(事件玩家, 矢量(0, 0, 0), 100, 20, 至地图, 无);
	}
}

(the above code translated to English)

rule("规则 1")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Start Accelerating(Event Player, Vector(0, 0, 0), 100, 20, To World, None);
	}
}

To actually fix the root issue, it would be necessary to find which string GUIDs are incorrect and fixing those, then running the translation task again.

@CactusPuppy
Copy link
Collaborator

CactusPuppy commented Aug 1, 2024

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

@CactusPuppy CactusPuppy closed this Aug 1, 2024
@Zezombye
Copy link
Owner

Zezombye commented Aug 2, 2024

Option 3 should be ez to do by manually overriding in astToWorkshop.ts, like I did for a similar bug with Japanese:

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

@kektram
Copy link
Author

kektram commented Aug 2, 2024

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
Copy link
Collaborator

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.

@CactusPuppy CactusPuppy reopened this Aug 5, 2024
@CactusPuppy CactusPuppy closed this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants