With the Automatic User Language Detection Add-on users will be redirected to their preferred language.
First time visitors will be redirected to their preferred language based on their browser settings or IP address. The language is then saved in a cookie so that any time they return to the website, they will be automatically redirected to their last visited language.
Install the Automatic User Language Detection Add-on
The add-on is available for download from your account.
Once downloaded it can be installed just like any normal WordPress plugin.
Configure your menu items
With the add-on active, you can go to Settings -> TranslatePress and select the method of language detection.
You can choose what method to be considered: their browser language setting, or their IP address.
Selecting the option First by browser language, then IP address will consider the user’s browser language setting.
If it doesn’t match any of the site’s available languages selected in TranslatePress settings, then the IP address of the user will be used to determine its preferred language.
If this doesn’t match any of the available languages either, then the default language will be displayed to the user or, if the option Use subdirectory for default language is set to Yes, the first language in the Translation Languages option.
Similarly, selecting the option First by IP address, then browser language will determine the language by IP and if that fails then browser language is considered.
Selecting Only by browser language or Only by IP address will not have a fallback user language detection method.
IP address based language
The visitor’s IP address is searched in the GeoLite2 database to determine the country from which the user accessed the website. The country is then searched in the locales code of the selected translation languages in TranslatePress Settings.
This product includes GeoLite2 data created by MaxMind.