Skip to content

Add in-context translations#600

Merged
microbit-matt-hillsdon merged 4 commits intomainfrom
in-context-translations
Jun 25, 2025
Merged

Add in-context translations#600
microbit-matt-hillsdon merged 4 commits intomainfrom
in-context-translations

Conversation

@microbit-grace
Copy link
Copy Markdown

Task (Private)

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

@github-actions
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

Copy link
Copy Markdown

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