The following steps to configure Magento 2 Auto Language Switcher:
1. Go to Stores > Configuration > Magefan Extensions > Auto Language Switcher.
2. Enable the extension.
3. Select the Switcher Mode.
4. Choose whether you want to Share Store View Per Website or to set it to be Global.
In case you choose the Suggestion Popup Switcher Mode you would additionally need to enter the Suggestion Popup Text that will be displayed on the storefront.
Here is the example of the Suggestion Popup customer will see if you decide to use it:
5. Configure Language Switcher Extension Restrictions.
- Choose the Allowed Pages you want this extension to work for. You can choose All Pages, Specified Pages, and All pages except specified pages.
- In case you choose to allows the extension to work for All Pages, set the User Agents and enter the comma-separated IPs which the extensions should be disabled for.
Whether you choose Specified Pages or All pages except specified pages set the patches of those pages and set the User Agents and IPs that you want extensions to be disabled for.
6. Configure Default Store View By Country.
Select a region and country you are interested in and set the default store-view for it. You can leave default settings to detect store-view based on the customer browser language.
Once all of the configurations have been finished don't forget to press the Save Config button and flush Magento Cache.
There's also a quick walkthrough if you want to see how we configure the language switcher in Magento:
But that's not it. You also have to make sure customers' location is detected properly. So, go to GeoIP Database tab to configure that.
Enter MaxMind Lisence Key if you want to update MaxMind GeoIP Database directly from MaxMind and not via the Magefan server. Also, if you use Cloudflare, Enable Cloudflare IP Geolocation.
Once you finish, save the configuration and test Language Switcher to see how it works for different locations.