---
title: "Declare the language and text direction · Agent Wranglers"
url: https://agentwranglers.se/playbook/email/message-basics/language-and-direction
updated: 2026-10-20
licence: "All rights reserved"
---

# Declare the language and text direction

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Message basics](https://agentwranglers.se/playbook/email/message-basics)
- Rule: 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: 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.
- 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.

Example:

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

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers email playbook: https://agentwranglers.se/playbook/email/message-basics/language-and-direction`.

- Previous: [Encode everything as UTF-8](https://agentwranglers.se/playbook/email/message-basics/utf-8)
- Next: [Accept international addresses](https://agentwranglers.se/playbook/email/message-basics/international-addresses)
- [Message basics](https://agentwranglers.se/playbook/email/message-basics)
