# Internationalization (i18n)

URL: /bengal/docs/build-sites/structure/i18n/
Section: i18n
Description: Multi-language sites with gettext PO/MO, RTL support, and translation workflows

---

> For a complete page index, fetch /bengal/llms.txt.

Bengal supports multi-language sites with directory-based content, gettext PO/MO translation files, plural-aware translations via`nt()`, and full RTL (right-to-left) layout support for Arabic, Hebrew, and other bidirectional languages.

## Do I Need This?

Note

Skip this if: Your site is single-language only.
Read this if: You need translated content, hreflang SEO, RTL layouts, or a translator workflow.

## Quick Start

- Configure languages in`bengal.toml`:

toml
TOML

```
[i18n]
default_language = "en"
strategy = "prefix"
content_structure = "dir"
languages = [
    { code = "en", name = "English", weight = 1 },
    { code = "es", name = "Español", weight = 2 },
    { code = "ar", name = "العربية", weight = 3, rtl = true },
]
```

- Create content per locale:

```
content/
├── en/
│   ├── _index.md
│   └── about.md
├── es/
│   ├── _index.md
│   └── about.md
└── ar/
    ├── _index.md
    └── about.md
```

- Add PO translation files for UI strings:

```
i18n/
├── en/LC_MESSAGES/messages.po
├── es/LC_MESSAGES/messages.po
└── ar/LC_MESSAGES/messages.po
```

- Use`t()`in templates:

html
HTML

```
<nav>
  <a href="/">{{ t("Home") }}</a>
  <a href="/about/">{{ t("About") }}</a>
</nav>
```

- Compile and build:

BASH

```
bengal i18n compile
bengal build
```
## Translation Workflow

Step
Command
Description

Extract
`bengal i18n extract`
Scan templates for`t()` calls, generate `.pot`

Translate
Edit`.po`files
Add translations with a PO editor (e.g. Poedit)

Compile
`bengal i18n compile`
Compile`.po` → `.mo`for faster loading

Status
`bengal i18n status`
Check translation coverage per locale

Build
`bengal build`
Generate site

## Key Concepts

- Content structure:`dir` (content/en/, content/es/) or `file`(about.en.md, about.es.md)

- URL strategy:`prefix` (/en/, /es/) or `subdomain`(en.example.com)

- Fallback: When a key is missing, Bengal falls back to the default language

- RTL: Arabic and Hebrew get`dir="rtl"` on `<html>`automatically

## Guides

i18n Quickstart

Set up a bilingual site with gettext PO/MO in 5 minutes

(/bengal/docs/build-sites/structure/i18n/quickstart/)

RTL Layout Support

CSS authoring for Arabic, Hebrew, and bidirectional sites

(/bengal/docs/build-sites/structure/i18n/rtl/)

Translator Contributor Guide

How to contribute translations and PO file conventions

(/bengal/docs/build-sites/structure/i18n/translator-guide/)

Multilingual Sites

Serve your documentation in multiple languages with proper URL routing and translations

(/bengal/docs/build-sites/structure/i18n/multilingual/)

## In This Section

i18n Quickstart (/bengal/docs/build-sites/structure/i18n/quickstart/)

Set up a bilingual site with gettext PO/MO in 5 minutes

Multilingual Sites (/bengal/docs/build-sites/structure/i18n/multilingual/)

Serve your documentation in multiple languages with proper URL routing and translations

RTL Layout Support (/bengal/docs/build-sites/structure/i18n/rtl/)

CSS authoring for Arabic, Hebrew, and bidirectional sites

Translator Contributor Guide (/bengal/docs/build-sites/structure/i18n/translator-guide/)

How to contribute translations and PO file conventions

Related Pages

Configuration (/bengal/docs/ship/configuration/)

Configuring Bengal with bengal.toml

Related

Ship (/bengal/docs/ship/)

Build configuration, SEO/discovery, output formats, and deployment

Related

Runtime Capabilities (/bengal/docs/ship/configuration/capabilities/)

Enable self-hosted diagram, math, and third-party JS capabilities

Related

Analysis (/bengal/docs/build-sites/structure/analysis/)

Site structure analysis tools

Related

Versioned Documentation (/bengal/docs/build-sites/structure/versioning/)

Serve multiple versions of your documentation from a single site

Related

persona-operator (/bengal/tags/persona-operator/)
