umpirsky/i18n-routing-bundle
Symfony bundle for internationalized routing: define routes with locale-specific paths and prefixes, so URLs are translated per language while sharing the same controller. Handles locale detection and generation for multilingual applications.
This is a Symfony bundle, not a Laravel package — flag that immediately. If you're a Laravel dev, you cannot composer require it into a Laravel app and expect it to work; it hooks into Symfony's Kernel, RouteCollection, and DI container. If you're touching a legacy Symfony project (it's a 2013-era bundle with 3 stars and 0 dependents), start here:
DependencyInjection and routing classes are the only reliable docs. Confirm the supported Symfony version in composer.json before anything else.composer require umpirsky/i18n-routing-bundle (accept the resolver prompt; expect it may pull an old Symfony constraint).AppKernel.php $bundles[] or config/bundles.php; older → app/AppKernel.php.bin/console debug:router), since a silent no-op is the most likely failure mode with a bundle this old.First use case: locale-prefixed URLs generated from a single route definition — e.g. one contact route that resolves to /en/contact, /fr/contact, etc., without duplicating route entries. Verify this with debug:router before building on it.
routing.yml/controller annotation block and let the bundle/DI handle the locale dimension.{_locale} (Symfony's convention) in the path. Generate links with $router->generate('route_name', ['_locale' => 'fr']). Make sure your locale requirement regex (en|fr|de) is set so the matcher stays fast._locale from the request via a kernel.request listener. Don't rely on the bundle alone to set the app locale — register/confirm a listener that calls $request->setLocale() from _locale, otherwise your translator will still serve the default language even though the URL is localized.path('route', {_locale: app.request.locale}) so links stay in the current language; keep a helper/macro to avoid repeating the locale arg everywhere.bin/console cache:clear and, for prod, cache:warmup — routing is compiled, so a stale cache after a config change is a common false alarm.config.yml (framework.default_locale) and keep it consistent with the bundle's locale requirement, or unmatched paths will 404 instead of falling back.mcamara/laravel-localization or spatie/laravel-translatable + route groups — do not force this bundle in.composer.json, and budget time to fork/patch rather than wait for upstream fixes.debug:router shows no locale prefixes, the bundle isn't loading — check bundle registration, the compiler pass priority, and that your routes aren't bypassing the loader._locale vs. app locale drift. A localized URL does not automatically localize your translations — the two are separate. Debug with $request->getLocale() vs $request->attributes->get('_locale') when translations "don't switch."bin/console debug:router --show-controllers and router:match /fr/... to see exactly which route wins; this is the fastest way to tell whether the bundle or your listener is misbehaving.{_locale} prefixes directly with Symfony — for most apps the manual approach costs nothing and avoids the dependency.How can I help you explore Laravel packages today?