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
- RFC 3282, Content Language Headers
- HTML Standard, the lang attribute
- HTML Standard, the dir attribute
Related rules
- WEB-2 Say the page's language in Website
- LOC-9 Support right-to-left text in Localization
- LOC-6 Mark foreign words in Localization
- LOC-40 Translate every part of an email in Localization
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.