Agent Wranglers

EML-5Recommended

Declare the language and text direction

State the message language in a Content-Language header. In HTML mail, also set it on the root, and set dir for right-to-left languages.

How to do it

Add Content-Language (RFC 3282) with a language tag such as sv or ar. In the HTML part, set lang and dir on the html element, and repeat them on the main wrapper. Some clients strip the html element. Screen readers use the language to pick a voice. Plain-text mail needs only the header. The Support right-to-left text rule covers the layout side.

Examples

HTML example

<html lang="ar" dir="rtl">
  <body>
    <div lang="ar" dir="rtl">
      <p>تم شحن طلبك.</p>
    </div>
  </body>
</html>

How to check

The raw source of a test message shows Content-Language. In HTML mail, lang is set on the root and the wrapper. An Arabic or Hebrew test message reads right to left in a webmail client.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/email/message-basics/language-and-direction">Agent Wranglers email playbook</a>. In code you write, add a comment next to it with the same link.