You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The browser is correctly redirected (e.g. /en) but laravel throws an NotFoundHttpException error. Maybe I just did a misconfiguration, but \Log::debug($localizer->localeFromRequest()) returns an empty value.
routes.php
// bug fix for Waavi…::localeFromRequest() problem
$localizer = \App::make(\Waavi\Translation\UriLocalizer::class);
Route::group(['prefix' => $localizer->localeFromRequest(), 'middleware' => 'web'], function () {
Route::get('/', function () {
return view('welcome');
});
});
I added the localize middleware to the web middleware group.
As soon as I change the following
Repositories/LanguageRepository.php
/**
* Returns a list of all available locales.
*
* @return array
*/
public function availableLocales()
{
/*if ($this->config->has('translator.locales')) {
return $this->config->get('translator.locales');
}
if ($this->tableExists()) {
$locales = $this->model->distinct()->get()->lists('locale')->toArray();
$this->config->set('translator.locales', $locales);
return $locales;
}*/
return $this->defaultAvailableLocales;
}
Everything seems to work…
The text was updated successfully, but these errors were encountered:
Have you loaded your available languages into the database? You need to have at least the default language entry for the package to work. Since you are using english, please check your translator_languages table has at least one entry like so:
The browser is correctly redirected (e.g. /en) but laravel throws an NotFoundHttpException error. Maybe I just did a misconfiguration, but
\Log::debug($localizer->localeFromRequest())
returns an empty value.routes.php
I added the localize middleware to the web middleware group.
As soon as I change the following
Repositories/LanguageRepository.php
Everything seems to work…
The text was updated successfully, but these errors were encountered: