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.

Note: this option allows you to Auto Direct customers to the store view in their local language based on their location or displays the Suggestion Popup for customers to choose the store view manually.

4. Choose whether you want to Share Store View Per Website or to set it to be Global.

Note: If you choose to share store views Per Website then customers will be directed to the store views within one website. However, if you choose Global, customers will be directed to the store views from different websites. 

e.g. You have one website in English, Spanish, German languages, and the second website in English, Spanish, French. You set to Share Store View Globally. In case a person from France comes to your first website he/she will be redirected to your second website since there is the french store view.

Magento 2 Language Switcher General Configuration

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.

Magento 2 Language Switcher Suggestion POopup

Here is the example of the Suggestion Popup customer will see if you decide to use it:

Magento 2 Language Switcher Suggestion Popup

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.

Magento 2 Language Switcher Restrictions

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.

Magento 2 Language Switcher Extension Restrictions

6. Configure Default Store View By Country.

Magento 2 Default Store View by County

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.

Magento 2 Auto Language Switcher ,Default Store View BY Country

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. 

GeoIP Database in Magento

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.

GeoIP Detection in Magento

Once you finish, save the configuration and test Language Switcher to see how it works for different locations.