Documentation · Chapter 11

Prepare one application for several languages.

Internationalization, or i18n, moves user-facing messages out of code so the same behavior can speak several languages.

Every lesson starts from the problem, explains the mechanism, then gives a concrete verification.

≈ 75 min

Translation is not duplicated code

Do not create one controller per language. Routes and business rules remain shared; only messages, formatting, and selected content vary.

Language and locale differ

A language is French or English. A locale such as fr_CA may also describe regional formatting. PHPAML accepts compact supported locale identifiers.

Plan before translating

List visible strings, decide stable keys, choose the default and fallback, and decide whether locale lives in the route, cookie, or Accept-Language header.