Skip to content

Add translate=no attribute or notranslate classes in non-descriptive rendered fields #2696

Open
@displague

Description

@displague

Describe the problem to be solved

When using an external translation service, such as localizejs.com or Google Translate, the services can not distinguish which elements of a Redoc generated page should be translated and which should be left as-is.

Describe the solution you'd like

A common convention is to use a <code> element, use the W3C defined translate="no" attribute, or apply a specific class to any element, such as notranslate (honored by Google Translate and LocalizeJS.com).

Redoc should add this common attribute (translate="no") or class (notranslate to content derived from API spec fields other than summary and description (others may apply).

Describe alternatives you've considered

I do not know if these approaches are universal among client-side translation tools. This setting may need to be configurable by users, including the special class name. For a minimal change, I would error on the side of honoring the W3C defined attribute (by default) and giving users an opt-out flag.

Additional context

Relates to #367

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions