Skip to content

Conversation

@displague
Copy link

@displague displague commented Jun 5, 2025

What/Why/How?

This VS Code Copilot created PR is a proof-of-concept of the translate="no" feature described in the issue linked below. This is a light approach to enable tools like Google Translate (and others) to better handle Redoc rendered OpenAPI specs using a W3C standard HTML attribute.

(Project owners: feel free to close this if you have a better sense of what changes are appropriate and it is faster to iterate on this idea without an outside collaborator.)

Prompt (~):

Implement the recommendation in #2696 using the translate="no" approach described in the issue. I believe all of the relevant blocks of code will can be found at locations where "<span" is included in the code.

Reference

Fixes #2696

Tests

Using npm start and reviewing the rendered spec (museum.yaml) for markup.

Screenshots (optional)

Check yourself

  • Code is linted
  • Tested
  • All new/updated code is covered with tests
Copy link
Author

@displague displague left a comment

Choose a reason for hiding this comment

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

This PR is in draft and not considered to be complete. I believe I've seen <div> used for some text elements in Redoc renderings. In the prompt for this change I hinted that likely candidates for change would be <span> elements.

I don't believe <code> needs to be decorated the same way, but we could easily add that if we can not assume translation services block those elements.

Signed-off-by: Marques Johansson <marques@displague.com>
@displague
Copy link
Author

displague commented Jun 23, 2025

I see the translate=no appearing in the right-side panel, the JSON example blocks, but I'm not seeing it in the left side where the descriptions are. I would appreciate any pointers.

@displague displague marked this pull request as ready for review June 30, 2025 13:58
@displague displague requested a review from a team as a code owner June 30, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant