zerospam/laravel-gettext
Gettext-based localization for Laravel: load PO/MO translation catalogs, translate strings with plural forms and contexts, switch locales at runtime, and use translations in Blade views. A practical alternative to Laravel’s default PHP/JSON language files.
.po/.mo exchange format means non-engineers (translators, agencies, regional marketing) can work in PoEdit and hand back files, instead of editing PHP arrays or JSON blobs in a repo. That shifts ownership of copy quality away from engineering.Adopt when:
.po files are a familiar currency rather than a new format to learn.__('key') lookup — and want that to be standard rather than hand-rolled.Look elsewhere when:
lang/ PHP and JSON files are sufficient; adding a gettext toolchain is overhead for no gain..po/.mo model, msgid churn when source strings change, and fuzzy-match review are a real learning curve.For executives: This lets us ship localized product into new markets using the translation industry's standard file format, so we can hire agencies and freelancers rather than build a bespoke pipeline. It's open source with no licensing cost, and translators work in a familiar desktop tool, which shortens the time between "we chose a market" and "we're live in that language." The strategic upside is faster, cheaper market entry with professional-quality copy; the caveat is that it's a small community project (about 100 GitHub stars), so we should validate maintainability and keep an exit path. Recommended as a low-cost enabler for a localization initiative, not as a platform bet.
For engineering: It's a thin Laravel integration over GNU gettext — .po/.mo files, plural forms, message context, locale middleware, and artisan commands to extract and refresh strings, plus caching so lookups don't hit disk per request. No proprietary format, no lock-in: the translation artifacts are portable to any gettext-aware tool or TMS later. The costs to plan for are discipline items, not technology items: keep msgid source strings stable so translations don't churn, run string extraction in CI, add a check for untranslated or fuzzy entries, and confirm the package's Laravel version support against our upgrade path. If we adopt it, we own a small piece of glue code; that's the trade for a translator-friendly workflow at zero license cost.
How can I help you explore Laravel packages today?