Open jvanremoortere opened 8 years ago
@goeroe, you cannot set the route that way. The route is set in ManagerServiceProvider::boot
method https://github.com/vsch/laravel-translation-manager/blob/master/src/ManagerServiceProvider.php#L106-L113
I can see only two reasons for this:
config/laravel-translation-manager.php
in your project which is created with defaults when you publish the config.config\app.php
. Are you sure that the Service has been added to the config\app.php?The other option is to set a break point on line 106 above and see what values you get and if that part of the code is executed.
Thanks for the quick reply.
Everything is done properly but it seems the problem lies in the handle function of another package ( Marwelln/laravel-multiple-locales ) that handles the multiple locales.
Is there a way to enable/disable it for certain routes? At least to leave the route for translation manager web interface alone. You can modify the handle
function of the middleware to check if the route starts with the translation manager web interface route and then skip to the next handler without any changes.
That's what I did right now...
// Check if the first url segment is the route for translation
if($request->segment(1) != $this->app->config->get('laravel-translation-manager.route.prefix')) {
// Do the stuff from the Language middleware
} else {
// Just set the standard locale
}
Now it works but for some strange reason "translations" gets seen as a locale/language...
The language middleware uses the first part of the path to select the current locale for the application. make sure that it does not happen, or in the translation manager define 'show_locales' array to include only the locales you want to show and leave out 'translations' locale.
The middleware seems to be a very minimal implementation. There should be more control on what routes are affected.
When following all the instalation steps, without changing the route prefix in the laravel-translation-manager config file, I get an error "NotFoundHttpException in RouteCollection.php in line XXX".
Therefor I tried adding the route manually to my routes.php file
But now I get the following error "Undefined variable: package"... Line 7