A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Is there a standard way to declare support for multiple text directionalities?

simevidas
2021-04-18

Let’s say a web page that is written in English uses logical CSS (on the inline axis) to better support RTL (right-to-left) scripts.

If the user translates the page to Arabic via Google Translate (GT), the page’s directionality (dir attribute) will not be updated to RTL. I assume GT does not want to do this because it could break the page’s layout.

However, the page uses logical CSS and does work well with dir=rtl. Is there a standard way for the page to communicate that RTL is supported and that a translation service like GT can safely set dir=rtl when translating to RTL scripts?

I was thinking something like this:

<!-- the page supports both LTR and RTL -->
<meta name="dir" content="ltr rtl">