I'm interested how should I approach creating a language switcher like countries switcher?
The idea is that I wish to have country specific content and restrictions (just like with languages) but I want to allow all languages for every country.
Ideally I'd need to have the country value as a global variable and even in the cookies. A great bonus would be if I could assign it to the url like languages (../en/.. -> --/us/en/..) without ruining routing for core or path auto/url aliases etc..
But I don't know how and where to start and can't even find materials on people having done anything similar before.
My train of thought here would be the following:
- Create custom module
- Create a countries database/list
- Set the country as a global variable somehow
- Set the country as a cookie and fetch on every page load (or if possible to and from url)
- Create the selector widget
Any ideas how to better understand what I'm facing and recommendations for tackling this? Also a lot of big corporations have location selectors with that locations languages which restrict content, how is this not possible with Drupal? (Couldn't even find anything for D7)