New issue
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
Routing name has locale suffix #329
Comments
yeah, having 2 routes is how the Symfony 4.1 feature works internally (and Symfony tries to generate the locale-specific variant first). the route generator in this bundle is not yet updated to support the same feature. |
Do you have any idea when this feature will be supported? I already worked out an idea myself but I'm not sure if it is a good one: |
The only answer I can give you is "when someone works on it". that's how open-source work when everyone is working on it on their free time (and I'm not using this bundle myself anymore since a long time, so it may not even be my priority on my free time) |
Is it possible to get some more info/input from someone who is still maintaining this bundle? |
Any news on this issue so far? |
Probably the simplest way to work around this const locale = $('body').data('locale');
const RoutingDecorator = {
generate: function (name, params) {
const orig_name = name;
try {
Routing.getRoute(name)
} catch(error) {
name = name + '.' + locale;
try {
Routing.getRoute(name)
} catch(error) {
name = orig_name;
}
}
return Routing.generate(name, params);
}
}; |
This is now supported since #334 is merged. |
I recently updated my Symfony application to 4.1 so I can use the new internationalized routing feature.
When I dump the exposed routes to a javascript file, 2 routes are generated, having the locale of the path as suffix. For example I have a route app.user.index with following paths:
In my generated file, I have to routes app.user.index.en and app.user.index.fr
The text was updated successfully, but these errors were encountered: