I think you should document in the README that, when using named routes and route translation together, if you want Router::getCurrentVersions() to work properly, you must give each route exactly the same name that you are using in Router::resolve().
or getCurrentVersions() won't return the translated routes.
Likewise, in the README's example to get the localized version of a route, if you wanted to name it, you should explain that it needs to be named exactly the same as the translation key. In the example:
Hi.
I think you should document in the README that, when using named routes and route translation together, if you want
Router::getCurrentVersions()
to work properly, you must give each route exactly the same name that you are using inRouter::resolve()
.For example, if you have:
you have to name it
routes.blog
:or
getCurrentVersions()
won't return the translated routes.Likewise, in the README's example to get the localized version of a route, if you wanted to name it, you should explain that it needs to be named exactly the same as the translation key. In the example:
if you define the route as follows:
it won't work, it will return the current url.
This is due to how
findRoutePathByName()
is written.