Description
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
- https://cloud.google.com/translate/troubleshooting
- https://www.w3.org/International/questions/qa-translate-flag
- https://developers.localizejs.com/docs/using-html-syntax-to-prepare-phrases#attribute-notranslate-or-translateno
Relates to #367