laminas/laminas-mvc-i18n
Laminas MVC I18n integrates laminas-i18n with laminas-mvc, wiring translators, locale detection, and translated validators and route messages into your application via configurable service managers and view helpers.
laminas-mvc and laminas-i18n: it wires a translator into the service container, exposes a TranslatorAwareInterface plugin, adds a view helper, and gives you per-request locale resolution (Accept-Language, route segment, session). If you own Laminas apps that need multi-language output, this is the "buy" option in a build-vs-buy call.laminas-i18n already offers, and no front-end/JS i18n. Do not let it appear on a Laravel i18n evaluation shortlist.Adopt it when:
laminas-mvc (ZF3+) applications and need request-scoped locale selection plus translator injection into controllers and views.laminas-i18n-supported formats (gettext, INI, PHP arrays) and you want the canonical integration rather than bespoke factories.Accept-Language negotiation or route-prefix locale handling without building it.Look elsewhere when:
lang/ files, __() / @lang, trans_choice for pluralization, a SetLocale middleware, and JSON translations for front-end strings. For locale-prefixed URLs, mcamara/laravel-localization covers the route-segment case. This package cannot be dropped into a Laravel app.symfony/translation with its locale listener.To executives: This is a small, permissively licensed (BSD-3-Clause) integration library that removes custom localization plumbing from our legacy Laminas services. It is a contained, low-cost maintenance decision — not a platform bet. It does not expand our technology footprint, does not require new licensing spend, and its scope is limited to locale detection and translator wiring. It should be framed as "keep the lights on cheaply" while the longer-term question — whether those services migrate to Laravel and its built-in i18n — is decided separately.
To engineering: It is the standard, maintained bridge between laminas-mvc and laminas-i18n: DI-based translator factory, TranslatorAwareInterface plugin, view helper, and request-level locale resolution from Accept-Language, route, or session. Adopting it replaces in-house factories and listeners with a released, Oct-2024-current dependency and makes onboarding familiar to anyone who has worked in the Laminas ecosystem. Pin the version, track releases, and treat it as maintain-only.
The caveat to state plainly in both rooms: it is not a Laravel package and offers nothing for Laravel product lines, and its low community adoption (14 stars) means we own the upgrade risk. If consolidation onto Laravel is likely within the planning horizon, skip it and absorb the short-term cost of doing locale handling without it — or accept a thin custom shim — rather than adding a dependency we will retire.
How can I help you explore Laravel packages today?