I’m trying to solve this whole day, and finally I will come to you.
The task is simple, I need to set the type of language in the URL, so it looks something like this: domain.com/{langVarasket/other/paths
And you can change it by clicking / selecting the language in the application header or any other component.
Important: the language variable must always remain in the URL.
I use "agent-router": "^ 2.7.0", "react": "^ 15.3.1".
Here's what my router configurator looks like:
export default (
<Router history={browserHistory}>
<Route path="/:lang" component={MainApp}>
<IndexRoute component={Home} />
<Route component={OtherPage} />
</Route>
<Route path='*' component={NotFound} />
</Router>
);
I hope this will be if I do not update my question. But to me, this seems like a pretty normal use case for site URLs.
thank