We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a site with the following locales: es (default), en (generic) and pt. The url structure should be as follows:
/nosotros //es /en/about-us //en /pt/sobre-nos //pt
That can be achieved by setting app.fallback_locale = 'es', however I need english to be the generic language.
app.fallback_locale = 'es'
Taking a look to the code, this function forces the default (hidden) url prefix, to be the same as the fallback_locale language.
protected function generatePrefixForLocale(string $key, string $locale) : ?string { if ($key == '/') { return null; } if ($locale != config('app.fallback_locale')) { return $locale; } return config('laravel-multilingual-routes.prefix_fallback') ? $locale : null; }
Just by adding a laravel-multilingual-routes.default_locale config param should do the trick. If you're happy with that, I can provide a PR.
laravel-multilingual-routes.default_locale
Thanks
The text was updated successfully, but these errors were encountered:
@jsanchezgr Yeah sure I'd accept a PR for that. Might as well change the prefix_fallback to prefix_default. 😄
prefix_fallback
prefix_default
Sorry, something went wrong.
@jsanchezgr I will have time to fix this issue this weekend. Can you let me know if you are about to finish this? Don't want to waste your effort! 😅
@jsanchezgr The configuration is now available in v1.4.0. 😄
chinleung
No branches or pull requests
Context
I have a site with the following locales: es (default), en (generic) and pt. The url structure should be as follows:
That can be achieved by setting
app.fallback_locale = 'es'
, however I need english to be the generic language.Problem
Taking a look to the code, this function forces the default (hidden) url prefix, to be the same as the fallback_locale language.
Potential fix
Just by adding a
laravel-multilingual-routes.default_locale
config param should do the trick. If you're happy with that, I can provide a PR.Thanks
The text was updated successfully, but these errors were encountered: