Skip to content

Prevent translation of code blocks by wrapping them in <code> tag #1274

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 1 commit into from
Nov 4, 2022

Conversation

igrlk
Copy link
Contributor

@igrlk igrlk commented Oct 30, 2022

Closes #3561

Description

When using google translate on the docs website, it translates everything including the code examples.
This PR wraps all the code blocks with <code> tag that prevents google translate from translating the contents of code examples.

Screenshots

Translation to french using google translate extension.

Before, npm install code block is translated:

Screenshot 2022-10-30 at 14 12 13

After, npm install code block is not translated:

Screenshot 2022-10-30 at 14 12 22

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

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

This is awesome @igrlk - validated locally - thanks for the contribution!

CleanShot 2022-11-03 at 20 15 54

@hwillson hwillson merged commit 0d227f8 into graphql:source Nov 4, 2022
@igrlk igrlk deleted the prevent-translation-of-code-blocks branch November 4, 2022 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

关于文档的优化建议
2 participants