What Is Gettext? A Beginner's Guide to How It Works

A plain-English explanation of the system behind every msgid and msgstr you have ever seen. Covers the three things "gettext" means, the one big design decision (your English text is the lookup key) and everything that follows from it, the POT → PO → MO pipeline, exactly what happens at runtime when you call _(), how the locale is resolved from LANGUAGE/LC_ALL/LANG, what is actually inside a compiled MO file, why text domains exist, the ngettext/pgettext/dgettext family and runtime plural expressions, what gettext deliberately does not do, and how it compares to modern key-based JSON i18n.

Back to the PO-File blog