Open CristianEstiber opened 5 years ago
Hello, I have mapped my locales like that:
'localesMapping' => ['es' => 'es_ES', 'en-US' => 'en_US'],
So an example of my routes would be:
http://localhost/laravel/public/es_ES/aventura http://localhost/laravel/public/en_US/adventure
this works fine except when I try to switch languages and get the route translated at the same time example:
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties) @if(app()->getLocale() != $localeCode) <a rel="alternate" hreflang="{{ $localeCode }}" class="dropdown-item" href="{{LaravelLocalization::getURLFromRouteNameTranslated($localeCode, 'routes.'.Route::currentRouteName(), []) }}">$properties['regional']</a> @endif @endforeach
I'm using the getURLFromRouteNameTranslated method instead of getLocalizedURL so I can have my urls translated, problem is it generates the routes without the localesMapping, something like that:
http://localhost/laravel/public/es/aventura http://localhost/laravel/public/en-US/adventure
Any way to get my localesMapping instead of the real locales?
same issue
Same issue
Hello, I have mapped my locales like that:
'localesMapping' => ['es' => 'es_ES', 'en-US' => 'en_US'],
So an example of my routes would be:
http://localhost/laravel/public/es_ES/aventura http://localhost/laravel/public/en_US/adventure
this works fine except when I try to switch languages and get the route translated at the same time example:
I'm using the getURLFromRouteNameTranslated method instead of getLocalizedURL so I can have my urls translated, problem is it generates the routes without the localesMapping, something like that:
http://localhost/laravel/public/es/aventura http://localhost/laravel/public/en-US/adventure
Any way to get my localesMapping instead of the real locales?