I'm working on a multilingual site so I want to suffix all my urls with the current 2-character language code. If no language is specified I want to default to english.
For example:
mysite.com/
--> mysite.com/en
mysite.com/location
--> mysite.com/locations/en
mysite.com/ar
will display the arabic site
Since I don't want to add (?P<language>[a-x]{2})$
to all my urls I'm guessing I should write some middleware to check for the suffix and strip it out?
What's the best way to achieve this?