문제

I'm trying to have the URLs on my app being rendered as /<language-code>/<city>/rest/of/url/, with the language code being the currently active language and the city being a location the user selects....it's a bit like what's being done at Heart, but now with the i18n bit included.

How can I go about enabling this for my site? I'm leaning towards a middleware solution as I believe this will be easy to use and will not involve modifications to the existing URLs. Any help on this will be appreciated.

도움이 되었습니까?

해결책

Wow - I created that functionality for Heart, and I never thought anyone would want to replicate it anywhere..

In any case, assuming you're talking about the outputting of URLs within links on regionalised pages, we did achieve that in middleware. I actually wrote a blog post about it - the post is really about a separate issue, but does provide example code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top