I am developing a website that works in two languages. I need to change URL to include the selected language.
What I exactly need is:
- Pick the current URL
- Check if the URL contains any language code
- Append the code if not exist or change the code to the selected one if exists
For example, there is an URL for English (default):
http://localhost:11767/Home/resultMain?model=1&&type=1
When a user selects Spanish (es) it should be:
http://localhost:11767/es/Home/resultMain?model=1&&type=1