Skip to content

Add in-context translations #600

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

Merged
merged 4 commits into from
Jun 25, 2025
Merged

Conversation

microbit-grace
Copy link

Task (Private)

Add translate flag for changing the language to lol and for adding jipt script.

Copy link

github-actions bot commented Jun 20, 2025

@microbit-grace microbit-grace changed the title Add in-context translations [WIP - DO NOT MERGE] Add in-context translations Jun 20, 2025
@microbit-grace
Copy link
Author

microbit-grace commented Jun 20, 2025

Clicking "Edit in MakeCode" seem to cause an error when doing in-context translation. Needs investigating.

Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Seems to do with the isLoading state in the button.

Fixed (see comment below)

@microbit-grace microbit-grace force-pushed the in-context-translations branch from 573c693 to 8f3b9d7 Compare June 24, 2025 09:18
Comment on lines 4 to 13
// Workaround to avoid error caused by DOM changes when doing in-context translations.
export const ButtonWithLoading = ({ isLoading, ...props }: ButtonProps) => {
return (
<Button
{...props}
isLoading={isLoading && !flags.translate}
disabled={isLoading}
/>
);
};
Copy link
Author

Choose a reason for hiding this comment

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

Not very ideal. Suggestions on a better way of doing this welcome.

Choose a reason for hiding this comment

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

Urgh. No good suggestions unfortunately.

@microbit-grace microbit-grace changed the title [WIP - DO NOT MERGE] Add in-context translations Add in-context translations Jun 24, 2025
@microbit-grace microbit-grace requested a review from a team June 24, 2025 09:50
@microbit-grace microbit-grace marked this pull request as ready for review June 24, 2025 09:50
@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 0183a3b into main Jun 25, 2025
1 check passed
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the in-context-translations branch June 25, 2025 15:14
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.

2 participants