mcamara/laravel-localization — reverse-engineered prompt
Reverse engineered prompt
Build me a Laravel package that makes it easy to turn a site into a multilingual one without rewriting every route for every language.
I want people to be able to visit URLs like /en and /es, have the app detect their browser language when they first arrive, and then remember their choice with a session or cookie. Routes should only need to be defined once, but still work in every supported language. It should also support translated route paths, an option to hide the default language from the URL, localized view paths, and a simple helper or snippet for a language switcher.
Please wire it up the way a normal Laravel app would use it, with middleware for localization and redirects so non localized URLs can send people to the right localized page. Include config for supported locales and locale mapping, plus tests and clear setup notes. If there are any caveats around route caching or newer Laravel versions, call those out clearly. You can check current Laravel docs online if needed.
Want more depth? Deep Reverse